Mercurial > repos > blastem
comparison Makefile @ 762:206c449eaa81
Get "portable" builds working on Linux and add a build time check for whether /proc exists
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 28 Jun 2015 18:44:11 -0700 |
parents | ffb8cc5845fa |
children | bb60259e8edf |
comparison
equal
deleted
inserted
replaced
761:ffb8cc5845fa | 762:206c449eaa81 |
---|---|
20 LIBS=sdl2 glew | 20 LIBS=sdl2 glew |
21 else | 21 else |
22 LIBS=sdl2 glew gl | 22 LIBS=sdl2 glew gl |
23 endif #Darwin | 23 endif #Darwin |
24 | 24 |
25 CFLAGS:=-std=gnu99 -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration -Wno-unused-value -Wno-logical-op-parentheses | 25 HAS_PROC:=$(shell if [ -d /proc ]; then echo -e -DHAS_PROC; fi) |
26 CFLAGS:=-std=gnu99 -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration -Wno-unused-value -Wno-logical-op-parentheses $(HAS_PROC) | |
26 FIXUP:= | 27 FIXUP:= |
27 ifdef PORTABLE | 28 ifdef PORTABLE |
28 CFLAGS+= -DGLEW_STATIC -Iglew/include | 29 CFLAGS+= -DGLEW_STATIC -Iglew/include |
29 LDFLAGS:=-lm glew/lib/libGLEW.a | 30 LDFLAGS:=-lm glew/lib/libGLEW.a |
30 | 31 |
31 ifeq ($(OS),Darwin) | 32 ifeq ($(OS),Darwin) |
32 CFLAGS+= -IFrameworks/SDL2.framework/Headers | 33 CFLAGS+= -IFrameworks/SDL2.framework/Headers |
33 LDFLAGS+= -FFrameworks -framework SDL2 -framework OpenGL | 34 LDFLAGS+= -FFrameworks -framework SDL2 -framework OpenGL |
34 FIXUP:=install_name_tool -change @rpath/SDL2.framework/Versions/A/SDL2 @executable_path/Frameworks/SDL2.framework/Versions/A/SDL2 ./blastem | 35 FIXUP:=install_name_tool -change @rpath/SDL2.framework/Versions/A/SDL2 @executable_path/Frameworks/SDL2.framework/Versions/A/SDL2 ./blastem |
36 else | |
37 CFLAGS+= -Isdl/include | |
38 LDFLAGS+= -Wl,-rpath='$$ORIGIN/lib' -Llib -lSDL2 $(shell pkg-config --libs gl) | |
35 endif #Darwin | 39 endif #Darwin |
36 | 40 |
37 else | 41 else |
38 CFLAGS:=$(shell pkg-config --cflags-only-I $(LIBS)) $(CFLAGS) | 42 CFLAGS:=$(shell pkg-config --cflags-only-I $(LIBS)) $(CFLAGS) |
39 LDFLAGS:=-lm $(shell pkg-config --libs $(LIBS)) | 43 LDFLAGS:=-lm $(shell pkg-config --libs $(LIBS)) |