-src = $(wildcard src/*.c)
+src = $(wildcard src/*.c) $(wildcard libs/miniglut/*.c)
obj = $(src:.c=.o)
dep = $(src:.c=.d)
bin = cyberay
opt = -O3 -ffast-math -fno-strict-aliasing
dbg = -g
warn = -pedantic -Wall
-inc = -Ilibs
+def = -DMINIGLUT_USE_LIBC
+inc = -Ilibs -Ilibs/treestore -Ilibs/miniglut
+libdir = -Llibs/treestore
-CFLAGS = $(warn) $(opt) $(dbg) -pthread -MMD $(inc)
-LDFLAGS = $(libgl) -lm -pthread -limago
+CFLAGS = $(warn) $(opt) $(dbg) $(def) $(inc) -pthread -MMD
+LDFLAGS = $(libgl) $(libs) -lm -pthread -limago -ltreestore
-libgl = -lGL -lGLU -lglut
+libgl = -lGL -lGLU -lX11 -lXext
-$(bin): $(obj)
+$(bin): $(obj) libs
$(CC) -o $@ $(obj) $(LDFLAGS)
-include $(dep)
.PHONY: cleandep
cleandep:
rm -f $(dep)
+
+.PHONY: libs
+libs:
+ $(MAKE) -C libs
+
+.PHONY: clean-libs
+clean-libs:
+ $(MAKE) -C libs clean