[FFmpeg-cvslog] build: add rules to generate preprocessed source files
Mans Rullgard
git at videolan.org
Fri Nov 23 13:49:43 CET 2012
ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Wed Oct 3 13:48:27 2012 +0100| [c262649291e711c084c5d8fc3fd0eee175f155ff] | committer: Mans Rullgard
build: add rules to generate preprocessed source files
This is useful for debugging. Dependencies for these files are not
generated due to limitations in many compilers.
Signed-off-by: Mans Rullgard <mans at mansr.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c262649291e711c084c5d8fc3fd0eee175f155ff
---
Makefile | 3 +++
configure | 1 +
library.mak | 11 +++++++++--
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 5e1dae6..91acc4c 100644
--- a/Makefile
+++ b/Makefile
@@ -45,6 +45,9 @@ COMPILE_S = $(call COMPILE,AS)
%.o: %.S
$(COMPILE_S)
+%.i: %.c
+ $(CC) $(CCFLAGS) $(CC_E) $<
+
%.h.c:
$(Q)echo '#include "$*.h"' >$@
diff --git a/configure b/configure
index 890ff93..0883035 100755
--- a/configure
+++ b/configure
@@ -3756,6 +3756,7 @@ ASFLAGS=$ASFLAGS
AS_C=$AS_C
AS_O=$AS_O
CC_C=$CC_C
+CC_E=$CC_E
CC_O=$CC_O
LD_O=$LD_O
LD_LIB=$LD_LIB
diff --git a/library.mak b/library.mak
index 33ec37f..9309c42 100644
--- a/library.mak
+++ b/library.mak
@@ -17,12 +17,19 @@ $(SUBDIR)%-test.o: $(SUBDIR)%-test.c
$(SUBDIR)%-test.o: $(SUBDIR)%.c
$(COMPILE_C)
+$(SUBDIR)%-test.i: $(SUBDIR)%-test.c
+ $(CC) $(CCFLAGS) $(CC_E) $<
+
+$(SUBDIR)%-test.i: $(SUBDIR)%.c
+ $(CC) $(CCFLAGS) $(CC_E) $<
+
$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
$(DEPYASM) $(YASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
$(YASM) $(YASMFLAGS) -I $(<D)/ -o $@ $<
-$(OBJS) $(SUBDIR)%.h.o $(TESTOBJS): CPPFLAGS += -DHAVE_AV_CONFIG_H
-$(TESTOBJS): CPPFLAGS += -DTEST
+LIBOBJS := $(OBJS) $(SUBDIR)%.h.o $(TESTOBJS)
+$(LIBOBJS) $(LIBOBJS:.o=.i): CPPFLAGS += -DHAVE_AV_CONFIG_H
+$(TESTOBJS) $(TESTOBJS:.o=.i): CPPFLAGS += -DTEST
$(SUBDIR)$(LIBNAME): $(OBJS)
$(RM) $@
More information about the ffmpeg-cvslog
mailing list