6 DFLAGS += -defaultlib=tango-base-dmd-$(VERS) -debuglib=tango-base-dmd-$(VERS)
7 DFLAGS += -release -inline -O
11 micro_src := $(wildcard micro/*.d)
15 P_DC = @printf ' DC %- 40s <- %s\n' '$@' '$<';
16 P_LD = @printf ' LD %- 40s <- %s\n' '$@' '$^';
17 P_PLOT = @printf ' PLOT %- 40s <- %s\n' '$@' '$< ...';
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';
24 # create build directories if they don't already exist
25 ifneq ($(wildcard $O),$O)
26 dummy_mkdir := $(shell mkdir -p $O)
29 # don't use Gold with old DMDs
30 ifneq ($(shell ld --version | grep gold),)
31 export LD_ := /usr/bin/ld.single
39 $(P_MAKE) $(MAKE) --no-print-directory micro VERS=$@
42 $(P_LD) $(DC) $(DFLAGS) -of$@ $^
45 $(P_DC) $(DC) $(DFLAGS) -c -of$@ $<
47 .PRECIOUS: $O/%.c.csv $O/%.a.csv
48 $O/%.c.csv $O/%.a.csv: $O/%
50 $P mv gc-collections.csv $O/$*.c.csv
51 $P mv gc-mallocs.csv $O/$*.a.csv
53 # special command line arguments for benchmarks
54 $O/micro/split.c.csv $O/micro/split.a.csv: override args := micro/bible.txt
57 $O/%.h.csv: $O/%.a.csv hist.awk
58 $(P_AWK) awk -F, -f $(lastword $^) $< > $@
61 micro: $(patsubst %.d,$O/%.eps,$(micro_src))
64 $O/%.tics: $O/%.h.csv tics.awk
65 $(P_AWK) awk -F, -f $(lastword $^) $< > $@
67 $O/%.eps: $O/%.c.csv $O/%.a.csv \
68 $O/%.h.csv $O/%.tics plot.gpi
69 $(P_PLOT) sed "s|@@PRG@@|$(*F)|g; s|@@COL@@|$(VERS)|g; \
70 s|@@INC@@|$(word 1,$^)|g; s|@@INA@@|$(word 2,$^)|g; \
71 s|@@INH@@|$(word 3,$^)|g; s|@@OUT@@|$@|g; \
72 s|@@TICS@@|$(shell cat $(word 4,$^))|g" $(word 5,$^) \