forked from Cubitect/cubiomes
-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
48 lines (36 loc) · 842 Bytes
/
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
CC = gcc
AR = ar
ARFLAGS = cr
override LDFLAGS = -lm
override CFLAGS += -Wall -Wextra -fwrapv
ifeq ($(OS),Windows_NT)
override CFLAGS += -D_WIN32
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
native: libcubiomes
ifeq ($(OS),Windows_NT)
else
libcubiomes: CFLAGS += -fPIC
endif
libcubiomes: layers.o generator.o finders.o util.o
$(AR) $(ARFLAGS) libcubiomes.a $^
finders.o: finders.c finders.h
$(CC) -c $(CFLAGS) $<
generator.o: generator.c generator.h
$(CC) -c $(CFLAGS) $<
layers.o: layers.c layers.h
$(CC) -c $(CFLAGS) $<
util.o: util.c util.h
$(CC) -c $(CFLAGS) $<
clean:
$(RM) *.o libcubiomes.a