-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (30 loc) · 1.13 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
KEYBOARD = 0
CONTROLLER = 1
INPUT ?= $(KEYBOARD)
CFLAGS = -Wall -Wextra -std=c11 -g -DINPUT=$(INPUT) -DKEYBOARD=$(KEYBOARD) -DCONTROLLER=$(CONTROLLER) -O0 -pedantic
LDFLAGS = -lSDL2 -lSDL2_image -lSDL2_mixer -ljansson -lchipmunk
UNAME_S = $(shell uname -s)
ifeq ($(PROFILE), yes)
CFLAGS += -pg
LDFLAGS += -pg
endif
ifeq ($(UNAME_S), Linux)
LDFLAGS += -lm -lpthread
CFLAGS += -D_REENTRANT -I/usr/include/SDL2
BINARY = tanktanktank
else ifeq ("",$(shell echo $(UNAME_S)) | grep -E 'MSYS|MINGW')
BINARY = tanktanktank
else
BINARY = tanktanktank
CFLAGS += -w -Wl,-subsystem,windows -IC:/Program\ Files\ \(x86\)/Windows\ Kits/8.1/Include/um -IC:/Program\ Files\ \(x86\)/Windows\ Kits/8.1/Include/shared -I/include
LDFLAGS += -lmingw32 -lSDL2main -lm -L/lib *.dll
endif
OBJS = tanktanktank.o hint.o hashtbl.o obj.o tonic.o room.o player.o jsonutils.o globals.o bullet.o collisiontypes.o enemy.o gun.o viewport.o
all: tanktanktank
tanktanktank: $(OBJS)
clean:
find . -name "*.o" -exec rm {} \;
find . -name "*~" -exec rm {} \;
find . -name "\#*\#" -exec rm {} \;
find . -name ".\#*" -exec rm {} \;
find . -name $(BINARY) -exec rm {} \;