ld33_umonster

diff Makefile @ 0:4a6683050e29

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 22 Aug 2015 07:15:00 +0300
parents
children 93ff21458a16
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Sat Aug 22 07:15:00 2015 +0300
     1.3 @@ -0,0 +1,35 @@
     1.4 +ccsrc = $(wildcard src/*.cc)
     1.5 +csrc = $(wildcard src/*.c)
     1.6 +obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
     1.7 +dep = $(obj:.o=.d)
     1.8 +
     1.9 +bin = umonster
    1.10 +
    1.11 +sys = $(shell uname -s)
    1.12 +
    1.13 +CFLAGS = -pedantic -Wall -g
    1.14 +CXXFLAGS = $(CFLAGS)
    1.15 +LDFLAGS = $(libgl_$(sys)) -lvmath -limago -lpsys -lanim -lm
    1.16 +
    1.17 +libgl_Linux = -lGL -lGLU -lglut -lGLEW
    1.18 +libgl_Darwin = -framework OpenGL -framework GLUT -lGLEW
    1.19 +
    1.20 +
    1.21 +$(bin): $(obj)
    1.22 +	$(CXX) -o $@ $(obj) $(LDFLAGS)
    1.23 +
    1.24 +-include $(dep)
    1.25 +
    1.26 +%.d: %.c
    1.27 +	@$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.28 +
    1.29 +%.d: %.cc
    1.30 +	@$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.31 +
    1.32 +.PHONY: clean
    1.33 +clean:
    1.34 +	rm -f $(obj) $(bin)
    1.35 +
    1.36 +.PHONY: cleandep
    1.37 +cleandep:
    1.38 +	rm -f $(dep)