coeng

annotate Makefile @ 9:49fdb15f1100

added makefile rule to download and unpack the obj file
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 15 Feb 2015 05:23:09 +0200
parents 8cce82794f90
children
rev   line source
nuclear@8 1 csrc = $(wildcard src/*.c)
nuclear@2 2 ccsrc = $(wildcard src/*.cc)
nuclear@8 3 obj = $(ccsrc:.cc=.o) $(csrc:.c=.o)
nuclear@6 4 dep = $(obj:.o=.d)
nuclear@2 5 bin = test
nuclear@2 6
nuclear@3 7 warn = -pedantic -Wall
nuclear@3 8 dbg = -g
nuclear@3 9
nuclear@4 10 CXXFLAGS = -std=c++11 $(warn) $(dbg)
nuclear@4 11 LDFLAGS = $(libgl) -lm -lvmath -lpthread
nuclear@2 12
nuclear@2 13 ifeq ($(shell uname -s), Darwin)
nuclear@2 14 libgl = -framework OpenGL -framework GLUT -lGLEW
nuclear@3 15 warn += -Wno-deprecated-declarations
nuclear@2 16 else
nuclear@2 17 libgl = -lGL -lGLU -lglut -lGLEW
nuclear@2 18 endif
nuclear@2 19
nuclear@9 20 .PHONY: all
nuclear@9 21 all: $(bin) lucy.obj
nuclear@9 22
nuclear@2 23 $(bin): $(obj)
nuclear@2 24 $(CXX) -o $@ $(obj) $(LDFLAGS)
nuclear@2 25
nuclear@9 26 lucy.obj: lucy.obj.xz
nuclear@9 27 xzcat $< >$@
nuclear@9 28
nuclear@9 29 lucy.obj.xz:
nuclear@9 30 wget -c mutantstargoat.com/~nuclear/tmp/lucy.obj.xz
nuclear@9 31
nuclear@6 32 -include $(dep)
nuclear@6 33
nuclear@8 34 %.d: %.c
nuclear@8 35 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@8 36
nuclear@6 37 %.d: %.cc
nuclear@6 38 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@6 39
nuclear@2 40 .PHONY: clean
nuclear@2 41 clean:
nuclear@2 42 rm -f $(obj) $(bin)
nuclear@6 43
nuclear@6 44 .PHONY: cleandep
nuclear@6 45 cleandep:
nuclear@6 46 rm -f $(dep)