X-Git-Url: https://git.llucax.com/software/dgc/dgcbench.git/blobdiff_plain/c0a78176c710a53333b9daf864b2265495b2e009..87dc0324ffd32c5a094ba2d1a42b10c6565470f3:/Makefile diff --git a/Makefile b/Makefile index a8b02ea..2ba5804 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,13 @@ -VERS := naive -DC := dmd -DL := dmd -GNUPLOT := gnuplot -DFLAGS += -defaultlib=tango-base-dmd-$(VERS) -debuglib=tango-base-dmd-$(VERS) -DFLAGS += -release -inline -O - -O := $(VERS) +GC := cdgc +O := build/$(GC) +DC := dmd +LD := dmd +LN := ln +GNUPLOT := gnuplot +override DFLAGS ?= -release -inline -O -gc +LDFLAGS := -defaultlib=tango-$(GC) -debuglib=tango-$(GC) +LIBTANGO := ../lib/libtango-$(GC).a ifndef V P = @ @@ -17,11 +18,12 @@ P_AWK = @printf ' AWK %- 40s <- %s\n' '$@' '$<'; P_RUN = @printf ' RUN $< $(args)\n'; P_MAKE = @printf ' MAKE $@\n'; P_RM = @printf ' RM $^\n'; +P_LN = @printf ' LN %- 40s <- %s\n' '$@' '$<'; endif # create build directories if they don't already exist ifneq ($(wildcard $O),$O) -dummy_mkdir := $(shell mkdir -p $O) +dummy_mkdir := $(shell mkdir -p $O $O/bin $O/stats) endif # don't use Gold with old DMDs @@ -32,49 +34,73 @@ endif endif .PHONY: all -all: naive +all: cdgc basic -.PHONY: naive basic -naive basic: - $(P_MAKE) $(MAKE) --no-print-directory micro VERS=$@ +.PHONY: cdgc basic +cdgc basic: + $(P_MAKE) $(MAKE) --no-print-directory micro-build dil-build GC=$@ # micro ######## -.PHONY: build-micro -build-micro: $(patsubst %.d,$O/%,$(wildcard micro/*.d)) +.PHONY: micro-build +micro-build: $(patsubst micro/%.d,$O/bin/%,$(wildcard micro/*.d)) + +.PRECIOUS: $O/bin/% +$O/bin/%: $O/micro/%.o + $(P_DC) $(DC) $(LDFLAGS) -of$@ $^ -.PHONY: micro -micro: $(patsubst %.d,$O/%.eps,$(wildcard micro/*.d)) +.PHONY: micro-stats +micro-stats: $(patsubst micro/%.d,$O/stats/%.eps,$(wildcard micro/*.d)) # special command line arguments 'split' micro benchmark $O/micro/split.c.csv $O/micro/split.a.csv: override args := micro/bible.txt +# dil +###### + +DIL_SRC = $(wildcard dil/src/*.d dil/src/cmd/*.d dil/src/util/*.d \ + dil/src/dil/*.d dil/src/dil/*/*.d) + +.PHONY: dil-nop-stats +dil-nop-stats: $O/stats/dil-nop.eps + +.PHONY: dil-build +dil-build: $O/bin/dil +$O/bin/dil: override DFLAGS += -Idil/src +$O/bin/dil: $(patsubst %.d,$O/%.o,$(DIL_SRC)) $(LIBTANGO) + $(P_DC) $(DC) $(LDFLAGS) -L-lmpfr -L-lgmp -of$@ $^ + +$O/bin/dil-nop: $O/bin/dil + @$(P_LN) $(LN) -sf $( $@ -.PRECIOUS: $O/%.tics -$O/%.tics: $O/%.h.csv tics.awk +.PRECIOUS: $O/stats/%.tics +$O/stats/%.tics: $O/stats/%.h.csv tics.awk $(P_AWK) awk -F, -f $(lastword $^) $< > $@ -$O/%.eps: $O/%.c.csv $O/%.a.csv $O/%.h.csv $O/%.tics plot.gpi - $(P_PLOT) sed "s|@@PRG@@|$(*F)|g; s|@@COL@@|$(VERS)|g; \ +$O/stats/%.eps: $O/stats/%.c.csv $O/stats/%.a.csv $O/stats/%.h.csv \ + $O/stats/%.tics plot.gpi + $(P_PLOT) sed "s|@@PRG@@|$(*F)|g; s|@@COL@@|$(GC)|g; \ s|@@INC@@|$(word 1,$^)|g; s|@@INA@@|$(word 2,$^)|g; \ s|@@INH@@|$(word 3,$^)|g; s|@@OUT@@|$@|g; \ s|@@TICS@@|$(shell cat $(word 4,$^))|g" $(word 5,$^) \ @@ -84,3 +110,10 @@ $O/%.eps: $O/%.c.csv $O/%.a.csv $O/%.h.csv $O/%.tics plot.gpi clean: $O/ $(P_RM) $(RM) -r $^ +.PHONY: clean-all +clean-all: clean-cdgc clean-basic +clean-cdgc: + $(P_MAKE) $(MAKE) --no-print-directory clean GC=cdgc +clean-basic: + $(P_MAKE) $(MAKE) --no-print-directory clean GC=basic +