From 41008541de9bd2b184058ec2204f172e3c9f64fe Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 19 Oct 2020 14:43:18 +0200 Subject: [PATCH] introduce Makefile.hotplug Signed-off-by: Jaroslav Kysela --- Makefile.am | 2 +- Makefile.fw_writer | 8 -------- Makefile.hotplug | 11 +++++++++++ aica/Makefile.am | 11 +++-------- asihpi/Makefile.am | 13 ++++--------- ca0132/Makefile.am | 11 ++--------- cs46xx/Makefile.am | 11 +++-------- echoaudio/Makefile.am | 1 + emu/Makefile.am | 1 + hdsploader/Makefile.am | 1 + korg1212/Makefile.am | 13 ++++--------- maestro3/Makefile.am | 1 + mixartloader/Makefile.am | 16 ++++++---------- multisound/Makefile.am | 1 - pcxhrloader/Makefile.am | 16 ++++++---------- sb16/Makefile.am | 1 + vxloader/Makefile.am | 11 ++++------- wavefront/Makefile.am | 1 + ymfpci/Makefile.am | 1 + 19 files changed, 51 insertions(+), 80 deletions(-) create mode 100644 Makefile.hotplug diff --git a/Makefile.am b/Makefile.am index 38e6d91..231a2ca 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,7 @@ SUBDIRS = hdsploader mixartloader pcxhrloader usx2yloader vxloader echoaudio \ asihpi emu korg1212 maestro3 multisound sb16 wavefront \ ymfpci aica ca0132 cs46xx -EXTRA_DIST = depcomp Makefile.fw_writer +EXTRA_DIST = depcomp Makefile.fw_writer Makefile.hotplug dist-hook: -chmod -R a+r $(distdir) diff --git a/Makefile.fw_writer b/Makefile.fw_writer index 8eaddfa..93b0d63 100644 --- a/Makefile.fw_writer +++ b/Makefile.fw_writer @@ -2,14 +2,6 @@ # Common parts for the firmware generation # -if USE_HOTPLUG -hotplugfwdir = @HOTPLUGFWDIR@/$(firmware_dir) -hotplugfw_DATA = $(firmware_files) -else -hotplugfwdir = -hotplugfw_DATA = -endif - LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(TARGET_ARCH_FOR_BUILD) $(fw_writer_OBJECTS) : CC=$(CC_FOR_BUILD) diff --git a/Makefile.hotplug b/Makefile.hotplug new file mode 100644 index 0000000..bd5c433 --- /dev/null +++ b/Makefile.hotplug @@ -0,0 +1,11 @@ +# +# Common parts for the firmware generation +# + +if USE_HOTPLUG +hotplugfwdir = @HOTPLUGFWDIR@/$(firmware_dir) +hotplugfw_DATA = $(firmware_files) +else +hotplugfwdir = +hotplugfw_DATA = +endif diff --git a/aica/Makefile.am b/aica/Makefile.am index 04bb267..d5ffb3f 100644 --- a/aica/Makefile.am +++ b/aica/Makefile.am @@ -1,11 +1,6 @@ +firmware_dir = firmware_files = aica_firmware.bin -if USE_HOTPLUG -hotplugfwdir = @HOTPLUGFWDIR@ -hotplugfw_DATA = $(firmware_files) -else -hotplugfwdir = -hotplugfw_DATA = -endif - EXTRA_DIST = $(firmware_files) Dreamcast_sound.txt license.txt + +include ../Makefile.hotplug diff --git a/asihpi/Makefile.am b/asihpi/Makefile.am index 45e2196..064aba2 100644 --- a/asihpi/Makefile.am +++ b/asihpi/Makefile.am @@ -1,6 +1,7 @@ MYNAME = asihpi -dsp_files = \ +firmware_dir = asihpi +firmware_files = \ dsp5000.bin\ dsp6200.bin\ dsp6205.bin\ @@ -9,12 +10,6 @@ dsp_files = \ dsp8700.bin\ dsp8900.bin -EXTRA_DIST = $(dsp_files) licence.txt +EXTRA_DIST = $(firmware_files) licence.txt -if USE_HOTPLUG -hotplugfwdir = @HOTPLUGFWDIR@/asihpi -hotplugfw_DATA = $(dsp_files) -else -hotplugfwdir = -hotplugfw_DATA = -endif +include ../Makefile.hotplug diff --git a/ca0132/Makefile.am b/ca0132/Makefile.am index f18aef6..e4fc48c 100644 --- a/ca0132/Makefile.am +++ b/ca0132/Makefile.am @@ -1,13 +1,6 @@ +firmware_dir = firmware_files = ctefx.bin ctspeq.bin ctefx-desktop.bin ctefx-r3di.bin -if USE_HOTPLUG -hotplugfwdir = @HOTPLUGFWDIR@ -hotplugfw_DATA = $(firmware_files) -else -hotplugfwdir = -hotplugfw_DATA = -endif - EXTRA_DIST = $(firmware_files) creative.txt - +include ../Makefile.hotplug diff --git a/cs46xx/Makefile.am b/cs46xx/Makefile.am index e1c15f7..b7b68cd 100644 --- a/cs46xx/Makefile.am +++ b/cs46xx/Makefile.am @@ -1,12 +1,7 @@ +firmware_dir = cs46xx firmware_files = ba1 cwc4630 cwcasync cwcbinhack cwcdma cwcsnoop -if USE_HOTPLUG -hotplugfwdir = @HOTPLUGFWDIR@/cs46xx -hotplugfw_DATA = $(firmware_files) -else -hotplugfwdir = -hotplugfw_DATA = -endif - EXTRA_DIST = $(firmware_files) cs46xx-fw.c cs46xx_image.h \ cwc4630.h cwcasync.h cwcbinhack.h cwcdma.h cwcsnoop.h + +include ../Makefile.hotplug diff --git a/echoaudio/Makefile.am b/echoaudio/Makefile.am index fcd0bc3..be71604 100644 --- a/echoaudio/Makefile.am +++ b/echoaudio/Makefile.am @@ -68,6 +68,7 @@ EXTRA_DIST = DSP/LoaderDSP.c \ CLEANFILES = $(firmware_files) fw_writer +include ../Makefile.hotplug include ../Makefile.fw_writer $(firmware_files): fw_writer diff --git a/emu/Makefile.am b/emu/Makefile.am index 5d97e11..e03fdbf 100644 --- a/emu/Makefile.am +++ b/emu/Makefile.am @@ -16,6 +16,7 @@ EXTRA_DIST = hana_netlist.h \ CLEANFILES = $(firmware_files) fw_writer +include ../Makefile.hotplug include ../Makefile.fw_writer $(firmware_files): fw_writer diff --git a/hdsploader/Makefile.am b/hdsploader/Makefile.am index 66f1700..398f703 100644 --- a/hdsploader/Makefile.am +++ b/hdsploader/Makefile.am @@ -26,6 +26,7 @@ EXTRA_DIST = $(dsp_hex_files:%.bin=%.dat) \ tobin.c CLEANFILES = $(dsp_hex_files) +include ../Makefile.hotplug include ../Makefile.fw_writer $(firmware_files): fw_writer diff --git a/korg1212/Makefile.am b/korg1212/Makefile.am index 3c6221b..3d91b63 100644 --- a/korg1212/Makefile.am +++ b/korg1212/Makefile.am @@ -1,13 +1,8 @@ # # Process this file with automake to produce Makefile.in. -dsp_files = k1212.dsp +firmware_dir = korg +firmware_files = k1212.dsp -EXTRA_DIST = $(dsp_files) +EXTRA_DIST = $(firmware_files) -if USE_HOTPLUG -hotplugfwdir = @HOTPLUGFWDIR@/korg -hotplugfw_DATA = $(dsp_files) -else -hotplugfwdir = -hotplugfw_DATA = -endif +include ../Makefile.hotplug diff --git a/maestro3/Makefile.am b/maestro3/Makefile.am index 97da0e0..ba13740 100644 --- a/maestro3/Makefile.am +++ b/maestro3/Makefile.am @@ -10,6 +10,7 @@ EXTRA_DIST = fw_writer.c maestro3.h CLEANFILES = $(firmware_files) fw_writer +include ../Makefile.hotplug include ../Makefile.fw_writer $(firmware_files): fw_writer diff --git a/mixartloader/Makefile.am b/mixartloader/Makefile.am index 41538d4..dc12edb 100644 --- a/mixartloader/Makefile.am +++ b/mixartloader/Makefile.am @@ -1,25 +1,21 @@ MYNAME = mixartloader +firmware_dir = mixart + cfg_files = miXart.conf -dsp_files = \ +firmware_files = \ miXart8AES.xlx \ miXart8.elf \ miXart8.xlx -EXTRA_DIST = $(cfg_files) $(dsp_files) +EXTRA_DIST = $(cfg_files) $(firmware_files) if USE_LOADER firmwaredir = $(datadir)/alsa/firmware/$(MYNAME) -firmware_DATA = $(cfg_files) $(dsp_files) +firmware_DATA = $(cfg_files) $(firmware_files) else firmwaredir = firmware_DATA = endif -if USE_HOTPLUG -hotplugfwdir = @HOTPLUGFWDIR@/mixart -hotplugfw_DATA = $(dsp_files) -else -hotplugfwdir = -hotplugfw_DATA = -endif +include ../Makefile.hotplug diff --git a/multisound/Makefile.am b/multisound/Makefile.am index 782ce90..14df087 100644 --- a/multisound/Makefile.am +++ b/multisound/Makefile.am @@ -26,4 +26,3 @@ uninstall-hook: rm -f $(DESTDIR)$(hotplugfwdir)/pndsperm.bin endif - diff --git a/pcxhrloader/Makefile.am b/pcxhrloader/Makefile.am index 426f088..ff9fe3e 100644 --- a/pcxhrloader/Makefile.am +++ b/pcxhrloader/Makefile.am @@ -1,5 +1,7 @@ MYNAME = pcxhrloader +firmware_dir = pcxhr + cfg_files = \ pcxhr.conf \ pcxhr0.conf \ @@ -8,7 +10,7 @@ cfg_files = \ pcxhr3.conf \ pcxhr4.conf \ pcxhr5.conf -dsp_files = \ +firmware_files = \ xi_1_882.dat \ xc_1_882.dat \ e321_512.e56 \ @@ -32,20 +34,14 @@ dsp_files = \ dspb924.b56 \ dspd222.d56 -EXTRA_DIST = $(cfg_files) $(dsp_files) +EXTRA_DIST = $(cfg_files) $(firmware_files) if USE_LOADER firmwaredir = $(datadir)/alsa/firmware/$(MYNAME) -firmware_DATA = $(cfg_files) $(dsp_files) +firmware_DATA = $(cfg_files) $(firmware_files) else firmwaredir = firmware_DATA = endif -if USE_HOTPLUG -hotplugfwdir = @HOTPLUGFWDIR@/pcxhr -hotplugfw_DATA = $(dsp_files) -else -hotplugfwdir = -hotplugfw_DATA = -endif +include ../Makefile.hotplug diff --git a/sb16/Makefile.am b/sb16/Makefile.am index fdccb53..a69103f 100644 --- a/sb16/Makefile.am +++ b/sb16/Makefile.am @@ -11,6 +11,7 @@ EXTRA_DIST = fw_writer.c sb16_csp_codecs.h CLEANFILES = $(firmware_files) fw_writer +include ../Makefile.hotplug include ../Makefile.fw_writer $(firmware_files): fw_writer diff --git a/vxloader/Makefile.am b/vxloader/Makefile.am index e67fd53..d7867e8 100644 --- a/vxloader/Makefile.am +++ b/vxloader/Makefile.am @@ -21,6 +21,9 @@ rbt_files = \ xlx_files = $(rbt_files:%.rbt=%.xlx) +firmware_dir = vx +firmware_files = $(dsp_files) $(xlx_files) + noinst_PROGRAMS = toxlx toxlx_SOURCES = toxlx.c @@ -35,13 +38,7 @@ firmwaredir = firmware_DATA = endif -if USE_HOTPLUG -hotplugfwdir = @HOTPLUGFWDIR@/vx -hotplugfw_DATA = $(dsp_files) $(xlx_files) -else -hotplugfwdir = -hotplugfw_DATA = -endif +include ../Makefile.hotplug LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(TARGET_ARCH_FOR_BUILD) diff --git a/wavefront/Makefile.am b/wavefront/Makefile.am index 2643f5b..d60b7ef 100644 --- a/wavefront/Makefile.am +++ b/wavefront/Makefile.am @@ -10,6 +10,7 @@ EXTRA_DIST = fw_writer.c yss225.c CLEANFILES = $(firmware_files) fw_writer +include ../Makefile.hotplug include ../Makefile.fw_writer $(firmware_files): fw_writer diff --git a/ymfpci/Makefile.am b/ymfpci/Makefile.am index e8a349e..d4fb7ea 100644 --- a/ymfpci/Makefile.am +++ b/ymfpci/Makefile.am @@ -10,6 +10,7 @@ EXTRA_DIST = fw_writer.c hwmcode.c CLEANFILES = $(firmware_files) fw_writer +include ../Makefile.hotplug include ../Makefile.fw_writer $(firmware_files): fw_writer -- 2.47.1