From 28e1c97916b026c8785f54ec591718379b251bbb Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sun, 10 Jul 2011 20:26:25 +0100 Subject: build: rework rules for things in the tools dir Declaring tools associated with each library in their respective makefiles allows these tools to easily depend on the correct prerequisites and link against the libs they need. Signed-off-by: Mans Rullgard --- common.mak | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'common.mak') diff --git a/common.mak b/common.mak index bd210462b9..da51495a16 100644 --- a/common.mak +++ b/common.mak @@ -20,6 +20,9 @@ TESTOBJS := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o) TESTPROGS := $(TESTPROGS:%=$(SUBDIR)%-test$(EXESUF)) HOSTOBJS := $(HOSTPROGS:%=$(SUBDIR)%.o) HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF)) +TOOLS += $(TOOLS-yes) +TOOLOBJS := $(TOOLS:%=tools/%.o) +TOOLS := $(TOOLS:%=tools/%$(EXESUF)) DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME)) @@ -28,6 +31,8 @@ SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-) SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%) checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho)) +alltools: $(TOOLS) + $(HOSTOBJS): %.o: %.c $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $< @@ -37,6 +42,7 @@ $(HOSTPROGS): %$(HOSTEXESUF): %.o $(OBJS): | $(dir $(OBJS)) $(HOSTOBJS): | $(dir $(HOSTOBJS)) $(TESTOBJS): | $(dir $(TESTOBJS)) +$(TOOLOBJS): | tools OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOSTOBJS) $(TESTOBJS)) -- cgit v1.2.3