-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
46 lines (36 loc) · 1.06 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
CC=gcc
WARN=-Wall -Wextra -Wpedantic -Wconversion -Wunused-variable -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wdouble-promotion -Waggregate-return -Wunused-function -Wunused-result
CDEFFLAGS=-std=c99 $(WARN) -municode -D UNICODE -D _UNICODE
CFLAGS=-O3 -Wl,--strip-all,--build-id=none,--gc-sections -fno-ident -D NDEBUG
CFLAGSD=-g -O0 -D PROFILING_ENABLE=1
TARGET=atto
OBJ=obj
OBJD=objd
SRC=src
default: release
$(OBJ):
mkdir $(OBJ)
$(OBJD):
mkdir $(OBJD)
srcs = $(wildcard $(SRC)/*.c)
#srcs += $(wildcard $(SRC)/*.rc)
srcs := $(subst $(SRC)/,,$(srcs))
objs_d = $(srcs:%=$(OBJD)/%.o)
objs_r = $(srcs:%=$(OBJ)/%.o)
$(OBJ)/%.c.o: $(SRC)/%.c
$(CC) -c $^ -o $@ $(CDEFFLAGS) $(CFLAGS)
$(OBJD)/%.c.o: $(SRC)/%.c
$(CC) -c $^ -o $@ $(CDEFFLAGS) $(CFLAGSD)
debug: $(OBJD) debug_obj
debug_obj: $(objs_d)
$(CC) $^ -o deb$(TARGET).exe $(CDEFFLAGS) $(CFLAGSD)
release: $(OBJ) release_obj
release_obj: $(objs_r)
$(CC) $^ -o $(TARGET).exe $(CDEFFLAGS) $(CFLAGS)
deb: debug
rel: release
clean:
rm -r -f $(OBJ)
rm -r -f $(OBJD)
rm -f $(TARGET).exe
rm -f deb$(TARGET).exe