2018-04-21 22:29:42 +02:00
|
|
|
CC = gcc
|
2020-03-15 16:09:06 +01:00
|
|
|
AR = ar
|
|
|
|
ARFLAGS = cr
|
2018-08-01 17:51:17 +02:00
|
|
|
override LDFLAGS = -lm
|
2018-07-04 16:18:21 +01:00
|
|
|
override CFLAGS += -Wall -fwrapv -march=native
|
2020-03-15 16:09:06 +01:00
|
|
|
#override CFLAGS += -DUSE_SIMD
|
2018-03-05 21:20:54 +00:00
|
|
|
|
2018-08-01 17:51:17 +02:00
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
override CFLAGS += -D_WIN32
|
2020-03-15 16:09:06 +01:00
|
|
|
RM = del
|
2018-08-01 17:51:17 +02:00
|
|
|
else
|
|
|
|
override LDFLAGS += -lX11 -pthread
|
2020-03-15 16:09:06 +01:00
|
|
|
#RM = rm
|
2018-08-01 17:51:17 +02:00
|
|
|
endif
|
|
|
|
|
2020-03-15 16:09:06 +01:00
|
|
|
.PHONY : all debug libcubiomes clean
|
2018-03-05 21:20:54 +00:00
|
|
|
|
2020-03-15 16:09:06 +01:00
|
|
|
all: CFLAGS += -O3 -march=native
|
2018-03-05 21:20:54 +00:00
|
|
|
all: find_quadhuts find_compactbiomes clean
|
|
|
|
|
2020-03-15 16:09:06 +01:00
|
|
|
debug: CFLAGS += -DDEBUG -O0 -ggdb3
|
2018-07-04 16:18:21 +01:00
|
|
|
debug: find_quadhuts find_compactbiomes clean
|
|
|
|
|
2020-03-15 16:09:06 +01:00
|
|
|
libcubiomes: CFLAGS += -O3 -fPIC
|
|
|
|
libcubiomes: layers.o generator.o finders.o util.o
|
|
|
|
$(AR) $(ARFLAGS) libcubiomes.a $^
|
|
|
|
|
2018-03-05 21:20:54 +00:00
|
|
|
find_compactbiomes: find_compactbiomes.o layers.o generator.o finders.o
|
|
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
2018-04-25 00:36:45 +01:00
|
|
|
|
2018-03-05 21:20:54 +00:00
|
|
|
find_compactbiomes.o: find_compactbiomes.c
|
|
|
|
$(CC) -c $(CFLAGS) $<
|
|
|
|
|
|
|
|
find_quadhuts: find_quadhuts.o layers.o generator.o finders.o
|
|
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
2018-04-25 00:36:45 +01:00
|
|
|
|
2018-03-05 21:20:54 +00:00
|
|
|
find_quadhuts.o: find_quadhuts.c
|
|
|
|
$(CC) -c $(CFLAGS) $<
|
|
|
|
|
|
|
|
|
|
|
|
xmapview.o: xmapview.c xmapview.h
|
|
|
|
$(CC) -c $(CFLAGS) $<
|
|
|
|
|
|
|
|
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) $<
|
|
|
|
|
2020-03-15 16:09:06 +01:00
|
|
|
util.o: util.c util.h
|
|
|
|
$(CC) -c $(CFLAGS) $<
|
2018-03-05 21:20:54 +00:00
|
|
|
|
|
|
|
clean:
|
2020-03-15 16:09:06 +01:00
|
|
|
$(RM) *.o
|
2018-03-05 21:20:54 +00:00
|
|
|
|