2015-02-22 23:32:29 +00:00
|
|
|
CC := clang
|
2015-02-21 04:31:54 +00:00
|
|
|
CFLAGS += -g -Wall -Wextra
|
2015-02-21 02:36:15 +00:00
|
|
|
LFLAGS +=
|
2015-02-21 04:37:54 +00:00
|
|
|
DEFINES := -DVT100 $(shell pkg-config --cflags sdl2)
|
2014-04-17 20:20:40 +00:00
|
|
|
|
2015-02-21 02:36:15 +00:00
|
|
|
PROGRAM := 2048
|
|
|
|
C_FILES := $(wildcard src/*.c)
|
|
|
|
O_FILES := $(addprefix obj/,$(notdir $(C_FILES:.c=.o)))
|
|
|
|
|
|
|
|
all: curses
|
|
|
|
|
|
|
|
curses: $(O_FILES)
|
|
|
|
$(CC) $(filter-out obj/gfx%.o, $(O_FILES)) obj/gfx_curses.o -o $(PROGRAM) -lcurses
|
|
|
|
|
|
|
|
vt100: $(O_FILES)
|
|
|
|
$(CC) $(filter-out obj/gfx%.o, $(O_FILES)) obj/gfx_terminal.o -o $(PROGRAM)
|
|
|
|
|
2015-02-21 04:31:54 +00:00
|
|
|
sdl: $(O_FILES)
|
|
|
|
$(CC) $(filter-out obj/gfx%.o, $(O_FILES)) obj/gfx_sdl.o -o $(PROGRAM) -lSDL2 -lSDL2_ttf
|
|
|
|
|
2015-02-21 02:36:15 +00:00
|
|
|
obj/%.o: src/%.c
|
|
|
|
$(CC) $(DEFINES) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
remake: clean all
|
2014-04-17 20:20:40 +00:00
|
|
|
|
2014-09-08 20:26:41 +00:00
|
|
|
clean:
|
2015-02-22 03:08:11 +00:00
|
|
|
rm -f $(O_FILES) $(PROGRAM)
|
2014-12-10 18:49:42 +00:00
|
|
|
|
2015-02-21 02:36:15 +00:00
|
|
|
.PHONY: clean remake
|