summaryrefslogtreecommitdiff
path: root/subdir.mak
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2009-04-01 00:53:22 +0000
committerMåns Rullgård <mans@mansr.com>2009-04-01 00:53:22 +0000
commit3fd422ff77d511947f7b82d025fffcfc702fe140 (patch)
tree4afda88b63ca8f60320f99c629788d8c55a520da /subdir.mak
parent13b47b4012dde0cea9ff303415891058e0615f84 (diff)
Move make rules applicable only to subdirs into subdir.mak
Originally committed as revision 18294 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'subdir.mak')
-rw-r--r--subdir.mak26
1 files changed, 26 insertions, 0 deletions
diff --git a/subdir.mak b/subdir.mak
index 997f552682..6b098cdb67 100644
--- a/subdir.mak
+++ b/subdir.mak
@@ -19,6 +19,29 @@ endif
INCINSTDIR := $(INCDIR)/lib$(NAME)
define RULES
+$(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
+ $(CC) $(FFLDFLAGS) -o $$@ $$^ $(SUBDIR)$(LIBNAME) $(FFEXTRALIBS)
+
+$(SUBDIR)%-test.o: $(SUBDIR)%.c
+ $(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
+
+$(SUBDIR)%-test.o: $(SUBDIR)%-test.c
+ $(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
+
+$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
+ $(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
+
+$(SUBDIR)x86/%.d: $(SUBDIR)x86/%.asm
+ $(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$(@:%.d=%.o) $$< > $$@
+
+clean::
+ rm -f $(EXAMPLES) $(addprefix $(SUBDIR),*-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
+ $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
+
+distclean:: clean
+ rm -f $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \
+ $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
+
ifdef BUILD_SHARED
all: $(SUBDIR)$(SLIBNAME)
@@ -72,3 +95,6 @@ uninstall-headers::
endef
$(eval $(RULES))
+
+examples: $(EXAMPLES)
+testprogs: $(TESTPROGS)