]> git.tdb.fi Git - gldbg.git/blobdiff - Makefile
Rewrite genwrap.py to use external templates for more flexibility
[gldbg.git] / Makefile
index e6f6d11bb4600c5f939d6cfc125f1d9d8634e754..33a2f4e824f0f0a09f0d9ef9a719a40a666e2477 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,13 @@
 # $Id$
 
-CFLAGS=-Igensrc -ggdb
+CFLAGS = -Igensrc -ggdb
+CXXFLAGS = -Igensrc -ggdb
 
-all: glwrap.so gldump
+PACKAGES_gldbg = mspcore mspstrings mspio mspfs
+CXXFLAGS_gldbg = $(shell pkg-config --cflags $(PACKAGES_gldbg))
+LIBS_gldbg = $(shell pkg-config --libs $(PACKAGES_gldbg)) -lreadline
+
+all: glwrap.so gldump gldbg
 
 glwrap.so: source/glwrap.o
        $(CC) -shared -o $@ $^ $(LIBS) $(LDFLAGS)
@@ -10,13 +15,31 @@ glwrap.so: source/glwrap.o
 gldump: source/gldecoder.o source/gldump.o source/glprint.o
        $(CC) -o $@ $^ $(LIBS) $(LDFLAGS)
 
+gldbg: source/gldbg.o source/gldecoder.o source/glprint.o source/commandinterpreter.o source/tracer.o source/process.o
+       $(CXX) -o $@ $^ $(LIBS_gldbg) $(LIBS) $(LDFLAGS)
+
 source/glwrap.o: source/functions.h gensrc/functions.enum gensrc/glwrap.funcs
 source/gldecoder.o: source/functions.h gensrc/gldecoder.struct gensrc/gldecoder.funcs gensrc/gldecoder.funcs
 source/gldump.o: source/gldecoder.h gensrc/gldecoder.struct source/glprint.h
 source/glprint.o: gensrc/glprint.funcs gensrc/gldecoder.struct
 
-gensrc/functions.enum gensrc/gldecoder.funcs gensrc/gldecoder.struct gensrc/glwrap.funcs gensrc/glprint.funcs: gensrc/.created genwrap.py gl.spec gl.tm
-       python ./genwrap.py
+source/gldbg.o: source/gldbg.cpp source/gldbg.h source/gldecoder.h source/tracer.h
+       $(CXX) -c $(CXXFLAGS) $(CXXFLAGS_gldbg) -o $@ $<
+
+source/tracer.o: source/tracer.cpp source/gldecoder.h source/glprint.h
+       $(CXX) -c $(CXXFLAGS) $(CXXFLAGS_gldbg) -o $@ $<
+
+source/commandinterpreter.o: source/commandinterpreter.cpp source/gldbg.h
+       $(CXX) -c $(CXXFLAGS) $(CXXFLAGS_gldbg) -o $@ $<
+
+source/process.o: source/process.cpp source/process.h
+       $(CXX) -c $(CXXFLAGS) $(CXXFLAGS_gldbg) -o $@ $<
+
+gensrc/%: source/%.t gensrc/.created genwrap.py
+       python ./genwrap.py $< >$@
+
+#gensrc/functions.enum gensrc/gldecoder.funcs gensrc/gldecoder.struct gensrc/glwrap.funcs gensrc/glprint.funcs: gensrc/.created genwrap.py gl.spec gl.tm
+#      python ./genwrap.py
 
 gensrc/.created:
        mkdir -p gensrc