view3d

diff Makefile.in @ 0:182bfd9f55c7

view3d
author John Tsiombikas <nuclear@mutantstargoat.com>
date Thu, 19 Jan 2012 00:17:31 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile.in	Thu Jan 19 00:17:31 2012 +0200
     1.3 @@ -0,0 +1,36 @@
     1.4 +src = $(wildcard src/*.c)
     1.5 +obj = $(src:.c=.o)
     1.6 +dep = $(obj:.o=.d)
     1.7 +bin = view3d
     1.8 +
     1.9 +CFLAGS = -pedantic -Wall -g $(incdir)
    1.10 +LDFLAGS = $(libdir) $(libgl) -lassimp -lm -limago
    1.11 +
    1.12 +ifeq ($(shell uname -s), Darwin)
    1.13 +	libgl = -framework OpenGL -framework GLUT -lGLEW
    1.14 +	incdir = -I/opt/local/include
    1.15 +	libdir = -L/opt/local/lib
    1.16 +else
    1.17 +	libgl = -lGL -lGLU -lglut -lGLEW
    1.18 +endif
    1.19 +
    1.20 +$(bin): $(obj)
    1.21 +	$(CC) -o $@ $(obj) $(LDFLAGS)
    1.22 +
    1.23 +-include $(dep)
    1.24 +
    1.25 +%.d: %.c
    1.26 +	@$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.27 +
    1.28 +.PHONY: clean
    1.29 +clean:
    1.30 +	rm -f $(obj) $(bin)
    1.31 +
    1.32 +.PHONY: install
    1.33 +install: $(bin)
    1.34 +	mkdir -p $(INSTDIR)$(PREFIX)/bin
    1.35 +	cp $(bin) $(INSTDIR)$(PREFIX)/bin/$(bin)
    1.36 +
    1.37 +.PHONY: uninstall
    1.38 +uninstall:
    1.39 +	rm -f $(INSTDIR)$(PREFIX)/bin/$(bin)