6 DFLAGS += -defaultlib=tango-base-dmd-$(VERS) -debuglib=tango-base-dmd-$(VERS)
7 DFLAGS += -release -inline -O
13 P_DC = @printf ' DC %- 40s <- %s\n' '$@' '$(if \
14 $(subst 1,,$(words $^)),$< ... $(lastword $^),$<)';
15 P_PLOT = @printf ' PLOT %- 40s <- %s\n' '$@' '$(filter %.csv,$^)';
16 P_AWK = @printf ' AWK %- 40s <- %s\n' '$@' '$<';
17 P_RUN = @printf ' RUN $< $(args)\n';
18 P_MAKE = @printf ' MAKE $@\n';
19 P_RM = @printf ' RM $^\n';
22 # create build directories if they don't already exist
23 ifneq ($(wildcard $O),$O)
24 dummy_mkdir := $(shell mkdir -p $O)
27 # don't use Gold with old DMDs
28 ifeq ($(subst dmd,,$(DC)),)
29 ifneq ($(strip $(shell ld --version | grep gold)),)
30 export LD_ := /usr/bin/ld.single
39 $(P_MAKE) $(MAKE) --no-print-directory micro VERS=$@
46 build-micro: $(patsubst %.d,$O/%,$(wildcard micro/*.d))
49 micro: $(patsubst %.d,$O/%.eps,$(wildcard micro/*.d))
51 # special command line arguments 'split' micro benchmark
52 $O/micro/split.c.csv $O/micro/split.a.csv: override args := micro/bible.txt
60 $(P_DC) $(DC) $(DFLAGS) -of$@ $^
62 .PRECIOUS: $O/%.c.csv $O/%.a.csv
63 $O/%.c.csv $O/%.a.csv: $O/%
64 $(P_RUN) D_GC_STATS=1 ./$< $(args)
65 $P mv gc-collections.csv $O/$*.c.csv
66 $P mv gc-mallocs.csv $O/$*.a.csv
69 $O/%.h.csv: $O/%.a.csv hist.awk
70 $(P_AWK) awk -F, -f $(lastword $^) $< > $@
73 $O/%.tics: $O/%.h.csv tics.awk
74 $(P_AWK) awk -F, -f $(lastword $^) $< > $@
76 $O/%.eps: $O/%.c.csv $O/%.a.csv $O/%.h.csv $O/%.tics plot.gpi
77 $(P_PLOT) sed "s|@@PRG@@|$(*F)|g; s|@@COL@@|$(VERS)|g; \
78 s|@@INC@@|$(word 1,$^)|g; s|@@INA@@|$(word 2,$^)|g; \
79 s|@@INH@@|$(word 3,$^)|g; s|@@OUT@@|$@|g; \
80 s|@@TICS@@|$(shell cat $(word 4,$^))|g" $(word 5,$^) \