dbf_amiga

annotate Makefile @ 0:87dfe0e10235

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 31 Aug 2015 07:38:37 +0300
parents
children
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 = amiga
nuclear@0 7
nuclear@0 8 sys = $(shell uname -s)
nuclear@0 9
nuclear@0 10 warn = -pedantic -Wall -Wno-format-extra-args
nuclear@0 11 dbg = -g
nuclear@0 12 opt = -O0
nuclear@0 13
nuclear@0 14 CFLAGS = $(warn) $(dbg) $(opt)
nuclear@0 15 CXXFLAGS = $(CFLAGS)
nuclear@0 16 LDFLAGS = $(libgl) -lvmath -limago -lpsys -lanim -lm
nuclear@0 17
nuclear@0 18 ifeq ($(sys), Darwin)
nuclear@0 19 libgl = -framework OpenGL -framework GLUT -lGLEW
nuclear@0 20 warn += -Wno-deprecated-declarations
nuclear@0 21 else
nuclear@0 22 libgl = -lGL -lGLU -lglut -lGLEW
nuclear@0 23 endif
nuclear@0 24
nuclear@0 25 .PHONY: all
nuclear@0 26 all: $(bin)
nuclear@0 27
nuclear@0 28 $(bin): $(obj)
nuclear@0 29 $(CXX) -o $@ $(obj) $(LDFLAGS)
nuclear@0 30
nuclear@0 31 -include $(dep)
nuclear@0 32
nuclear@0 33 %.d: %.c
nuclear@0 34 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@0 35
nuclear@0 36 %.d: %.cc
nuclear@0 37 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@0 38
nuclear@0 39 .PHONY: clean
nuclear@0 40 clean:
nuclear@0 41 rm -f $(obj) $(bin)
nuclear@0 42
nuclear@0 43 .PHONY: cleandep
nuclear@0 44 cleandep:
nuclear@0 45 rm -f $(dep)