metasurf

diff examples/metaballs/Makefile @ 0:7aa4627e492b

first commit
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 25 Oct 2011 07:34:31 +0300
parents
children dc0e882ec3f9
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/examples/metaballs/Makefile	Tue Oct 25 07:34:31 2011 +0300
     1.3 @@ -0,0 +1,31 @@
     1.4 +src = $(wildcard src/*.c)
     1.5 +obj = $(src:.c=.o)
     1.6 +dep = $(obj:.o=.d)
     1.7 +bin = metasurf
     1.8 +
     1.9 +CC = gcc
    1.10 +CFLAGS = -pedantic -Wall -g -O3
    1.11 +LDFLAGS = $(libgl)
    1.12 +
    1.13 +ifeq ($(shell uname -s), Darwin)
    1.14 +	libgl = -framework OpenGL -framework GLUT -lGLEW
    1.15 +else
    1.16 +	libgl = -lGL -lGLU -lglut -lGLEW
    1.17 +endif
    1.18 +
    1.19 +$(bin): $(obj)
    1.20 +	$(CC) -o $@ $(obj) $(LDFLAGS)
    1.21 +
    1.22 +-include $(dep)
    1.23 +
    1.24 +%.d: %.c
    1.25 +	@$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.26 +
    1.27 +.PHONY: clean
    1.28 +clean:
    1.29 +	rm -f $(obj) $(bin)
    1.30 +
    1.31 +
    1.32 +.PHONY: cleandep
    1.33 +cleandep:
    1.34 +	rm -f $(dep)