using obj-y for targetprogs only works until only a single program is compiled. Adding the second one will end up in the linker trying to link both together. Add targetprogs-y to fix this. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- scripts/Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index 99a06b0..adc786e 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -32,9 +32,12 @@ subdir- += basic kconfig setupmbr quiet_cmd_csingle = CC $@ cmd_csingle = $(CC) -Wp,-MD,$(depfile) $(CFLAGS) -o $@ $< -obj-$(CONFIG_BAREBOXENV_TARGET) += bareboxenv-target +__targetprogs := $(sort $(targetprogs-y) $(targetprogs-m)) +target-csingle := $(foreach m,$(__targetprogs),$(if $($(m)-objs),,$(m))) +__targetprogs := $(addprefix $(obj)/,$(__targetprogs)) +target-csingle := $(addprefix $(obj)/,$(target-csingle)) -scripts/bareboxenv-target: scripts/bareboxenv.c FORCE - $(call if_changed_dep,csingle) +always := $(hostprogs-y) $(hostprogs-m) $(targetprogs-y) -always := $(hostprogs-y) $(hostprogs-m) +$(target-csingle): %-target: %.c FORCE + $(call if_changed_dep,csingle) -- 1.8.4.rc3 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox