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 := $(stat_c) $(stat_a)
21 graphs_c := $(addprefix $(PLOT_DIR)/,$(addsuffix .c.eps,$(sources:.d=)))
26 P_DC = @echo ' DC $@';
27 P_LD = @echo ' LD $@';
28 P_CP = @echo ' CP $@';
29 P_PLOT = @echo ' PLOT $@';
30 P_MAKE = @echo ' MAKE $@';
31 P_RUN = @echo ' RUN $<';
34 # create build directories if they don't already exist
35 ifneq ($(wildcard $(DIRS)),$(DIRS))
36 dummy_mkdir := $(shell mkdir -p $(DIRS))
39 # don't use Gold with old DMDs
40 ifneq ($(shell ld --version | grep gold),)
41 export LD_ := /usr/bin/ld.single
49 $(P_MAKE) $(MAKE) --no-print-directory build VERS=$@
54 $(BIN_DIR)/%: $(BIN_DIR)/%.o
55 $(P_LD) $(DC) $(DFLAGS) -of$@ $^
57 .INTERMEDIATE: $(BIN_DIR)/%.o
59 $(P_DC) $(DC) $(DFLAGS) -c -of$@ $<
64 .PRECIOUS: $(STAT_DIR)/%.c.csv $(STAT_DIR)/%.a.csv
65 $(STAT_DIR)/%.c.csv $(STAT_DIR)/%.a.csv: $(BIN_DIR)/%
67 $P mv gc-collections.csv $(STAT_DIR)/$*.c.csv
68 $P mv gc-mallocs.csv $(STAT_DIR)/$*.a.csv
70 $(STAT_DIR)/split.c.csv $(STAT_DIR)/split.a.csv: $(BIN_DIR)/bible.txt
72 $(BIN_DIR)/bible.txt: bible.txt
79 $(PLOT_DIR)/%.c.eps: $(STAT_DIR)/%.c.csv plot-c.gpi
80 $(P_PLOT) sed "s|@@PRG@@|$(*F)|g; s|@@COL@@|$(VERS)|g; \
81 s|@@IN@@|$<|g; s|@@OUT@@|$@|g" $(lastword $^) \