6 DFLAGS += -release -inline -O
7 DFLAGS += -defaultlib=tango-base-dmd-$(VERS) -debuglib=tango-base-dmd-$(VERS) \
8 -L-ltango-user-dmd-$(VERS)
11 BIN_DIR := $(BUILD_DIR)/bin
12 STAT_DIR := $(BUILD_DIR)/stat
13 PLOT_DIR := $(BUILD_DIR)/plot
14 DIRS := $(BIN_DIR) $(STAT_DIR) $(PLOT_DIR)
16 sources := $(wildcard *.d)
17 programs := $(addprefix $(BIN_DIR)/,$(sources:.d=))
18 stat_c := $(addprefix $(STAT_DIR)/,$(addsuffix .c.csv,$(sources:.d=)))
19 stat_a := $(addprefix $(STAT_DIR)/,$(addsuffix .a.csv,$(sources:.d=)))
20 stat_h := $(addprefix $(STAT_DIR)/,$(addsuffix .h.csv,$(sources:.d=)))
21 stat := $(stat_c) $(stat_a) $(stat_h)
22 graphs_c := $(addprefix $(PLOT_DIR)/,$(addsuffix .c.eps,$(sources:.d=)))
28 P_DC = @echo ' DC $@';
29 P_LD = @echo ' LD $@';
30 P_PLOT = @echo ' PLOT $@';
31 P_MAKE = @echo ' MAKE $@';
32 P_RUN = @echo ' RUN $< $(arg1) $(arg2) $(arg3)';
33 P_AWK = @echo ' AWK $@';
36 # create build directories if they don't already exist
37 ifneq ($(wildcard $(DIRS)),$(DIRS))
38 dummy_mkdir := $(shell mkdir -p $(DIRS))
41 # don't use Gold with old DMDs
42 ifneq ($(shell ld --version | grep gold),)
43 export LD_ := /usr/bin/ld.single
51 $(P_MAKE) $(MAKE) --no-print-directory build VERS=$@
56 $(BIN_DIR)/%: $(BIN_DIR)/%.o
57 $(P_LD) $(DC) $(DFLAGS) -of$@ $^
60 $(P_DC) $(DC) $(DFLAGS) -c -of$@ $<
65 .PRECIOUS: $(STAT_DIR)/%.c.csv $(STAT_DIR)/%.a.csv
66 $(STAT_DIR)/%.c.csv $(STAT_DIR)/%.a.csv: $(BIN_DIR)/%
68 $P mv gc-collections.csv $(STAT_DIR)/$*.c.csv
69 $P mv gc-mallocs.csv $(STAT_DIR)/$*.a.csv
71 # special command line arguments for benchmarks
72 $(STAT_DIR)/split.c.csv $(STAT_DIR)/split.a.csv: override args := bible.txt
74 .PRECIOUS: $(STAT_DIR)/%.h.csv
75 $(STAT_DIR)/%.h.csv: $(STAT_DIR)/%.a.csv hist.awk
76 $(P_AWK) awk -F, -f $(lastword $^) $< > $@
81 .PRECIOUS: $(PLOT_DIR)/%.tics
82 $(PLOT_DIR)/%.tics: $(STAT_DIR)/%.h.csv tics.awk
83 $(P_AWK) awk -F, -f $(lastword $^) $< > $@
85 $(PLOT_DIR)/%.c.eps: $(STAT_DIR)/%.c.csv $(STAT_DIR)/%.a.csv \
86 $(STAT_DIR)/%.h.csv $(PLOT_DIR)/%.tics plot-c.gpi
87 $(P_PLOT) sed "s|@@PRG@@|$(*F)|g; s|@@COL@@|$(VERS)|g; \
88 s|@@INC@@|$(word 1,$^)|g; s|@@INA@@|$(word 2,$^)|g; \
89 s|@@INH@@|$(word 3,$^)|g; s|@@OUT@@|$@|g; \
90 s|@@TICS@@|$(shell cat $(word 4,$^))|g" $(word 5,$^) \