aboutsummaryrefslogtreecommitdiffstats
path: root/common.mak
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2009-10-29 00:55:35 +0000
committerMåns Rullgård <mans@mansr.com>2009-10-29 00:55:35 +0000
commitde4070b5204a97c555bcc32746fb7c60da971a6c (patch)
treee7693419df86057aa6b905668b19d63c0d869328 /common.mak
parent7a41027cc4c2249fcabd657f848dc8862033a2dd (diff)
downloadffmpeg-de4070b5204a97c555bcc32746fb7c60da971a6c.tar.gz
Add generic rules for building helpers with HOSTCC
Originally committed as revision 20412 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'common.mak')
-rw-r--r--common.mak8
1 files changed, 8 insertions, 0 deletions
diff --git a/common.mak b/common.mak
index 343ca749b5..396772bf64 100644
--- a/common.mak
+++ b/common.mak
@@ -61,6 +61,8 @@ FFLDFLAGS := $(addprefix -L$(BUILD_ROOT)/lib,$(ALLFFLIBS)) $(LDFLAGS)
EXAMPLES := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES)))
OBJS := $(addprefix $(SUBDIR),$(OBJS))
TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS)))
+HOSTOBJS := $(addprefix $(SUBDIR),$(addsuffix .o,$(HOSTPROGS)))
+HOSTPROGS := $(addprefix $(SUBDIR),$(addsuffix $(HOSTEXESUF),$(HOSTPROGS)))
DEP_LIBS := $(foreach NAME,$(FFLIBS),$(BUILD_ROOT_REL)/lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
@@ -68,6 +70,12 @@ ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)
SKIPHEADERS = $(addprefix $(SUBDIR),$(SKIPHEADERS-))
checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
+$(HOSTOBJS): %.o: %.c
+ $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
+
+$(HOSTPROGS): %$(HOSTEXESUF): %.o
+ $(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
+
DEPS := $(OBJS:.o=.d)
depend dep: $(DEPS)