Skip to content

Instantly share code, notes, and snippets.

@9rnsr
Created June 24, 2011 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 9rnsr/1045205 to your computer and use it in GitHub Desktop.
Save 9rnsr/1045205 to your computer and use it in GitHub Desktop.
D programming language build makefile in Windows
# reqire DigitalMars make, and cp command in MSYS.
######## MAKE PARAMETERS ########
#DMCDIR=c:\dm
#DMDDIR=c:\dmd2
## INTERNAL VARIABLES ##
DMC=$(DMCDIR)\bin\dmc.exe
DMD=$(DMDDIR)\windows\bin\dmd.exe
MAKEFILE=win32.mak
######## RULES ########
all: build-dmd build-lib
full: clean-dmd build-dmd clean-lib build-lib
clean: clean-dmd clean-lib
#install: install-dmd install-lib
######## SUB-RULES ########
## dmd ##
dmd: build-dmd
fulldmd: clean-dmd build-dmd
clean-dmd:
cd dmd\src
make clean -f $(MAKEFILE)
cd ..\..
build-dmd:
cd dmd\src
make dmd SCROOT=$(DMCDIR) -f $(MAKEFILE)
copy dmd.exe $(DMDDIR)\windows\bin\
cd ..\..
## lib = druntime + phobos ##
lib: build-lib
fulllib: clean-lib build-lib
clean-lib: clean-druntime clean-phobos
build-lib: build-druntime build-phobos
clean-druntime:
cd druntime
make clean -f $(MAKEFILE)
cd ..
clean-phobos:
cd phobos
make clean -f $(MAKEFILE)
cd ..
build-druntime:
cd druntime
make CC=$(DMC) DMD=$(DMD) -f $(MAKEFILE)
copy lib\gcstub.obj $(DMDDIR)\windows\lib
cd ..
build-phobos:
cd phobos
make CC=$(DMC) DMD=$(DMD) -f $(MAKEFILE)
copy phobos.lib $(DMDDIR)\windows\lib\
cd ..
## document ##
gendoc:
cd phobos
make html DOC=..\html\d\phobos DMD=$(DMD) -f $(MAKEFILE)
cd ..
## test ##
test: libtest dmdtest
dmdtest:
cd dmd\test
c:\cygwin\bin\make
cd ..\..
libtest: druntimetest phobostest
druntimetest:
cd druntime
#make unittest -f win32.mak
cd ..
phobostest:
cd phobos
make unittest -f win32.mak
cd ..
######## UNUSED ########
checkout: checkout-dmd checkout-druntime checkout-phobos checkout-docsrc
checkout-dmd:
git clone git://github.com/D-Programming-Language/dmd.git dmd
checkout-druntime:
git clone git://github.com/D-Programming-Language/druntime.git druntime
checkout-phobos:
git clone git://github.com/D-Programming-Language/phobos.git phobos
checkout-docsrc:
git clone git://github.com/D-Programming-Language/d-programming-language.org.git docsrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment