From 87dc0324ffd32c5a094ba2d1a42b10c6565470f3 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 5 Jul 2010 21:43:56 -0300 Subject: [PATCH] Update to work with current state of the project The naive collector is now gone, there are no statistics collection, etc. The object files and binaries are generated in separate directories now. The statistics graph generation is still there but not working, only building the benchmarks works, including dil, which is added as a submodule for simplicity (and keeping track of working version). --- .gitignore | 4 +-- .gitmodules | 3 ++ Makefile | 92 +++++++++++++++++++++++++++++++---------------------- dil | 1 + dmd.conf | 4 +-- 5 files changed, 61 insertions(+), 43 deletions(-) create mode 100644 .gitmodules create mode 160000 dil diff --git a/.gitignore b/.gitignore index c17a326..567609b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ -naive/ -basic/ -stub/ +build/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..88c03d2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "dil"] + path = dil + url = git://github.com/azizk/dil.git diff --git a/Makefile b/Makefile index 232eb7c..2ba5804 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,13 @@ -VERS := naive -DC := dmd -DL := dmd -LN := ln -GNUPLOT := gnuplot -DFLAGS += -g -release -inline -O -#DFLAGS := -gc -DFLAGS += -defaultlib=tango-base-dmd-$(VERS) -debuglib=tango-base-dmd-$(VERS) - -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 = @ @@ -24,7 +23,7 @@ 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 @@ -35,21 +34,25 @@ endif endif .PHONY: all -all: naive +all: cdgc basic -.PHONY: naive basic -naive basic: - $(P_MAKE) $(MAKE) --no-print-directory micro dil 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 @@ -58,40 +61,46 @@ $O/micro/split.c.csv $O/micro/split.a.csv: override args := micro/bible.txt # dil ###### -.PHONY: dil -dil: $O/dil_nop.eps - -$O/dil: $(wildcard dil/src/*.d dil/src/cmd/*.d dil/src/util/*.d \ +DIL_SRC = $(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 +.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,$^) \ @@ -101,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 + diff --git a/dil b/dil new file mode 160000 index 0000000..4d431fe --- /dev/null +++ b/dil @@ -0,0 +1 @@ +Subproject commit 4d431feda23853da6c9a1ae93980d0e01605c6bc diff --git a/dmd.conf b/dmd.conf index 2f7dc30..19fcd9f 100644 --- a/dmd.conf +++ b/dmd.conf @@ -1,5 +1,5 @@ [Environment] -DFLAGS=-I%@P%/../dmd/include -L-L%@P%/../dmd/linux/lib -version=Tango -L-ltango-user-dmd -#DFLAGS=-I%@P%/../dmd/include -L-L%@P%/../dmd/linux/lib -version=Tango -L-ltango-user-dmd-debug +# -defaultlib and -debuglib are set in the Makefile, according to the GC to use +DFLAGS=-I../include -L-L../lib -version=Tango -- 2.43.0