From 12aeff6d19f37aa5007a9e78777ce2f81ac74d6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Tue, 29 Mar 2016 16:44:27 +0200 Subject: [PATCH 1/2] obey LDFLAGS from $ENV --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index bc72348..2fba753 100644 --- a/Makefile +++ b/Makefile @@ -10,13 +10,13 @@ FILTERED_C_FILES := $(filter-out src/gfx%.c src/merge%.c, $(C_FILES)) all: terminal curses: $(FILTERED_C_FILES) src/gfx_curses.c - $(CC) $(CFLAGS) $(FILTERED_C_FILES) $(MERGE_FILE) src/gfx_curses.c -o $(PROGRAM) -lcurses + $(CC) $(CFLAGS) $(FILTERED_C_FILES) $(MERGE_FILE) src/gfx_curses.c -o $(PROGRAM) $(LDFLAGS) -lcurses terminal: $(FILTERED_C_FILES) src/gfx_terminal.c - $(CC) $(CFLAGS) $(FILTERED_C_FILES) $(MERGE_FILE) src/gfx_terminal.c -o $(PROGRAM) + $(CC) $(CFLAGS) $(FILTERED_C_FILES) $(MERGE_FILE) src/gfx_terminal.c -o $(PROGRAM) $(LDFLAGS) sdl: $(FILTERED_C_FILES) src/gfx_sdl.c - $(CC) $(CFLAGS) $(FILTERED_C_FILES) $(MERGE_FILE) src/gfx_sdl.c -o $(PROGRAM) $(shell pkg-config --cflags sdl2) -lSDL2 -lSDL2_ttf + $(CC) $(CFLAGS) $(FILTERED_C_FILES) $(MERGE_FILE) src/gfx_sdl.c -o $(PROGRAM) $(shell pkg-config --cflags sdl2) $(LDFLAGS) -lSDL2 -lSDL2_ttf remake: clean all From 1e1338f1ded8aac9aac506c3a12d923df5f8ee95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Tue, 29 Mar 2016 16:52:05 +0200 Subject: [PATCH 2/2] make TTF_FONT_PATH configurable --- Makefile | 9 ++++++--- src/gfx_sdl.c | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 2fba753..e8b0059 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ -CC ?= clang -CFLAGS += -Wno-visibility -Wno-incompatible-pointer-types -Wall -Wextra -O2 -DINVERT_COLORS -DVT100 -O2 -LFLAGS += +CC ?= clang +TTF_FONT_PATH ?= res/Anonymous Pro.ttf +CFLAGS += -DTTF_FONT_PATH="\"$(TTF_FONT_PATH)\"" +CFLAGS += -Wno-visibility -Wno-incompatible-pointer-types -Wall -Wextra +CFLAGS += -DINVERT_COLORS -DVT100 -O2 +LFLAGS += PROGRAM := 2048 C_FILES := $(wildcard src/*.c) diff --git a/src/gfx_sdl.c b/src/gfx_sdl.c index e46f53e..57a2800 100644 --- a/src/gfx_sdl.c +++ b/src/gfx_sdl.c @@ -5,7 +5,6 @@ #include "gfx.h" /* Side length of a 'pixel' in pixels */ -#define TTF_FONT_PATH "res/Anonymous Pro.ttf" #define TTF_FONT_PT 32 #define iterate(n, expression)\