ld33_umonster

annotate Makefile @ 0:4a6683050e29

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 22 Aug 2015 07:15:00 +0300
parents
children 93ff21458a16
rev   line source
nuclear@0 1 ccsrc = $(wildcard src/*.cc)
nuclear@0 2 csrc = $(wildcard src/*.c)
nuclear@0 3 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
nuclear@0 4 dep = $(obj:.o=.d)
nuclear@0 5
nuclear@0 6 bin = umonster
nuclear@0 7
nuclear@0 8 sys = $(shell uname -s)
nuclear@0 9
nuclear@0 10 CFLAGS = -pedantic -Wall -g
nuclear@0 11 CXXFLAGS = $(CFLAGS)
nuclear@0 12 LDFLAGS = $(libgl_$(sys)) -lvmath -limago -lpsys -lanim -lm
nuclear@0 13
nuclear@0 14 libgl_Linux = -lGL -lGLU -lglut -lGLEW
nuclear@0 15 libgl_Darwin = -framework OpenGL -framework GLUT -lGLEW
nuclear@0 16
nuclear@0 17
nuclear@0 18 $(bin): $(obj)
nuclear@0 19 $(CXX) -o $@ $(obj) $(LDFLAGS)
nuclear@0 20
nuclear@0 21 -include $(dep)
nuclear@0 22
nuclear@0 23 %.d: %.c
nuclear@0 24 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@0 25
nuclear@0 26 %.d: %.cc
nuclear@0 27 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@0 28
nuclear@0 29 .PHONY: clean
nuclear@0 30 clean:
nuclear@0 31 rm -f $(obj) $(bin)
nuclear@0 32
nuclear@0 33 .PHONY: cleandep
nuclear@0 34 cleandep:
nuclear@0 35 rm -f $(dep)