On Sat, 2008-05-24 at 11:57 +0100, David Woodhouse wrote: > This attempts it, on top of the current git tree. Doesn't work with O= > build though, because it doesn't create the firmware/korg/ directory: This works, but why in hell do I need the FORCE on the rule for $(firmware_dirs)? Without it, the directory (in the object dir, obviously) never gets created. Sam, any ideas? commit e5d131e78c4da8e3579aba0d7f533018bd801fdf Author: David Woodhouse <dwmw2@xxxxxxxxxxxxx> Date: Sat May 24 11:56:32 2008 +0100 test Signed-off-by: David Woodhouse <dwmw2@xxxxxxxxxxxxx> diff --git a/firmware/Makefile b/firmware/Makefile index f6b0c3c..8ce2b81 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -2,10 +2,15 @@ # kbuild file for firmware/ # +firmware-$(CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL) += korg/k1212 + firmware_bins := $(subst ",,$(CONFIG_BUILTIN_FIRMWARE)) -firmware_objs := $(patsubst %,%.o, $(firmware_bins)) -firmware_srcs := $(patsubst %,$(obj)/%.c, $(firmware_bins)) +firmware_srcs_generated := $(patsubst %,$(obj)/%.c, $(firmware_bins)) +firmware_objs := $(patsubst %,%.o, $(firmware_bins) $(firmware-y)) +firmware_dirs := $(patsubst %,$(obj)/%,$(dir $(firmware_objs))) +quiet_cmd_mkdir = MKDIR $@ + cmd_mkdir = mkdir -p $@ quiet_cmd_fwbin = MK_FW $@ cmd_fwbin = echo '/* File automatically generated */' > $@ ; \ @@ -16,9 +21,15 @@ quiet_cmd_fwbin = MK_FW $@ echo '};' >> $@ ; \ echo 'DECLARE_BUILTIN_FIRMWARE("$(patsubst firmware/%.c,%,$@)",fw);' >> $@ -$(firmware_srcs): $(obj)/%.c: $(srctree)/$(obj)/% +$(firmware_srcs_generated): $(obj)/%.c: $(srctree)/$(obj)/% + echo dirs :$(firmware_dirs) $(call cmd,fwbin) +$(firmware_dirs): FORCE + $(call cmd,mkdir) + +$(patsubst %,$(obj)/%,$(firmware_objs)): $(firmware_dirs) + obj-y := $(firmware_objs) -targets := $(firmware_objs) +targets := $(firmware_objs) $(firmware_srcs_generated) diff --git a/sound/pci/korg1212/korg1212-firmware.c b/firmware/korg/k1212.c similarity index 100% rename from sound/pci/korg1212/korg1212-firmware.c rename to firmware/korg/k1212.c diff --git a/sound/pci/korg1212/Makefile b/sound/pci/korg1212/Makefile index 7a5ebdf..f11ce1b 100644 --- a/sound/pci/korg1212/Makefile +++ b/sound/pci/korg1212/Makefile @@ -7,4 +7,3 @@ snd-korg1212-objs := korg1212.o # Toplevel Module Dependency obj-$(CONFIG_SND_KORG1212) += snd-korg1212.o -obj-$(CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL) += korg1212-firmware.o -- dwmw2 -- fedora-devel-list mailing list fedora-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/fedora-devel-list