summaryrefslogtreecommitdiffstats
path: root/src/mesa/Makefile
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-09-11 22:07:59 +0800
committerChia-I Wu <[email protected]>2010-09-12 02:31:33 +0800
commit19b2cfd6f683e158d21ba10af3bc6ce5da5d669c (patch)
treeb7dddbf0c2f57dee4b0f7b9526c6e862fa249135 /src/mesa/Makefile
parent33b1d14913f8a9f91bf2f2962282502590ed51c1 (diff)
mesa: Fix depend.es[12] generation when LLVM is enabled.
"llvm-config --cflags" outputs -f options, which conflict makedepend. Clean up compiler flags and append LLVM_CFLAGS to the new xxx_CFLAGS instead of xxx_CPPFLAGS, where xxx may be MESA, ES1, or ES2.
Diffstat (limited to 'src/mesa/Makefile')
-rw-r--r--src/mesa/Makefile55
1 files changed, 26 insertions, 29 deletions
diff --git a/src/mesa/Makefile b/src/mesa/Makefile
index ef31fd24f08..c41c38cba66 100644
--- a/src/mesa/Makefile
+++ b/src/mesa/Makefile
@@ -16,16 +16,6 @@ MESA_OBJ_DIR := .
ES1_OBJ_DIR := objs-es1
ES2_OBJ_DIR := objs-es2
-MESA_CPPFLAGS := $(API_DEFINES)
-ES1_CPPFLAGS := -DFEATURE_ES1=1
-ES2_CPPFLAGS := -DFEATURE_ES2=1
-
-ifeq ($(MESA_LLVM),1)
-MESA_CPPFLAGS += $(LLVM_CFLAGS)
-ES1_CPPFLAGS += $(LLVM_CFLAGS)
-ES2_CPPFLAGS += $(LLVM_CFLAGS)
-endif
-
include sources.mak
@@ -38,24 +28,33 @@ ES1_GALLIUM_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS))
ES2_GALLIUM_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS))
MESA_GALLIUM_OBJECTS := $(addprefix $(MESA_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS))
-# adjust include dirs
-MESA_INCLUDES := $(INCLUDE_DIRS)
-ES1_INCLUDES := -I$(TOP)/src/mapi/es1api $(INCLUDE_DIRS)
-ES2_INCLUDES := -I$(TOP)/src/mapi/es2api $(INCLUDE_DIRS)
-MESA_INCLUDES := -I$(TOP)/src/glsl $(MESA_INCLUDES)
-ES1_INCLUDES := -I$(TOP)/src/glsl $(ES1_INCLUDES)
-ES2_INCLUDES := -I$(TOP)/src/glsl $(ES2_INCLUDES)
-# For symbol_table.h in glsl compiler headers.
-MESA_INCLUDES := -I$(TOP)/src/mesa/shader $(MESA_INCLUDES)
+# define preprocessor flags
+MESA_CPPFLAGS := $(API_DEFINES) $(DEFINES)
+ES1_CPPFLAGS := -DFEATURE_ES1=1 $(DEFINES)
+ES2_CPPFLAGS := -DFEATURE_ES2=1 $(DEFINES)
+
+# append include dirs
+MESA_CPPFLAGS += $(INCLUDE_DIRS)
+ES1_CPPFLAGS += -I$(TOP)/src/mapi/es1api $(INCLUDE_DIRS)
+ES2_CPPFLAGS += -I$(TOP)/src/mapi/es2api $(INCLUDE_DIRS)
+
+# tidy compiler flags
+CFLAGS := $(filter-out $(DEFINES), $(CFLAGS))
+CXXFLAGS := $(filter-out $(DEFINES), $(CXXFLAGS))
+
+# LLVM is needed for the state tracker
+MESA_CFLAGS := $(LLVM_CFLAGS)
+ES1_CFLAGS := $(LLVM_CFLAGS)
+ES2_CFLAGS := $(LLVM_CFLAGS)
define mesa-cc-c
@mkdir -p $(dir $@)
- $(CC) -c -o $@ $< $($(1)_CPPFLAGS) $($(1)_INCLUDES) $(CFLAGS)
+ $(CC) -c -o $@ $< $($(1)_CPPFLAGS) $($(1)_CFLAGS) $(CFLAGS)
endef
define mesa-cxx-c
@mkdir -p $(dir $@)
- $(CXX) -c -o $@ $< $($(1)_CPPFLAGS) $($(1)_INCLUDES) $(CXXFLAGS)
+ $(CXX) -c -o $@ $< $($(1)_CPPFLAGS) $($(1)_CFLAGS) $(CXXFLAGS)
endef
$(MESA_OBJ_DIR)/%.o: %.c
@@ -144,22 +143,20 @@ asm_subdirs:
depend: $(ALL_SOURCES)
@ echo "running $(MKDEP)"
@ touch depend
- @$(MKDEP) $(MKDEP_OPTIONS) -p$(MESA_OBJ_DIR)/ $(DEFINES) \
- $(INCLUDE_DIRS) $(ALL_SOURCES) > /dev/null 2>/dev/null
+ @$(MKDEP) $(MKDEP_OPTIONS) -p$(MESA_OBJ_DIR)/ $(MESA_CPPFLAGS) \
+ $(ALL_SOURCES) > /dev/null 2>/dev/null
depend.es1: $(ALL_SOURCES)
@echo "running $(MKDEP) for ES1"
@touch $@
- @$(MKDEP) $(MKDEP_OPTIONS) -f$@ -p$(ES1_OBJ_DIR)/ $(DEFINES) \
- $(ES1_CPPFLAGS) $(ES1_INCLUDES) $(ALL_SOURCES) \
- > /dev/null 2>/dev/null
+ @$(MKDEP) $(MKDEP_OPTIONS) -f$@ -p$(ES1_OBJ_DIR)/ $(ES1_CPPFLAGS) \
+ $(ALL_SOURCES) > /dev/null 2>/dev/null
depend.es2: $(ALL_SOURCES)
@echo "running $(MKDEP) for ES2"
@touch $@
- @$(MKDEP) $(MKDEP_OPTIONS) -f$@ -p$(ES2_OBJ_DIR)/ $(DEFINES) \
- $(ES2_CPPFLAGS) $(ES2_INCLUDES) $(ALL_SOURCES) \
- > /dev/null 2>/dev/null
+ @$(MKDEP) $(MKDEP_OPTIONS) -f$@ -p$(ES2_OBJ_DIR)/ $(ES2_CPPFLAGS) \
+ $(ALL_SOURCES) > /dev/null 2>/dev/null
######################################################################
# Installation rules