diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | makefile | 58 |
2 files changed, 59 insertions, 0 deletions
@@ -1,6 +1,7 @@ # git ls-files --others --exclude-from=.git/info/exclude * !.gitignore +!makefile !*.d !*.rl !*.org diff --git a/makefile b/makefile new file mode 100644 index 0000000..54a1a73 --- /dev/null +++ b/makefile @@ -0,0 +1,58 @@ +# dmd +DMD=dmd +DMD_FLAGS=-de -w +DMD_FLAGS_DEBUG=-unittest -debug=checkdoc -debug=summary +DMD_FLAGS_RELEASE=-release +DMD_FLAG_BINOF=-of= +# ldc2 +LDC=ldc2 +LDC_FLAGS=-w +LDC_FLAGS_DEBUG=-unittest -d-debug=checkdoc -d-debug=summary +LDC_FLAGS_RELEASE=-release +LDC_FLAG_BINOF=-of= +# gdc +GDC=gdc +GDC_FLAGS= +GDC_FLAGS_DEBUG=-d-debug=checkdoc -d-debug=summary +GDC_FLAGS_RELEASE=-release +GDC_FLAG_BINOF=-o +# D compiler +D_COMPILER=LDC +DC=$($(D_COMPILER)) +DC_FLAGS=$($(shell echo $(D_COMPILER)_FLAGS)) +DC_FLAGS_DEBUG=$($(shell echo $(D_COMPILER)_FLAGS_DEBUG)) +DC_FLAGS_RELEASE=$($(shell echo $(D_COMPILER)_FLAGS_RELEASE)) +DC_FLAG_BINOF=$($(shell echo $(D_COMPILER)_FLAG_BINOF)) +PRG_NAME=sdp +PRG_SRC=$(PRG_NAME).d +PRG_SRCDIR=./lib/$(PRG_NAME) +PRG_BIN=$(PRG_NAME) +PRG_BINDIR=bin + +all: build + +build: $(PRG_SRCDIR)/$(PRG_SRC) + $(DC) $(DC_FLAGS) \ + $(DC_FLAG_BINOF)$(PRG_BINDIR)/$(PRG_BIN) \ + $(PRG_SRCDIR)/$(PRG_SRC) + +rebuild: $(PRG_SRCDIR)/$(PRG_SRC) $(PRG_BINDIR)/$(PRG_BIN).o clean build + +debug: $(PRG_SRCDIR)/$(PRG_SRC) + $(DC) $(DC_FLAGS) $(DC_FLAGS_DEBUG) \ + $(DC_FLAG_BINOF)$(PRG_BINDIR)/$(PRG_BIN) \ + $(PRG_SRCDIR)/$(PRG_SRC) + +release: $(PRG_SRCDIR)/$(PRG_SRC) + $(DC) $(DC_FLAGS) $(DC_FLAGS_RELEASE) \ + $(DC_FLAG_BINOF)$(PRG_BINDIR)/$(PRG_BIN) \ + $(PRG_SRCDIR)/$(PRG_SRC) + +clean: $(PRG_BINDIR)/$(PRG_BIN).o + rm $(PRG_BINDIR)/$(PRG_NAME).o + +distclean: $(PRG_BINDIR) + rm -rf $(PRG_BINDIR) + +.PHONY : all build rebuild debug release \ + clean distclean |