From 1a2600200a7d346dcc3419432bf63b6b4080ff24 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 4 Oct 2015 19:08:36 -0400 Subject: keep a makefile during development --- makefile | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 makefile (limited to 'makefile') 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 -- cgit v1.2.3