Mesa (glsl2): Build a standalone glcpp binary.

Ian Romanick idr at kemper.freedesktop.org
Wed Jul 21 00:07:46 UTC 2010


Module: Mesa
Branch: glsl2
Commit: 41d525f2dfde130b4a1cfa908a729e5a3f79b200
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=41d525f2dfde130b4a1cfa908a729e5a3f79b200

Author: Carl Worth <cworth at cworth.org>
Date:   Wed Jul 14 14:48:15 2010 -0700

Build a standalone glcpp binary.

This is convenient for testing the preprocessor independent of the rest of
mesa, (just run glcpp-test in the src/glsl/glcpp/tests).

---

 src/glsl/Makefile |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/glsl/Makefile b/src/glsl/Makefile
index 497f6ca..7bf95fb 100644
--- a/src/glsl/Makefile
+++ b/src/glsl/Makefile
@@ -6,13 +6,19 @@ include $(TOP)/configs/current
 
 LIBNAME = glsl
 
-C_SOURCES = \
-	glcpp/glcpp.c \
+LIBGLCPP_SOURCES = \
 	glcpp/glcpp-lex.c \
 	glcpp/glcpp-parse.c \
 	glcpp/pp.c \
 	glcpp/xtalloc.c
 
+GLCPP_SOURCES = \
+	$(LIBGLCPP_SOURCES) \
+	glcpp/glcpp.c
+
+C_SOURCES = \
+	$(LIBGLCPP_SOURCES)
+
 CXX_SOURCES = \
 	ast_expr.cpp \
 	ast_function.cpp \
@@ -60,7 +66,8 @@ LIBS = \
 	$(TOP)/src/glsl/libglsl.a \
 	$(shell pkg-config --libs talloc)
 
-APPS = glsl_compiler
+APPS = glsl_compiler glcpp/glcpp
+
 GLSL2_C_SOURCES = \
 	../mesa/shader/hash_table.c \
 	../mesa/shader/symbol_table.c
@@ -73,6 +80,10 @@ GLSL2_OBJECTS = \
 
 ### Basic defines ###
 
+GLCPP_OBJECTS = \
+	$(GLCPP_SOURCES:.c=.o) \
+	../mesa/shader/hash_table.o
+
 OBJECTS = \
 	$(C_SOURCES:.c=.o) \
 	$(CXX_SOURCES:.cpp=.o)
@@ -117,6 +128,9 @@ install:
 glsl_compiler: $(GLSL2_OBJECTS) libglsl.a
 	$(APP_CXX) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLSL2_OBJECTS) $(LIBS) -o $@
 
+glcpp/glcpp: $(GLCPP_OBJECTS) libglsl.a
+	$(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLCPP_OBJECTS) $(LIBS) -o $@
+
 .cpp.o:
 	$(CXX) -c $(INCLUDES) $(CXXFLAGS) $(LIBRARY_DEFINES) $< -o $@
 




More information about the mesa-commit mailing list