X-Git-Url: https://git.llucax.com/software/dgc/dgcbench.git/blobdiff_plain/205f85e112c3611d888e5d56edb6e4e5b64a71ae..191a743bdcb087277284437dc57c32ea8f6cc993:/Makefile?ds=inline diff --git a/Makefile b/Makefile index ca678cf..232eb7c 100644 --- a/Makefile +++ b/Makefile @@ -2,24 +2,24 @@ VERS := naive DC := dmd DL := dmd +LN := ln GNUPLOT := gnuplot -DFLAGS += -release -inline -O -DFLAGS += -defaultlib=tango-base-dmd-$(VERS) -debuglib=tango-base-dmd-$(VERS) \ - -L-ltango-user-dmd-$(VERS) +DFLAGS += -g -release -inline -O +#DFLAGS := -gc +DFLAGS += -defaultlib=tango-base-dmd-$(VERS) -debuglib=tango-base-dmd-$(VERS) O := $(VERS) -micro_src := $(wildcard micro/*.d) - ifndef V P = @ -P_DC = @printf ' DC %- 40s <- %s\n' '$@' '$<'; -P_LD = @printf ' LD %- 40s <- %s\n' '$@' '$^'; -P_PLOT = @printf ' PLOT %- 40s <- %s\n' '$@' '$< ...'; +P_DC = @printf ' DC %- 40s <- %s\n' '$@' '$(if \ + $(subst 1,,$(words $^)),$< ... $(lastword $^),$<)'; +P_PLOT = @printf ' PLOT %- 40s <- %s\n' '$@' '$(filter %.csv,$^)'; 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 @@ -28,45 +28,69 @@ dummy_mkdir := $(shell mkdir -p $O) endif # don't use Gold with old DMDs -ifneq ($(shell ld --version | grep gold),) +ifeq ($(subst dmd,,$(DC)),) +ifneq ($(strip $(shell ld --version | grep gold)),) export LD_ := /usr/bin/ld.single endif +endif .PHONY: all all: naive .PHONY: naive basic naive basic: - $(P_MAKE) $(MAKE) --no-print-directory micro VERS=$@ + $(P_MAKE) $(MAKE) --no-print-directory micro dil VERS=$@ + + +# micro +######## + +.PHONY: build-micro +build-micro: $(patsubst %.d,$O/%,$(wildcard micro/*.d)) + +.PHONY: micro +micro: $(patsubst %.d,$O/%.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 + -$O/%: $O/%.o - $(P_LD) $(DC) $(DFLAGS) -of$@ $^ +# dil +###### -$O/%.o: %.d - $(P_DC) $(DC) $(DFLAGS) -c -of$@ $< +.PHONY: dil +dil: $O/dil_nop.eps + +$O/dil: $(wildcard dil/src/*.d dil/src/cmd/*.d dil/src/util/*.d \ + dil/src/dil/*.d dil/src/dil/*/*.d) + $(P_DC) $(DC) $(DFLAGS) -L-lmpfr -Idil/src -of$@ $^ + +$O/dil_nop: $O/dil + @$(P_LN) $(LN) -sf $( $@ -.PHONY: micro -micro: $(patsubst %.d,$O/%.eps,$(micro_src)) - .PRECIOUS: $O/%.tics $O/%.tics: $O/%.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 +$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; \ s|@@INC@@|$(word 1,$^)|g; s|@@INA@@|$(word 2,$^)|g; \ s|@@INH@@|$(word 3,$^)|g; s|@@OUT@@|$@|g; \