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 ifneq ($(strip $(shell ld --version | grep gold)),)
29 export LD_ := /usr/bin/ld.single
37 $(P_MAKE) $(MAKE) --no-print-directory micro VERS=$@
44 build-micro: $(patsubst %.d,$O/%,$(wildcard micro/*.d))
47 micro: $(patsubst %.d,$O/%.eps,$(wildcard micro/*.d))
49 # special command line arguments 'split' micro benchmark
50 $O/micro/split.c.csv $O/micro/split.a.csv: override args := micro/bible.txt
58 $(P_DC) $(DC) $(DFLAGS) -of$@ $^
60 .PRECIOUS: $O/%.c.csv $O/%.a.csv
61 $O/%.c.csv $O/%.a.csv: $O/%
62 $(P_RUN) D_GC_STATS=1 ./$< $(args)
63 $P mv gc-collections.csv $O/$*.c.csv
64 $P mv gc-mallocs.csv $O/$*.a.csv
67 $O/%.h.csv: $O/%.a.csv hist.awk
68 $(P_AWK) awk -F, -f $(lastword $^) $< > $@
71 $O/%.tics: $O/%.h.csv tics.awk
72 $(P_AWK) awk -F, -f $(lastword $^) $< > $@
74 $O/%.eps: $O/%.c.csv $O/%.a.csv $O/%.h.csv $O/%.tics plot.gpi
75 $(P_PLOT) sed "s|@@PRG@@|$(*F)|g; s|@@COL@@|$(VERS)|g; \
76 s|@@INC@@|$(word 1,$^)|g; s|@@INA@@|$(word 2,$^)|g; \
77 s|@@INH@@|$(word 3,$^)|g; s|@@OUT@@|$@|g; \
78 s|@@TICS@@|$(shell cat $(word 4,$^))|g" $(word 5,$^) \