-
Notifications
You must be signed in to change notification settings - Fork 104
/
makefile
65 lines (47 loc) · 1.16 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
53
54
55
56
57
58
59
60
61
62
63
64
#CC = gcc
#AR = ar
ARFLAGS = cr
override LDFLAGS = -lm
override CFLAGS += -Wall -Wextra -fwrapv
ifeq ($(OS),Windows_NT)
override CFLAGS += -D_WIN32
CC = gcc
RM = del
else
override LDFLAGS += -pthread
#RM = rm
endif
.PHONY : all debug release native libcubiomes clean
all: release
debug: CFLAGS += -DDEBUG -O0 -ggdb3
debug: libcubiomes
release: CFLAGS += -O3
release: libcubiomes
native: CFLAGS += -O3 -march=native -ffast-math
native: libcubiomes
ifneq ($(OS),Windows_NT)
release: CFLAGS += -fPIC
#debug: CFLAGS += -fsanitize=undefined
endif
libcubiomes: noise.o biomes.o layers.o biomenoise.o generator.o finders.o util.o quadbase.o
$(AR) $(ARFLAGS) libcubiomes.a $^
finders.o: finders.c finders.h
$(CC) -c $(CFLAGS) $<
generator.o: generator.c generator.h
$(CC) -c $(CFLAGS) $<
biomenoise.o: biomenoise.c
$(CC) -c $(CFLAGS) $<
biometree.o: biometree.c
$(CC) -c $(CFLAGS) $<
layers.o: layers.c layers.h
$(CC) -c $(CFLAGS) $<
biomes.o: biomes.c biomes.h
$(CC) -c $(CFLAGS) $<
noise.o: noise.c noise.h
$(CC) -c $(CFLAGS) $<
util.o: util.c util.h
$(CC) -c $(CFLAGS) $<
quadbase.o: quadbase.c quadbase.h
$(CC) -c $(CFLAGS) $<
clean:
$(RM) *.o *.a