1 src = $(wildcard src/*.cc) \
2 $(wildcard src/audio/*.cc) \
3 $(wildcard src/machine/*.cc) \
4 $(wildcard src/blobs/*.cc) \
5 $(wildcard src/imgui/*.cc)
6 csrc = $(wildcard src/*.c) \
7 $(wildcard src/machine/*.c) \
8 $(wildcard src/blobs/*.c)
9 obj = $(src:.cc=.o) $(csrc:.c=.o)
16 incpath = -Isrc -Isrc/machine -I/usr/local/include `pkg-config --cflags sdl2`
17 #libpath = -L/usr/local/lib
19 warn = -pedantic -Wall
21 CFLAGS = $(warn) $(opt) $(dbg) $(incpath) -fopenmp
22 CXXFLAGS = -std=c++11 $(warn) $(opt) $(dbg) $(incpath) -fopenmp
23 LDFLAGS = $(libpath) -ldrawtext $(libgl_$(sys)) $(libal_$(sys)) -lm -lgmath -lvmath \
24 -limago -lresman -lassfile -lpthread -lassimp -ltreestore -lgoatvr -lcurl \
25 `pkg-config --libs sdl2 freetype2` -lpng -ljpeg -lz -lvorbisfile -lgomp
27 sys ?= $(shell uname -s | sed 's/MINGW.*/mingw/')
28 libgl_Linux = -lGL -lGLU -lGLEW
29 libgl_Darwin = -framework OpenGL -lGLEW
30 libgl_mingw = -lopengl32 -lglu32 -lglew32
31 #libgl_mingw = -lglu32 -Wl,-Bstatic -lglew32 -Wl,-Bdynamic -lopengl32
33 libal_Linux = -lopenal
34 libal_Darwin = -framework OpenAL
35 libal_mingw = -lopenal
38 obj = $(src:.cc=.w32.o) $(csrc:.c=.w32.o)
42 LDFLAGS += -lmingw32 -lSDL2main -lSDL2 -lwinmm -mwindows
43 #CFLAGS += -DGLEW_STATIC
44 #CXXFLAGS += -DGLEW_STATIC
47 $(bin): .clang_complete $(obj)
48 $(CXX) -o $@ $(obj) $(LDFLAGS)
52 $(MAKE) CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ sys=mingw
56 $(MAKE) CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ sys=mingw clean
61 mkdir -p /alien/demo/sdr && cp sdr/* /alien/demo/sdr/
62 for i in `tools/dlldepends | grep -v '++'`; do echo $$i; rsync $$i /alien/demo; done
64 .clang_complete: Makefile
66 for i in $(CXXFLAGS); do echo $$i >>$@; done
71 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
74 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
77 $(CC) -o $@ $(CFLAGS) -c $<
80 $(CC) -o $@ $(CXXFLAGS) -c $<