vrseasons

diff Makefile @ 0:393ef1143c9c

VR seasons
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 07 Apr 2015 11:16:56 +0300
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Tue Apr 07 11:16:56 2015 +0300
     1.3 @@ -0,0 +1,41 @@
     1.4 +csrc = $(wildcard src/*.c)
     1.5 +ccsrc = $(wildcard src/*.cc)
     1.6 +obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
     1.7 +dep = $(obj:.o=.d)
     1.8 +bin = vrseasons
     1.9 +
    1.10 +sys = $(shell uname -s)
    1.11 +
    1.12 +use_glut = 1
    1.13 +
    1.14 +CFLAGS = -pedantic -Wall -g
    1.15 +CXXFLAGS = $(CFLAGS)
    1.16 +LDFLAGS = $(libgl_$(sys)) -ldl -lgoatvr
    1.17 +
    1.18 +libgl_Linux = -lGL -lGLU -lGLEW
    1.19 +libgl_Darwin = -framework OpenGL -lGLEW
    1.20 +
    1.21 +ifdef use_glut
    1.22 +	CFLAGS += -DUSE_GLUT
    1.23 +	libgl_Linux += -lglut
    1.24 +	libgl_Darwin += -framework GLUT
    1.25 +endif
    1.26 +
    1.27 +$(bin): $(obj)
    1.28 +	$(CXX) -o $@ $(obj) $(LDFLAGS)
    1.29 +
    1.30 +-include $(dep)
    1.31 +
    1.32 +%.d: %.c
    1.33 +	@$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.34 +
    1.35 +%.d: %.cc
    1.36 +	@$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.37 +
    1.38 +.PHONY: clean
    1.39 +clean:
    1.40 +	rm -f $(obj) $(bin)
    1.41 +
    1.42 +.PHONY: cleandep
    1.43 +cleandep:
    1.44 +	rm -f $(dep)