dbf-halloween2015

diff Makefile @ 1:c3f5c32cb210

barfed all the libraries in the source tree to make porting easier
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 01 Nov 2015 00:36:56 +0200
parents 50683c78264e
children 5ae5fd3626fa
line diff
     1.1 --- a/Makefile	Sun Nov 01 00:09:12 2015 +0200
     1.2 +++ b/Makefile	Sun Nov 01 00:36:56 2015 +0200
     1.3 @@ -1,17 +1,39 @@
     1.4 -src = $(wildcard src/*.cc) $(wildcard src/audio/*.cc)
     1.5 -csrc = $(wildcard src/*.c) $(wildcard src/dsys/*.c)
     1.6 +src = $(wildcard src/*.cc) \
     1.7 +	  $(wildcard src/audio/*.cc) \
     1.8 +	  $(wildcard libs/vmath/*.cc)
     1.9 +csrc = $(wildcard src/*.c) \
    1.10 +	   $(wildcard src/dsys/*.c) \
    1.11 +	   $(wildcard libs/vmath/*.c) \
    1.12 +	   $(wildcard libs/imago/*.c) \
    1.13 +	   $(wildcard libs/libjpeg/*.c) \
    1.14 +	   $(wildcard libs/libpng/*.c) \
    1.15 +	   $(wildcard libs/zlib/*.c) \
    1.16 +	   $(wildcard libs/ogg/*.c) \
    1.17 +	   $(wildcard libs/vorbis/*.c)
    1.18 +
    1.19  obj = $(src:.cc=.o) $(csrc:.c=.o)
    1.20  dep = $(obj:.o=.d)
    1.21  bin = halloween
    1.22  
    1.23  opt = -O2
    1.24  
    1.25 -CFLAGS = -pedantic -Wall -g $(opt) -Isrc
    1.26 -CXXFLAGS = -pedantic -Wall -g $(opt) -Isrc
    1.27 -LDFLAGS = -lGL -lGLU -lglut -lGLEW -lvmath -limago -lm -ldl -lpthread \
    1.28 -		  -lvorbisfile -logg -lpthread -lopenal
    1.29 +inc = -Isrc -Ilibs/libjpeg -Ilibs/zlib -Ilibs/libpng -Ilibs/imago \
    1.30 +	  -Ilibs/ogg -Ilibs/vorbis
    1.31  
    1.32 -$(bin): $(obj)
    1.33 +CFLAGS = -pedantic -Wall -g $(opt) $(inc)
    1.34 +CXXFLAGS = -pedantic -Wall -g $(opt) $(inc)
    1.35 +LDFLAGS = $(libgl) $(libal) -lm -ldl -lpthread
    1.36 +
    1.37 +sys = $(shell uname -s)
    1.38 +ifeq ($(sys), Darwin)
    1.39 +	libgl = -lGL -lGLU -lglut -lGLEW
    1.40 +	libal = -lopenal
    1.41 +else
    1.42 +	libgl = -framework OpenGL -framework GLUT -lGLEW
    1.43 +	libal = -framework OpenAL
    1.44 +endif
    1.45 +
    1.46 +$(bin): $(obj) Makefile
    1.47  	$(CXX) -o $@ $(obj) $(LDFLAGS)
    1.48  
    1.49  -include $(dep)