-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathmakefile
More file actions
54 lines (40 loc) · 1.05 KB
/
makefile
File metadata and controls
54 lines (40 loc) · 1.05 KB
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
DMD ?= dmd
RDMD ?= rdmd
AS ?= as
ARCH ?= $(shell uname -m)
PLATFORM = $(shell uname -s)
ARCHFLAG ?= -m64
DFLAGS = $(ARCHFLAG) -Isrc -w -debug -g
# DFLAGS = $(ARCHFLAG) -w -O -release
ASFLAGS ?=
LDFLAGS ?=
ifdef LD_PATH
override LDFLAGS += $(addprefix -L, $(LD_PATH))
endif
ifeq ($(PLATFORM),Linux)
LD_LLD = $(shell which ld.lld | xargs basename)
ifeq ($(LD_LLD),ld.lld)
override LDFLAGS += -fuse-ld=lld
endif
override LDFLAGS += -lstdc++ -export-dynamic
endif
ifeq ($(PLATFORM),Darwin)
override LDFLAGS += -lc++ -Wl,-export_dynamic
endif
ifeq ($(PLATFORM),FreeBSD)
override LDFLAGS += -lc++
endif
# To make sure make calls all
default: all
include src/sdc.mak
include src/sdfmt.mak
include test/unit.mak
all: $(ALL_EXECUTABLES) $(ALL_TOOLS) $(LIBSDRT) $(LIBDMDALLOC) $(PHOBOS)
check: all
clean:
rm -rf obj lib bin/sdconfig $(ALL_EXECUTABLES) $(ALL_TOOLS)
print-%: ; @echo $*=$($*)
.PHONY: check clean default
# Secondary without dependency make all temporaries secondary.
.SECONDARY:
include $(shell test -d obj && find obj/ -type f -name '*.deps')