aboutsummaryrefslogtreecommitdiffstats
path: root/common.mak
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-08-07 02:11:25 +0100
committerMans Rullgard <mans@mansr.com>2012-08-07 21:36:51 +0100
commitdfd9159f3db987e9115715cded7a4408179e3ed9 (patch)
tree82f135a2370113d8b91e74a0a372704ce3d0516e /common.mak
parent00cb52c65cb2913f20dd3d0e6601d1b0db0b657b (diff)
downloadffmpeg-dfd9159f3db987e9115715cded7a4408179e3ed9.tar.gz
build: change checkheaders to use regular build rules
Many compilers need special flags to compile *.h files as regular source code, if they will do so at all. Rather than hoping all compilers will have such a flag and adding mappings for it, create wrapper .c files for test building single headers. This allows using the regular rule for compiling C files without the need for special flags, and it also provides proper dependency tracking for these objects. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'common.mak')
-rw-r--r--common.mak8
1 files changed, 5 insertions, 3 deletions
diff --git a/common.mak b/common.mak
index aed11f7891..f94a43d35a 100644
--- a/common.mak
+++ b/common.mak
@@ -28,7 +28,9 @@ DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME)
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
-checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
+HOBJS = $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o))
+checkheaders: $(HOBJS)
+.SECONDARY: $(HOBJS:.o=.c)
alltools: $(TOOLS)
@@ -45,8 +47,8 @@ $(TOOLOBJS): | tools
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOSTOBJS) $(TESTOBJS))
-CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver
+CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver
DISTCLEANSUFFIXES = *.pc
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
--include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d))
+-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d))