stratgame

diff Makefile @ 0:86b53f76899f

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 21 May 2012 19:07:40 +0300
parents
children 55a43e27339a
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Mon May 21 19:07:40 2012 +0300
     1.3 @@ -0,0 +1,36 @@
     1.4 +csrc = $(wildcard src/*.c)
     1.5 +ccsrc = $(wildcard src/*.cc)
     1.6 +obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
     1.7 +dep = $(obj:.o=.d)
     1.8 +bin = strat
     1.9 +
    1.10 +incdir = -Isrc -Ilevel/src
    1.11 +
    1.12 +liblevel = level/liblevel.a
    1.13 +slibs = $(liblevel)
    1.14 +
    1.15 +CFLAGS = -pedantic -Wall -g $(incdir)
    1.16 +CXXFLAGS = -std=c++0x $(CFLAGS)
    1.17 +LDFLAGS = $(libdir) $(slibs) $(libgl) -limtk
    1.18 +
    1.19 +ifeq ($(shell uname -s), Darwin)
    1.20 +	libgl = -framework OpenGL -framework GLUT -lGLEW
    1.21 +else
    1.22 +	libgl = -lGL -lGLU -lglut -lGLEW
    1.23 +endif
    1.24 +
    1.25 +$(bin): $(obj) $(slibs)
    1.26 +	$(CC) -o $@ $(obj) $(LDFLAGS)
    1.27 +
    1.28 +-include $(dep)
    1.29 +
    1.30 +%.d: %.c
    1.31 +	@$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.32 +
    1.33 +%.d: %.cc
    1.34 +	@$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.35 +
    1.36 +
    1.37 +.PHONY: clean
    1.38 +clean:
    1.39 +	rm -f $(obj) $(bin) $(dep)