dungeon_crawler

diff prototype/Makefile @ 1:96de911d05d4

started a rough prototype
author John Tsiombikas <nuclear@mutantstargoat.com>
date Thu, 28 Jun 2012 06:05:50 +0300
parents
children 252a00508411
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/prototype/Makefile	Thu Jun 28 06:05:50 2012 +0300
     1.3 @@ -0,0 +1,30 @@
     1.4 +csrc = $(wildcard src/*.c) $(wildcard vmath/*.c)
     1.5 +ccsrc = $(wildcard src/*.cc) $(wildcard vmath/*.cc)
     1.6 +obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
     1.7 +dep = $(obj:.o=.d)
     1.8 +bin = proto
     1.9 +
    1.10 +CFLAGS = -pedantic -Wall -g -Ivmath
    1.11 +CXXFLAGS = $(CFLAGS)
    1.12 +LDFLAGS = $(libgl) -lm
    1.13 +
    1.14 +ifeq ($(shell uname -s), Darwin)
    1.15 +	libgl = -framework OpenGL -framework GLUT -lglew
    1.16 +else
    1.17 +	libgl = -lGL -lGLU -lglut -lGLEW
    1.18 +endif
    1.19 +
    1.20 +$(bin): $(obj)
    1.21 +	$(CXX) -o $@ $(obj) $(LDFLAGS)
    1.22 +
    1.23 +-include $(dep)
    1.24 +
    1.25 +%.d: %.c
    1.26 +	@$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.27 +
    1.28 +%.d: %.cc
    1.29 +	@$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.30 +
    1.31 +.PHONY: clean
    1.32 +clean:
    1.33 +	rm -f $(obj) $(bin) $(dep)