7 DFLAGS += -g -release -inline -O
9 DFLAGS += -defaultlib=tango-base-dmd-$(VERS) -debuglib=tango-base-dmd-$(VERS)
15 P_DC = @printf ' DC %- 40s <- %s\n' '$@' '$(if \
16 $(subst 1,,$(words $^)),$< ... $(lastword $^),$<)';
17 P_PLOT = @printf ' PLOT %- 40s <- %s\n' '$@' '$(filter %.csv,$^)';
18 P_AWK = @printf ' AWK %- 40s <- %s\n' '$@' '$<';
19 P_RUN = @printf ' RUN $< $(args)\n';
20 P_MAKE = @printf ' MAKE $@\n';
21 P_RM = @printf ' RM $^\n';
22 P_LN = @printf ' LN %- 40s <- %s\n' '$@' '$<';
25 # create build directories if they don't already exist
26 ifneq ($(wildcard $O),$O)
27 dummy_mkdir := $(shell mkdir -p $O)
30 # don't use Gold with old DMDs
31 ifeq ($(subst dmd,,$(DC)),)
32 ifneq ($(strip $(shell ld --version | grep gold)),)
33 export LD_ := /usr/bin/ld.single
42 $(P_MAKE) $(MAKE) --no-print-directory micro dil VERS=$@
49 build-micro: $(patsubst %.d,$O/%,$(wildcard micro/*.d))
52 micro: $(patsubst %.d,$O/%.eps,$(wildcard micro/*.d))
54 # special command line arguments 'split' micro benchmark
55 $O/micro/split.c.csv $O/micro/split.a.csv: override args := micro/bible.txt
64 $O/dil: $(wildcard dil/src/*.d dil/src/cmd/*.d dil/src/util/*.d \
65 dil/src/dil/*.d dil/src/dil/*/*.d)
66 $(P_DC) $(DC) $(DFLAGS) -L-lmpfr -Idil/src -of$@ $^
69 @$(P_LN) $(LN) -sf $(<F) $@
77 $(P_DC) $(DC) $(DFLAGS) -of$@ $^
79 .PRECIOUS: $O/%.c.csv $O/%.a.csv
80 $O/%.c.csv $O/%.a.csv: $O/%
81 $(P_RUN) D_GC_STATS=1 ./$< $(args)
82 $P mv gc-collections.csv $O/$*.c.csv
83 $P mv gc-mallocs.csv $O/$*.a.csv
86 $O/%.h.csv: $O/%.a.csv hist.awk
87 $(P_AWK) awk -F, -f $(lastword $^) $< > $@
90 $O/%.tics: $O/%.h.csv tics.awk
91 $(P_AWK) awk -F, -f $(lastword $^) $< > $@
93 $O/%.eps: $O/%.c.csv $O/%.a.csv $O/%.h.csv $O/%.tics plot.gpi
94 $(P_PLOT) sed "s|@@PRG@@|$(*F)|g; s|@@COL@@|$(VERS)|g; \
95 s|@@INC@@|$(word 1,$^)|g; s|@@INA@@|$(word 2,$^)|g; \
96 s|@@INH@@|$(word 3,$^)|g; s|@@OUT@@|$@|g; \
97 s|@@TICS@@|$(shell cat $(word 4,$^))|g" $(word 5,$^) \