From 546aa5b30694889b00b424a6e9de2c5f34ce5da2 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 19 Oct 2020 14:29:26 +0200 Subject: [PATCH] introduce Makefile.fw_writer Signed-off-by: Jaroslav Kysela --- Makefile.am | 2 +- Makefile.fw_writer | 20 ++++++++++++++++++++ echoaudio/Makefile.am | 18 ++---------------- emu/Makefile.am | 20 +++----------------- hdsploader/Makefile.am | 30 +++++++++--------------------- maestro3/Makefile.am | 18 ++---------------- sb16/Makefile.am | 18 ++---------------- wavefront/Makefile.am | 18 ++---------------- ymfpci/Makefile.am | 18 ++---------------- 9 files changed, 43 insertions(+), 119 deletions(-) create mode 100644 Makefile.fw_writer diff --git a/Makefile.am b/Makefile.am index 9f616f1..38e6d91 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 +EXTRA_DIST = depcomp Makefile.fw_writer dist-hook: -chmod -R a+r $(distdir) diff --git a/Makefile.fw_writer b/Makefile.fw_writer new file mode 100644 index 0000000..8eaddfa --- /dev/null +++ b/Makefile.fw_writer @@ -0,0 +1,20 @@ +# +# 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) +$(fw_writer_OBJECTS) : CFLAGS=$(CFLAGS_FOR_BUILD) +$(fw_writer_OBJECTS) : CPPFLAGS=$(CPPFLAGS_FOR_BUILD) + +fw_writer: $(fw_writer_OBJECTS) + $(LINK_FOR_BUILD) $^ $(LDLIBS_FOR_BUILD) -o $@ diff --git a/echoaudio/Makefile.am b/echoaudio/Makefile.am index 5208200..fcd0bc3 100644 --- a/echoaudio/Makefile.am +++ b/echoaudio/Makefile.am @@ -1,4 +1,5 @@ # # Process this file with automake to produce Makefile.in. +firmware_dir = ea firmware_files = \ loader_dsp.fw \ darla20_dsp.fw \ @@ -67,22 +68,7 @@ EXTRA_DIST = DSP/LoaderDSP.c \ CLEANFILES = $(firmware_files) fw_writer -if USE_HOTPLUG -hotplugfwdir = @HOTPLUGFWDIR@/ea -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) -$(fw_writer_OBJECTS) : CFLAGS=$(CFLAGS_FOR_BUILD) -$(fw_writer_OBJECTS) : CPPFLAGS=$(CPPFLAGS_FOR_BUILD) - -fw_writer: $(fw_writer_OBJECTS) - $(LINK_FOR_BUILD) $^ $(LDLIBS_FOR_BUILD) -o $@ +include ../Makefile.fw_writer $(firmware_files): fw_writer ./fw_writer DSP/LoaderDSP.c loader_dsp.fw diff --git a/emu/Makefile.am b/emu/Makefile.am index a32ce78..5d97e11 100644 --- a/emu/Makefile.am +++ b/emu/Makefile.am @@ -1,5 +1,6 @@ # # Process this file with automake to produce Makefile.in. -firmware_files = hana.fw audio_dock.fw emu0404.fw micro_dock.fw emu1010_notebook.fw emu1010b.fw +firmware_dir = emu +firmware_files = hana.fw audio_dock.fw emu0404.fw micro_dock.fw emu1010_notebook.fw emu1010b.fw noinst_PROGRAMS = fw_writer fw_writer_SOURCES = fw_writer.c @@ -15,22 +16,7 @@ EXTRA_DIST = hana_netlist.h \ CLEANFILES = $(firmware_files) fw_writer -if USE_HOTPLUG -hotplugfwdir = @HOTPLUGFWDIR@/emu -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) -$(fw_writer_OBJECTS) : CFLAGS=$(CFLAGS_FOR_BUILD) -$(fw_writer_OBJECTS) : CPPFLAGS=$(CPPFLAGS_FOR_BUILD) - -fw_writer: $(fw_writer_OBJECTS) - $(LINK_FOR_BUILD) $^ $(LDLIBS_FOR_BUILD) -o $@ +include ../Makefile.fw_writer $(firmware_files): fw_writer ./fw_writer diff --git a/hdsploader/Makefile.am b/hdsploader/Makefile.am index d9d69a0..66f1700 100644 --- a/hdsploader/Makefile.am +++ b/hdsploader/Makefile.am @@ -6,39 +6,27 @@ dsp_hex_files = digiface_firmware.bin \ multiface_firmware.bin \ multiface_firmware_rev11.bin dsp_bin_files = rpm_firmware.bin -dsp_files = $(dsp_hex_files) $(dsp_bin_files) + +firmware_dir = +firmware_files = $(dsp_hex_files) $(dsp_bin_files) if USE_LOADER firmwaredir = $(datadir)/alsa/firmware/$(MYNAME) -firmware_DATA = $(dsp_files) +firmware_DATA = $(firmware_files) else firmwaredir = firmware_DATA = endif -if USE_HOTPLUG -hotplugfwdir = @HOTPLUGFWDIR@ -hotplugfw_DATA = $(dsp_files) -else -hotplugfwdir = -hotplugfw_DATA = -endif - -noinst_PROGRAMS = tobin -tobin_SOURCES = tobin.c +noinst_PROGRAMS = fw_writer +fw_writer_SOURCES = tobin.c EXTRA_DIST = $(dsp_hex_files:%.bin=%.dat) \ $(dsp_bin_files) \ tobin.c CLEANFILES = $(dsp_hex_files) -LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(TARGET_ARCH_FOR_BUILD) -$(tobin_OBJECTS) : CC=$(CC_FOR_BUILD) -$(tobin_OBJECTS) : CFLAGS=$(CFLAGS_FOR_BUILD) -$(tobin_OBJECTS) : CPPFLAGS=$(CPPFLAGS_FOR_BUILD) - -tobin: $(tobin_OBJECTS) - $(LINK_FOR_BUILD) $^ $(LDLIBS_FOR_BUILD) -o $@ +include ../Makefile.fw_writer -$(dsp_hex_files): tobin - ./tobin +$(firmware_files): fw_writer + ./fw_writer diff --git a/maestro3/Makefile.am b/maestro3/Makefile.am index 346ef1b..97da0e0 100644 --- a/maestro3/Makefile.am +++ b/maestro3/Makefile.am @@ -1,5 +1,6 @@ # # Process this file with automake to produce Makefile.in. +firmware_dir = ess firmware_files = maestro3_assp_kernel.fw maestro3_assp_minisrc.fw noinst_PROGRAMS = fw_writer @@ -9,22 +10,7 @@ EXTRA_DIST = fw_writer.c maestro3.h CLEANFILES = $(firmware_files) fw_writer -if USE_HOTPLUG -hotplugfwdir = @HOTPLUGFWDIR@/ess -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) -$(fw_writer_OBJECTS) : CFLAGS=$(CFLAGS_FOR_BUILD) -$(fw_writer_OBJECTS) : CPPFLAGS=$(CPPFLAGS_FOR_BUILD) - -fw_writer: $(fw_writer_OBJECTS) - $(LINK_FOR_BUILD) $^ $(LDLIBS_FOR_BUILD) -o $@ +include ../Makefile.fw_writer $(firmware_files): fw_writer ./fw_writer diff --git a/sb16/Makefile.am b/sb16/Makefile.am index 8fe5ba4..fdccb53 100644 --- a/sb16/Makefile.am +++ b/sb16/Makefile.am @@ -1,5 +1,6 @@ # # Process this file with automake to produce Makefile.in. +firmware_dir = sb16 firmware_files = mulaw_main.csp alaw_main.csp \ ima_adpcm_init.csp ima_adpcm_playback.csp ima_adpcm_capture.csp @@ -10,22 +11,7 @@ EXTRA_DIST = fw_writer.c sb16_csp_codecs.h CLEANFILES = $(firmware_files) fw_writer -if USE_HOTPLUG -hotplugfwdir = @HOTPLUGFWDIR@/sb16 -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) -$(fw_writer_OBJECTS) : CFLAGS=$(CFLAGS_FOR_BUILD) -$(fw_writer_OBJECTS) : CPPFLAGS=$(CPPFLAGS_FOR_BUILD) - -fw_writer: $(fw_writer_OBJECTS) - $(LINK_FOR_BUILD) $^ $(LDLIBS_FOR_BUILD) -o $@ +include ../Makefile.fw_writer $(firmware_files): fw_writer ./fw_writer diff --git a/wavefront/Makefile.am b/wavefront/Makefile.am index cac9889..2643f5b 100644 --- a/wavefront/Makefile.am +++ b/wavefront/Makefile.am @@ -1,5 +1,6 @@ # # Process this file with automake to produce Makefile.in. +firmware_dir = yamaha firmware_files = yss225_registers.bin noinst_PROGRAMS = fw_writer @@ -9,22 +10,7 @@ EXTRA_DIST = fw_writer.c yss225.c CLEANFILES = $(firmware_files) fw_writer -if USE_HOTPLUG -hotplugfwdir = @HOTPLUGFWDIR@/yamaha -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) -$(fw_writer_OBJECTS) : CFLAGS=$(CFLAGS_FOR_BUILD) -$(fw_writer_OBJECTS) : CPPFLAGS=$(CPPFLAGS_FOR_BUILD) - -fw_writer: $(fw_writer_OBJECTS) - $(LINK_FOR_BUILD) $^ $(LDLIBS_FOR_BUILD) -o $@ +include ../Makefile.fw_writer $(firmware_files): fw_writer ./fw_writer diff --git a/ymfpci/Makefile.am b/ymfpci/Makefile.am index b6f505e..e8a349e 100644 --- a/ymfpci/Makefile.am +++ b/ymfpci/Makefile.am @@ -1,5 +1,6 @@ # # Process this file with automake to produce Makefile.in. +firmware_dir = yamaha firmware_files = ds1_dsp.fw ds1_ctrl.fw ds1e_ctrl.fw noinst_PROGRAMS = fw_writer @@ -9,22 +10,7 @@ EXTRA_DIST = fw_writer.c hwmcode.c CLEANFILES = $(firmware_files) fw_writer -if USE_HOTPLUG -hotplugfwdir = @HOTPLUGFWDIR@/yamaha -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) -$(fw_writer_OBJECTS) : CFLAGS=$(CFLAGS_FOR_BUILD) -$(fw_writer_OBJECTS) : CPPFLAGS=$(CPPFLAGS_FOR_BUILD) - -fw_writer: $(fw_writer_OBJECTS) - $(LINK_FOR_BUILD) $^ $(LDLIBS_FOR_BUILD) -o $@ +include ../Makefile.fw_writer $(firmware_files): fw_writer ./fw_writer -- 2.47.1