forked from dlang-community/dfmt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
45 lines (34 loc) · 985 Bytes
/
makefile
File metadata and controls
45 lines (34 loc) · 985 Bytes
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
SRC := $(shell find src -name "*.d") \
$(shell find libdparse/src -name "*.d")
INCLUDE_PATHS := -Ilibdparse/src -Isrc
DMD_COMMON_FLAGS := -dip25 -w $(INCLUDE_PATHS) -Jviews
DMD_DEBUG_FLAGS := -debug -g $(DMD_COMMON_FLAGS)
DMD_FLAGS := -O -inline $(DMD_COMMON_FLAGS)
DMD_TEST_FLAGS := -unittest -g $(DMD_COMMON_FLAGS)
LDC_FLAGS := -g -w -oq $(INCLUDE_PATHS)
GDC_FLAGS := -g -w -oq $(INCLUDE_PATHS)
DC ?= dmd
LDC ?= ldc2
GDC ?= gdc
.PHONY: dmd ldc gdc test
dmd: bin/dfmt
views/VERSION : .git/refs/tags .git/HEAD
mkdir -p $(dir $@)
git describe --tags > $@
ldc: $(SRC)
$(LDC) $(LDC_FLAGS) $^ -ofbin/dfmt
-rm -f *.o
gdc: $(SRC)
$(GDC) $(GDC_FLAGS) $^ -obin/dfmt
test: debug
cd tests && ./test.sh
bin/dfmt-test: $(SRC)
$(DC) $(DMD_TEST_FLAGS) $^ -of$@
bin/dfmt: views/VERSION $(SRC)
$(DC) $(DMD_FLAGS) $(filter %.d,$^) -of$@
debug: views/VERSION $(SRC)
$(DC) $(DMD_DEBUG_FLAGS) $(filter %.d,$^) -ofbin/dfmt
pkg: dmd
$(MAKE) -f makd/Makd.mak pkg
clean:
$(RM) bin/dfmt