Created
August 19, 2018 14:45
-
-
Save smcameron/ce8e5a1106b5973a4bee1b3a6728a803 to your computer and use it in GitHub Desktop.
Patch to Communist Dogifesto to make it build on linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Makefile b/Makefile | |
index 8c4abfb..71ee675 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -5,7 +5,10 @@ CFLAGS_DEBUG := -Wall -g -O0 -std=c11 | |
CFLAGS_RELEASE := -Wall -g -O3 -flto -std=c11 | |
INCLUDES := -Isrc | |
# On Linux, only static link with my custom libcurl | |
-LIBS_LINUX := -l:src/libs/linux/GL/libGLEW.a \ | |
+ | |
+GLEWLIBS:=$(shell pkg-config --libs-only-l glew) | |
+ | |
+LIBS_LINUX := ${GLEWLIBS} \ | |
-lSDL2 -lGL -lm | |
# On Windows, static link with custom libcurl, GLEW, and SDL2 | |
LIBS_WIN32 := -lmingw32 \ | |
@@ -69,7 +72,10 @@ release_win64: CFLAGS := $(CFLAGS_RELEASE) -Wl,--export-all-symbols -mwindows \ | |
release_win64: TARGET := $(TARGET).exe | |
release_win64: clean dump_shaders procgame | |
-procgame: obj/main.o | |
+obj: | |
+ mkdir obj | |
+ | |
+procgame: obj/main.o obj | |
$(CC) $(CFLAGS) -o $(TARGET) obj/main.o $(GAME) $(PROCGL) $(PROCGL_LIBS) $(LIBS) | |
obj/main.o: src/main.c $(GAME) $(PROCGL) $(PROCGL_LIBS) | |
@@ -212,11 +218,12 @@ obj/wave.o: src/procgl/wave.c src/procgl/wave.h | |
obj/audio.o: src/procgl/audio.c src/procgl/audio.h \ | |
src/procgl/wave.h src/procgl/arr.h src/procgl/ext/wavfile.h | |
$(CC) $(CFLAGS) -o obj/audio.o -c src/procgl/audio.c $(INCLUDES) | |
-obj/sdf.o: src/procgl/sdf.c src/procgl/sdf.h \ | |
- src/procgl/wave.h src/procgl/arr.h | |
+src/procgl/sdf_keywords.gperf.c: src/procgl/sdf_keywords.gperf | |
gperf src/procgl/sdf_keywords.gperf \ | |
-H pg_sdf_keyword_hash -N pg_sdf_keyword_read -t --omit-struct-type \ | |
> src/procgl/sdf_keywords.gperf.c & | |
+obj/sdf.o: src/procgl/sdf.c src/procgl/sdf.h \ | |
+ src/procgl/wave.h src/procgl/arr.h src/procgl/sdf_keywords.gperf.c | |
$(CC) $(CFLAGS) -o obj/sdf.o -c src/procgl/sdf.c $(INCLUDES) | |
obj/sdf_functions.o: src/procgl/sdf_functions.c src/procgl/sdf.h \ | |
src/procgl/wave.h src/procgl/arr.h | |
@@ -264,4 +271,5 @@ dump_shaders: src/procgl/shaders/*.glsl | |
clean: | |
rm -f obj/*.o | |
rm -f src/procgl/shaders/*.glsl.h | |
+ rm -f src/procgl/sdf_keywords.gperf.c | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment