]> git.llucax.com Git - software/dgc/dgcbench.git/commitdiff
Move Makefile to the top-level directory
authorLeandro Lucarella <llucax@gmail.com>
Thu, 27 Aug 2009 18:08:22 +0000 (15:08 -0300)
committerLeandro Lucarella <llucax@gmail.com>
Thu, 27 Aug 2009 18:08:22 +0000 (15:08 -0300)
This is to prepare the terrain to add real programs benchmarks, like Dil.

.gitignore [new file with mode: 0644]
Makefile [new file with mode: 0644]
dmd.conf [new file with mode: 0644]
hist.awk [moved from micro/hist.awk with 100% similarity]
micro/Makefile [deleted file]
micro/dmd.conf [deleted file]
plot.gpi [moved from micro/plot.gpi with 100% similarity]
tics.awk [moved from micro/tics.awk with 100% similarity]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..859f8bd
--- /dev/null
@@ -0,0 +1 @@
+naive
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..ca678cf
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,79 @@
+
+VERS    := naive
+DC      := dmd
+DL      := dmd
+GNUPLOT := gnuplot
+DFLAGS  += -release -inline -O
+DFLAGS  += -defaultlib=tango-base-dmd-$(VERS) -debuglib=tango-base-dmd-$(VERS) \
+               -L-ltango-user-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_AWK  = @printf '   AWK   %- 40s <-  %s\n' '$@' '$<';
+P_RUN  = @printf '   RUN   $< $(args)\n';
+P_MAKE = @printf '   MAKE  $@\n';
+P_RM   = @printf '   RM    $^\n';
+endif
+
+# create build directories if they don't already exist
+ifneq ($(wildcard $O),$O)
+dummy_mkdir := $(shell mkdir -p $O)
+endif
+
+# don't use Gold with old DMDs
+ifneq ($(shell ld --version | grep gold),)
+export LD_ := /usr/bin/ld.single
+endif
+
+.PHONY: all
+all: naive
+
+.PHONY: naive basic
+naive basic:
+       $(P_MAKE) $(MAKE) --no-print-directory micro VERS=$@
+
+$O/%: $O/%.o
+       $(P_LD) $(DC) $(DFLAGS) -of$@ $^
+
+$O/%.o: %.d
+       $(P_DC) $(DC) $(DFLAGS) -c -of$@ $<
+
+.PRECIOUS: $O/%.c.csv $O/%.a.csv
+$O/%.c.csv $O/%.a.csv: $O/%
+       $(P_RUN) ./$< $(args)
+       $P mv gc-collections.csv $O/$*.c.csv
+       $P mv gc-mallocs.csv $O/$*.a.csv
+
+# special command line arguments for benchmarks
+$O/micro/split.c.csv $O/micro/split.a.csv: override args := micro/bible.txt
+
+.PRECIOUS: $O/%.h.csv
+$O/%.h.csv: $O/%.a.csv hist.awk
+       $(P_AWK) awk -F, -f $(lastword $^) $< > $@
+
+.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
+       $(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; \
+                       s|@@TICS@@|$(shell cat $(word 4,$^))|g" $(word 5,$^) \
+               | $(GNUPLOT)
+
+.PHONY: clean
+clean: $O/
+       $(P_RM) $(RM) -r $^
+
diff --git a/dmd.conf b/dmd.conf
new file mode 100644 (file)
index 0000000..4fcf994
--- /dev/null
+++ b/dmd.conf
@@ -0,0 +1,4 @@
+[Environment]
+
+DFLAGS=-I%@P%/../dmd/include -L-L%@P%/../dmd/linux/lib -version=Tango
+
similarity index 100%
rename from micro/hist.awk
rename to hist.awk
diff --git a/micro/Makefile b/micro/Makefile
deleted file mode 100644 (file)
index b234261..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-
-VERS    := naive
-DC      := dmd
-DL      := dmd
-GNUPLOT := gnuplot
-DFLAGS  += -release -inline -O
-DFLAGS  += -defaultlib=tango-base-dmd-$(VERS) -debuglib=tango-base-dmd-$(VERS) \
-               -L-ltango-user-dmd-$(VERS)
-
-BUILD_DIR := $(VERS)
-BIN_DIR   := $(BUILD_DIR)/bin
-STAT_DIR  := $(BUILD_DIR)/stat
-PLOT_DIR  := $(BUILD_DIR)/plot
-DIRS      := $(BIN_DIR) $(STAT_DIR) $(PLOT_DIR)
-
-sources  := $(wildcard *.d)
-programs := $(addprefix $(BIN_DIR)/,$(sources:.d=))
-stat_c   := $(addprefix $(STAT_DIR)/,$(addsuffix .c.csv,$(sources:.d=)))
-stat_a   := $(addprefix $(STAT_DIR)/,$(addsuffix .a.csv,$(sources:.d=)))
-stat_h   := $(addprefix $(STAT_DIR)/,$(addsuffix .h.csv,$(sources:.d=)))
-stat     := $(stat_c) $(stat_a) $(stat_h)
-graphs_c := $(addprefix $(PLOT_DIR)/,$(addsuffix .eps,$(sources:.d=)))
-graphs   := $(graphs_c)
-
-
-ifndef V
-P      = @
-P_DC   = @echo '  DC   $@';
-P_LD   = @echo '  LD   $@';
-P_PLOT = @echo '  PLOT $@';
-P_MAKE = @echo '  MAKE $@';
-P_RUN  = @echo '  RUN  $< $(arg1) $(arg2) $(arg3)';
-P_AWK  = @echo '  AWK  $@';
-endif
-
-# create build directories if they don't already exist
-ifneq ($(wildcard $(DIRS)),$(DIRS))
-dummy_mkdir := $(shell mkdir -p $(DIRS))
-endif
-
-# don't use Gold with old DMDs
-ifneq ($(shell ld --version | grep gold),)
-export LD_ := /usr/bin/ld.single
-endif
-
-.PHONY: all
-all: basic naive
-
-.PHONY: naive basic
-naive basic:
-       $(P_MAKE) $(MAKE) --no-print-directory build VERS=$@
-
-.PHONY: build
-build: $(programs)
-
-$(BIN_DIR)/%: $(BIN_DIR)/%.o
-       $(P_LD) $(DC) $(DFLAGS) -of$@ $^
-
-$(BIN_DIR)/%.o: %.d
-       $(P_DC) $(DC) $(DFLAGS) -c -of$@ $<
-
-.PHONY: stat
-stat: $(stat)
-
-.PRECIOUS: $(STAT_DIR)/%.c.csv $(STAT_DIR)/%.a.csv
-$(STAT_DIR)/%.c.csv $(STAT_DIR)/%.a.csv: $(BIN_DIR)/%
-       $(P_RUN) ./$< $(args)
-       $P mv gc-collections.csv $(STAT_DIR)/$*.c.csv
-       $P mv gc-mallocs.csv $(STAT_DIR)/$*.a.csv
-
-# special command line arguments for benchmarks
-$(STAT_DIR)/split.c.csv $(STAT_DIR)/split.a.csv: override args := bible.txt
-
-.PRECIOUS: $(STAT_DIR)/%.h.csv
-$(STAT_DIR)/%.h.csv: $(STAT_DIR)/%.a.csv hist.awk
-       $(P_AWK) awk -F, -f $(lastword $^) $< > $@
-
-.PHONY: plot
-plot: $(graphs)
-
-.PRECIOUS: $(PLOT_DIR)/%.tics
-$(PLOT_DIR)/%.tics: $(STAT_DIR)/%.h.csv tics.awk
-       $(P_AWK) awk -F, -f $(lastword $^) $< > $@
-
-$(PLOT_DIR)/%.eps: $(STAT_DIR)/%.c.csv $(STAT_DIR)/%.a.csv \
-                       $(STAT_DIR)/%.h.csv $(PLOT_DIR)/%.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; \
-                       s|@@TICS@@|$(shell cat $(word 4,$^))|g" $(word 5,$^) \
-               | $(GNUPLOT)
-
-.PHONY: clean
-clean:
-       $(RM) -r $(BUILD_DIR)
-
diff --git a/micro/dmd.conf b/micro/dmd.conf
deleted file mode 100644 (file)
index 7b522e9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-[Environment]
-
-DFLAGS=-I%@P%/../../dmd/include -L-L%@P%/../../dmd/linux/lib -version=Tango
-
similarity index 100%
rename from micro/plot.gpi
rename to plot.gpi
similarity index 100%
rename from micro/tics.awk
rename to tics.awk