-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (31 loc) · 919 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
# Adapted from darkstalker's makefile: https://gist.github.com/darkstalker/2221824
COMPILER = gdc
# Maybe it's because I'm running this in VirtualBox emulating 64-bit Linux on
# my Intel Windows host, but adding a -m64 or -m32 flag screws everything up
# and slows it down.
DFLAGS = -w
LIBS =
SRC = $(wildcard *.d)
UNAME = $(shell uname)
ifeq ($(UNAME), Linux)
OBJ = $(SRC:.d=.o)
else ifeq ($(UNAME), CYGWIN_NT-6.3)
OBJ = $(SRC:.d=.obj)
else
$(error Not tested on $(UNAME))
endif
OUT = $(shell basename `pwd`)
.PHONY: all debug release profile clean
all: debug
debug: DFLAGS += -g -fdebug
release: DFLAGS += -O3 -frelease -finline-functions -fno-bounds-check
profile: DFLAGS += -g -O3
debug release profile: $(OUT)
$(OUT): $(OBJ)
$(COMPILER) $(DFLAGS) -o$@ $(OBJ) $(LIBS)
clean:
rm -f *~ $(OBJ) $(OUT) trace.{def,log}
%.o: %.d
$(COMPILER) $(DFLAGS) -c $<
%.obj: %.d
$(COMPILER) $(DFLAGS) -c $<