From b825e4955243b8ecb57e58afafd8b2286fdd4369 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sat, 29 Jan 2011 19:06:27 +0800 Subject: mapi: Workaround a bug in makedepend. makedepend would crash when a source includes a header indirectly, such as #define HEADER "some-header.h" #include HEADER Do not define HEADER (makedepend would detects this as an incomplete include) and add the dependency manually in the Makefile. This should hopefully fix bug #33374. --- src/mapi/glapi/Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/mapi/glapi') diff --git a/src/mapi/glapi/Makefile b/src/mapi/glapi/Makefile index 203a8abd018..bb4ed6585d9 100644 --- a/src/mapi/glapi/Makefile +++ b/src/mapi/glapi/Makefile @@ -13,11 +13,12 @@ include $(MAPI)/sources.mak glapi_CPPFLAGS := \ -I$(TOP)/include \ -I$(TOP)/src/mapi \ - -I$(TOP)/src/mesa \ - -DMAPI_ABI_HEADER=\"glapi/glapi_mapi_tmp.h\" + -I$(TOP)/src/mesa ifeq ($(SHARED_GLAPI),1) -glapi_CPPFLAGS += -DMAPI_MODE_BRIDGE +glapi_CPPFLAGS += \ + -DMAPI_MODE_BRIDGE \ + -DMAPI_ABI_HEADER=\"glapi/glapi_mapi_tmp.h\" glapi_SOURCES := $(addprefix $(MAPI)/, $(MAPI_BRIDGE_SOURCES)) glapi_GLAPI_OBJECTS := @@ -58,10 +59,19 @@ clean: -rm -f lib$(TARGET).a -rm -f depend depend.bak +ifeq ($(SHARED_GLAPI),1) +# workaround a bug in makedepend +makedepend_CPPFLAGS := \ + $(filter-out -DMAPI_ABI_HEADER=%, $(glapi_CPPFLAGS)) +$(glapi_OBJECTS): glapi_mapi_tmp.h +else +makedepend_CPPFLAGS := $(glapi_CPPFLAGS) +endif + depend: $(glapi_SOURCES) @ echo "running $(MKDEP)" @ touch depend - @$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(glapi_CPPFLAGS) \ + @$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(makedepend_CPPFLAGS) \ $(glapi_SOURCES) 2>/dev/null | sed -e 's,^$(MAPI)/,,' > depend -include depend -- cgit v1.2.3