build: simplify linking tools with cmdutils.o

This avoids repeating cmdutils.o in both the prerequisites and
the link command.

Signed-off-by: Mans Rullgard <mans@mansr.com>
This commit is contained in:
Mans Rullgard 2012-10-15 03:59:16 +01:00
parent bf868c4a9b
commit 07b3790d36
1 changed files with 4 additions and 4 deletions

View File

@ -124,8 +124,8 @@ endef
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D)))) $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
define DOPROG define DOPROG
OBJS-$(1) += $(1).o OBJS-$(1) += $(1).o cmdutils.o
$(1)$(EXESUF): $(OBJS-$(1)) $(1)$(EXESUF): $$(OBJS-$(1))
$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1)) $$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
$(1)$(EXESUF): LDFLAGS += $(LDFLAGS-$(1)) $(1)$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
$(1)$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1)) $(1)$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1))
@ -134,8 +134,8 @@ endef
$(foreach P,$(PROGS-yes),$(eval $(call DOPROG,$(P)))) $(foreach P,$(PROGS-yes),$(eval $(call DOPROG,$(P))))
$(PROGS): %$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS) $(PROGS): %$(EXESUF): %.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) cmdutils.o $(FF_EXTRALIBS) $(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
OBJDIRS += tools OBJDIRS += tools