-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (35 loc) · 1.05 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
APPNAME:=$(shell basename `pwd`)
INSTR:= -fsanitize=address,leak,undefined,pointer-compare,pointer-subtract
INSTR+= -fno-omit-frame-pointer
LDFLAGS:=-L ../raylib/src -lm -lraylib -lX11 -ldl -pthread -L lib
LDFLAGS+=-L ode/ode/src/.libs/ -lode -lstdc++
CFLAGS:= -Wfatal-errors -pedantic -Wall -Wextra -Werror -I ode/include/
CFLAGS+= -std=c99 -I ./include -I ../raylib/src -DPLATFORM_DESKTOP
SRC:=$(wildcard src/*.c)
OBJ:=$(SRC:src/%.c=.build/%.o)
INC:=$(wildcard include/*.h)
CC=gcc
all: debug
$(APPNAME): $(OBJ)
$(CC) $(OBJ) -o $(APPNAME) $(LDFLAGS)
$(OBJ): .build/%.o : src/%.c
$(CC) $(CFLAGS) -c $< -o $@
.PHONY: debug release inst
debug: CFLAGS+= -g
debug:
@echo "*** made DEBUG target ***"
release: CFLAGS+= -O3
release:
@echo "*** made RELEASE target ***"
inst: CFLAGS+= -g $(INSTR)
inst: LDFLAGS+= $(INSTR)
inst:
@echo "*** made INSTRUMENTATION target ***"
release: CFLAGS+= -Ofast
debug release inst: clean $(APPNAME)
.PHONY: clean
clean:
rm .build/* -f
rm $(APPNAME) -f
style: $(SRC) $(INC)
astyle -A10 -s4 -S -p -xg -j -z2 -n src/* include/*