From: sean Date: Thu, 20 Nov 2008 22:49:32 +0000 (+0000) Subject: * Auto type determination was broken in some unit tests. This has been fixed. X-Git-Url: https://git.llucax.com/software/druntime.git/commitdiff_plain/14babdacbde141401ef82ccced25e24ec201344b * Auto type determination was broken in some unit tests. This has been fixed. * The following new build options have been added: - release (default) - debug - unittest * Debug libraries are now generated by the build-dmd scripts and have a "-d" appended to their name. These libraries have both "-g" and "-debug" set to enable asserts and symbol info. * Added unittest.d to run unit tests. * Added test-dmd.bat to build and run unit tests on Win32. A problem currently exists with this feature, and once it has been resolved a test-dmd.sh will be added as well. git-svn-id: http://svn.dsource.org/projects/druntime/trunk@47 4a9d5153-6564-4b3f-b5e1-7e8e9dac548f --- diff --git a/src/build-dmd.bat b/src/build-dmd.bat index d2c0b98..d16d4bb 100644 --- a/src/build-dmd.bat +++ b/src/build-dmd.bat @@ -2,6 +2,8 @@ set OLDHOME=%HOME% set HOME=%CD% make clean -fdmd-win32.mak -make lib install -fdmd-win32.mak +make release install -fdmd-win32.mak +make clean -fdmd-win32.mak +make debug install -fdmd-win32.mak make clean -fdmd-win32.mak set HOME=%OLDHOME% \ No newline at end of file diff --git a/src/common/posix.mak b/src/common/posix.mak index edc5c99..6653e0e 100644 --- a/src/common/posix.mak +++ b/src/common/posix.mak @@ -10,8 +10,10 @@ # make clean # Delete unneeded files created by build process -LIB_TARGET=libdruntime-core.a -LIB_MASK=libdruntime-core*.a +LIB_BASE=libdruntime-core +LIB_BUILD= +LIB_TARGET=$(LIB_BASE)$(LIB_BUILD).a +LIB_MASK=$(LIB_BASE)*.a CP=cp -f RM=rm -f @@ -20,14 +22,17 @@ MD=mkdir -p ADD_CFLAGS= ADD_DFLAGS= -CFLAGS=-O $(ADD_CFLAGS) -#CFLAGS=-g $(ADD_CFLAGS) +CFLAGS_RELEASE=-O $(ADD_CFLAGS) +CFLAGS_DEBUG=-g $(ADD_CFLAGS) +CFLAGS=$(CFLAGS_RELEASE) -DFLAGS=-release -O -inline -w -nofloat $(ADD_DFLAGS) -#DFLAGS=-g -w -nofloat $(ADD_DFLAGS) +DFLAGS_RELEASE=-release -O -inline -w -nofloat $(ADD_DFLAGS) +DFLAGS_DEBUG=-debug -g -w -nofloat $(ADD_DFLAGS) +DFLAGS=$(DFLAGS_RELEASE) -TFLAGS=-O -inline -w -nofloat $(ADD_DFLAGS) -#TFLAGS=-g -w -nofloat $(ADD_DFLAGS) +TFLAGS_RELEASE=-O -inline -w -nofloat $(ADD_DFLAGS) +TFLAGS_DEBUG=-debug -g -w -nofloat $(ADD_DFLAGS) +TFLAGS=$(TFLAGS_RELEASE) DOCFLAGS=-version=DDoc @@ -91,11 +96,23 @@ DOC_CORE= \ core/runtime.html \ core/thread.html +###################################################### ALL_DOCS= ###################################################### +unittest : + make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE) -unittest" + +release : + make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE)" + +debug : + make -fposix.mak DC="$(DC)" LIB_BUILD="-d" DFLAGS="$(DFLAGS_DEBUG)" + +###################################################### + core.lib : $(LIB_TARGET) $(LIB_TARGET) : $(ALL_OBJS) diff --git a/src/common/win32.mak b/src/common/win32.mak index 7e23e7a..4554680 100644 --- a/src/common/win32.mak +++ b/src/common/win32.mak @@ -10,8 +10,10 @@ # make clean # Delete unneeded files created by build process -LIB_TARGET=druntime-core.lib -LIB_MASK=druntime-core*.lib +LIB_BASE=druntime-core +LIB_BUILD= +LIB_TARGET=$(LIB_BASE)$(LIB_BUILD).lib +LIB_MASK=$(LIB_BASE)*.lib CP=xcopy /y RM=del /f @@ -20,14 +22,17 @@ MD=mkdir ADD_CFLAGS= ADD_DFLAGS= -CFLAGS=-mn -6 -r $(ADD_CFLAGS) -#CFLAGS=-g -mn -6 -r $(ADD_CFLAGS) +CFLAGS_RELEASE=-mn -6 -r $(ADD_CFLAGS) +CFLAGS_DEBUG=-D -g -mn -6 -r $(ADD_CFLAGS) +CFLAGS=$(CFLAGS_RELEASE) -DFLAGS=-release -O -inline -w -nofloat $(ADD_DFLAGS) -#DFLAGS=-g -w -nofloat $(ADD_DFLAGS) +DFLAGS_RELEASE=-release -O -inline -w -nofloat $(ADD_DFLAGS) +DFLAGS_DEBUG=-debug -g -w -nofloat $(ADD_DFLAGS) +DFLAGS=$(DFLAGS_RELEASE) -TFLAGS=-O -inline -w -nofloat $(ADD_DFLAGS) -#TFLAGS=-g -w -nofloat $(ADD_DFLAGS) +TFLAGS_RELEASE=-O -inline -w -nofloat $(ADD_DFLAGS) +TFLAGS_DEBUG=-debug -g -w -nofloat $(ADD_DFLAGS) +TFLAGS=$(TFLAGS_RELEASE) DOCFLAGS=-version=DDoc @@ -88,10 +93,23 @@ DOC_CORE= \ core\runtime.html \ core\thread.html +###################################################### + ALL_DOCS= ###################################################### +unittest : + make -fwin32.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE) -unittest" + +release : + make -fwin32.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE)" + +debug : + make -fwin32.mak DC="$(DC)" LIB_BUILD="-d" DFLAGS="$(DFLAGS_DEBUG)" + +###################################################### + core.lib : $(LIB_TARGET) $(LIB_TARGET) : $(ALL_OBJS) diff --git a/src/compiler/dmd/aApplyR.d b/src/compiler/dmd/aApplyR.d index 081ae60..7c23285 100644 --- a/src/compiler/dmd/aApplyR.d +++ b/src/compiler/dmd/aApplyR.d @@ -80,7 +80,7 @@ unittest { debug(apply) printf("_aApplyRcd1.unittest\n"); - auto s = "hello"c; + auto s = "hello"c[]; int i; foreach_reverse(dchar d; s) @@ -144,7 +144,7 @@ unittest { debug(apply) printf("_aApplyRwd1.unittest\n"); - auto s = "hello"w; + auto s = "hello"w[]; int i; foreach_reverse(dchar d; s) @@ -230,7 +230,7 @@ unittest { debug(apply) printf("_aApplyRcw1.unittest\n"); - auto s = "hello"c; + auto s = "hello"c[]; int i; foreach_reverse(wchar d; s) @@ -311,7 +311,7 @@ unittest { debug(apply) printf("_aApplyRwc1.unittest\n"); - auto s = "hello"w; + auto s = "hello"w[]; int i; foreach_reverse(char d; s) @@ -390,7 +390,7 @@ unittest { debug(apply) printf("_aApplyRdc1.unittest\n"); - auto s = "hello"d; + auto s = "hello"d[]; int i; foreach_reverse(char d; s) @@ -462,7 +462,7 @@ unittest { debug(apply) printf("_aApplyRdw1.unittest\n"); - auto s = "hello"d; + auto s = "hello"d[]; int i; foreach_reverse(wchar d; s) @@ -544,7 +544,7 @@ unittest { debug(apply) printf("_aApplyRcd2.unittest\n"); - auto s = "hello"c; + auto s = "hello"c[]; int i; foreach_reverse(k, dchar d; s) @@ -609,7 +609,7 @@ unittest { debug(apply) printf("_aApplyRwd2.unittest\n"); - auto s = "hello"w; + auto s = "hello"w[]; int i; foreach_reverse(k, dchar d; s) @@ -697,7 +697,7 @@ unittest { debug(apply) printf("_aApplyRcw2.unittest\n"); - auto s = "hello"c; + auto s = "hello"c[]; int i; foreach_reverse(k, wchar d; s) @@ -780,7 +780,7 @@ unittest { debug(apply) printf("_aApplyRwc2.unittest\n"); - auto s = "hello"w; + auto s = "hello"w[]; int i; foreach_reverse(k, char d; s) @@ -860,7 +860,7 @@ unittest { debug(apply) printf("_aApplyRdc2.unittest\n"); - auto s = "hello"d; + auto s = "hello"d[]; int i; foreach_reverse(k, char d; s) @@ -934,7 +934,7 @@ unittest { debug(apply) printf("_aApplyRdw2.unittest\n"); - auto s = "hello"d; + auto s = "hello"d[]; int i; foreach_reverse(k, wchar d; s) diff --git a/src/compiler/dmd/adi.d b/src/compiler/dmd/adi.d index 0253bc0..caafd29 100644 --- a/src/compiler/dmd/adi.d +++ b/src/compiler/dmd/adi.d @@ -134,7 +134,7 @@ extern (C) long _adReverseChar(char[] a) unittest { - auto a = "abcd"c; + auto a = "abcd"c[]; auto r = a.dup.reverse; //writefln(r); diff --git a/src/compiler/dmd/arraybyte.d b/src/compiler/dmd/arraybyte.d index 373dec4..4aa754b 100644 --- a/src/compiler/dmd/arraybyte.d +++ b/src/compiler/dmd/arraybyte.d @@ -13,8 +13,9 @@ module rt.arraybyte; import util.cpuid; -version (Unittest) +version (unittest) { + private import core.stdc.stdio : printf; /* This is so unit tests will test every CPU variant */ int cpuid; diff --git a/src/compiler/dmd/arraydouble.d b/src/compiler/dmd/arraydouble.d index c7c7504..12f9047 100644 --- a/src/compiler/dmd/arraydouble.d +++ b/src/compiler/dmd/arraydouble.d @@ -9,8 +9,9 @@ module rt.arraydouble; private import util.cpuid; -version (Unittest) +version (unittest) { + private import core.stdc.stdio : printf; /* This is so unit tests will test every CPU variant */ int cpuid; diff --git a/src/compiler/dmd/arrayfloat.d b/src/compiler/dmd/arrayfloat.d index f5588e8..949fd55 100644 --- a/src/compiler/dmd/arrayfloat.d +++ b/src/compiler/dmd/arrayfloat.d @@ -9,8 +9,9 @@ module rt.arrayfloat; private import util.cpuid; -version (Unittest) +version (unittest) { + private import core.stdc.stdio : printf; /* This is so unit tests will test every CPU variant */ int cpuid; diff --git a/src/compiler/dmd/arrayint.d b/src/compiler/dmd/arrayint.d index c4f0892..0c19523 100644 --- a/src/compiler/dmd/arrayint.d +++ b/src/compiler/dmd/arrayint.d @@ -13,8 +13,9 @@ module rt.arrayint; private import util.cpuid; -version (Unittest) +version (unittest) { + private import core.stdc.stdio : printf; /* This is so unit tests will test every CPU variant */ int cpuid; diff --git a/src/compiler/dmd/arrayreal.d b/src/compiler/dmd/arrayreal.d index 2dda218..3782c44 100644 --- a/src/compiler/dmd/arrayreal.d +++ b/src/compiler/dmd/arrayreal.d @@ -8,8 +8,9 @@ module rt.arrayreal; import util.cpuid; -version (Unittest) +version (unittest) { + private import core.stdc.stdio : printf; /* This is so unit tests will test every CPU variant */ int cpuid; diff --git a/src/compiler/dmd/arrayshort.d b/src/compiler/dmd/arrayshort.d index 0208d89..142de6c 100644 --- a/src/compiler/dmd/arrayshort.d +++ b/src/compiler/dmd/arrayshort.d @@ -13,8 +13,9 @@ module rt.arrayshort; private import util.cpuid; -version (Unittest) +version (unittest) { + private import core.stdc.stdio : printf; /* This is so unit tests will test every CPU variant */ int cpuid; diff --git a/src/compiler/dmd/posix.mak b/src/compiler/dmd/posix.mak index bcc6132..9ca608d 100644 --- a/src/compiler/dmd/posix.mak +++ b/src/compiler/dmd/posix.mak @@ -10,21 +10,29 @@ # make clean # Delete unneeded files created by build process -LIB_TARGET=libdruntime-rt-dmd.a -LIB_MASK=libdruntime-rt-dmd*.a +LIB_BASE=libdruntime-rt-dmd +LIB_BUILD= +LIB_TARGET=$(LIB_BASE)$(LIB_BUILD).a +LIB_MASK=$(LIB_BASE)*.a CP=cp -f RM=rm -f MD=mkdir -p -CFLAGS=-O $(ADD_CFLAGS) -#CFLAGS=-g $(ADD_CFLAGS) +ADD_CFLAGS= +ADD_DFLAGS= -DFLAGS=-release -O -inline -w -nofloat $(ADD_DFLAGS) -#DFLAGS=-g -w -nofloat $(ADD_DFLAGS) +CFLAGS_RELEASE=-O $(ADD_CFLAGS) +CFLAGS_DEBUG=-g $(ADD_CFLAGS) +CFLAGS=$(CFLAGS_RELEASE) -TFLAGS=-O -inline -w -nofloat $(ADD_DFLAGS) -#TFLAGS=-g -w -nofloat $(ADD_DFLAGS) +DFLAGS_RELEASE=-release -O -inline -w -nofloat $(ADD_DFLAGS) +DFLAGS_DEBUG=-debug -g -w -nofloat $(ADD_DFLAGS) +DFLAGS=$(DFLAGS_RELEASE) + +TFLAGS_RELEASE=-O -inline -w -nofloat $(ADD_DFLAGS) +TFLAGS_DEBUG=-debug -g -w -nofloat $(ADD_DFLAGS) +TFLAGS=$(TFLAGS_RELEASE) DOCFLAGS=-version=DDoc @@ -156,6 +164,17 @@ ALL_DOCS= ###################################################### +unittest : + make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE) -unittest" + +release : + make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE)" + +debug : + make -fposix.mak DC="$(DC)" LIB_BUILD="-d" DFLAGS="$(DFLAGS_DEBUG)" + +###################################################### + dmd.lib : $(LIB_TARGET) $(LIB_TARGET) : $(ALL_OBJS) diff --git a/src/compiler/dmd/util/utf.d b/src/compiler/dmd/util/utf.d index 012d7c3..552ab34 100644 --- a/src/compiler/dmd/util/utf.d +++ b/src/compiler/dmd/util/utf.d @@ -334,7 +334,7 @@ unittest assert(i == 3); static s4 = - [ "\xE2\x89"c, // too short + [ "\xE2\x89"c[], // too short "\xC0\x8A", "\xE0\x80\x8A", "\xF0\x80\x80\x8A", @@ -863,7 +863,7 @@ unittest { debug(utf) printf("utf.toUTF.unittest\n"); - auto c = "hello"c; + auto c = "hello"c[]; auto w = toUTF16(c); assert(w == "hello"); auto d = toUTF32(c); diff --git a/src/compiler/dmd/win32.mak b/src/compiler/dmd/win32.mak index 6343eb5..3694cd8 100644 --- a/src/compiler/dmd/win32.mak +++ b/src/compiler/dmd/win32.mak @@ -10,21 +10,29 @@ # make clean # Delete unneeded files created by build process -LIB_TARGET=druntime-rt-dmd.lib -LIB_MASK=druntime-rt-dmd*.lib +LIB_BASE=druntime-rt-dmd +LIB_BUILD= +LIB_TARGET=$(LIB_BASE)$(LIB_BUILD).lib +LIB_MASK=$(LIB_BASE)*.lib CP=xcopy /y RM=del /f MD=mkdir -CFLAGS=-mn -6 -r $(ADD_CFLAGS) -#CFLAGS=-g -mn -6 -r $(ADD_CFLAGS) +ADD_CFLAGS= +ADD_DFLAGS= -DFLAGS=-release -O -inline -w -nofloat $(ADD_DFLAGS) -#DFLAGS=-g -w -nofloat $(ADD_DFLAGS) +CFLAGS_RELEASE=-mn -6 -r $(ADD_CFLAGS) +CFLAGS_DEBUG=-D -g -mn -6 -r $(ADD_CFLAGS) +CFLAGS=$(CFLAGS_RELEASE) -TFLAGS=-O -inline -w -nofloat $(ADD_DFLAGS) -#TFLAGS=-g -w -nofloat $(ADD_DFLAGS) +DFLAGS_RELEASE=-release -O -inline -w -nofloat $(ADD_DFLAGS) +DFLAGS_DEBUG=-debug -g -w -nofloat $(ADD_DFLAGS) +DFLAGS=$(DFLAGS_RELEASE) + +TFLAGS_RELEASE=-O -inline -w -nofloat $(ADD_DFLAGS) +TFLAGS_DEBUG=-debug -g -w -nofloat $(ADD_DFLAGS) +TFLAGS=$(TFLAGS_RELEASE) DOCFLAGS=-version=DDoc @@ -149,6 +157,17 @@ ALL_DOCS= ###################################################### +unittest : + make -fwin32.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE) -unittest" + +release : + make -fwin32.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE)" + +debug : + make -fwin32.mak DC="$(DC)" LIB_BUILD="-d" DFLAGS="$(DFLAGS_DEBUG)" + +###################################################### + dmd.lib : $(LIB_TARGET) $(LIB_TARGET) : $(ALL_OBJS) diff --git a/src/dmd-posix.mak b/src/dmd-posix.mak index 6b567c8..0f56715 100644 --- a/src/dmd-posix.mak +++ b/src/dmd-posix.mak @@ -10,9 +10,13 @@ # make clean # Delete unneeded files created by build process -LIB_TARGET=libdruntime-dmd.a -DUP_TARGET=libdruntime.a -LIB_MASK=libdruntime*.a +LIB_BASE=libdruntime-dmd +LIB_BUILD= +LIB_TARGET=$(LIB_BASE)$(LIB_BUILD).a +LIB_MASK=$(LIB_BASE)*.a +DUP_TARGET=libdruntime$(LIB_BUILD).a +DUP_MASK=libdruntime*.a +MAKE_LIB=lib DIR_CC=common DIR_RT=compiler/dmd @@ -44,10 +48,24 @@ ALL_DOCS= ###################################################### +unittest : + make -fdmd-posix.mak lib MAKE_LIB="unittest" + dmd -unittest main ../import/core/stdc/stdarg -defaultlib="$(DUP_TARGET)" -debuglib="$(DUP_TARGET)" + $(RM) stdarg.o + main + +release : + make -fdmd-posix.mak lib MAKE_LIB="release" + +debug : + make -fdmd-posix.mak lib MAKE_LIB="debug" LIB_BUILD="-d" + +###################################################### + lib : $(ALL_OBJS) - make -C $(DIR_CC) -fposix.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" - make -C $(DIR_RT) -fposix.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" - make -C $(DIR_GC) -fposix.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" + make -C $(DIR_CC) -fposix.mak $(MAKE_LIB) DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" + make -C $(DIR_RT) -fposix.mak $(MAKE_LIB) DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" + make -C $(DIR_GC) -fposix.mak $(MAKE_LIB) DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" $(RM) $(LIB_TARGET) $(LC) $(LIB_TARGET) `find $(DIR_CC) -name "*.o" | xargs echo` $(LC) $(LIB_TARGET) `find $(DIR_RT) -name "*.o" | xargs echo` @@ -70,9 +88,12 @@ clean : make -C $(DIR_RT) -fposix.mak clean make -C $(DIR_GC) -fposix.mak clean $(RM) $(LIB_MASK) + $(RM) $(DUP_MASK) + $(RM) main main.o install : make -C $(DIR_CC) -fposix.mak install make -C $(DIR_RT) -fposix.mak install make -C $(DIR_GC) -fposix.mak install $(CP) $(LIB_MASK) $(LIB_DEST)/. + $(CP) $(DUP_MASK) $(LIB_DEST)/. diff --git a/src/dmd-win32.mak b/src/dmd-win32.mak index 2647819..f79f02f 100644 --- a/src/dmd-win32.mak +++ b/src/dmd-win32.mak @@ -10,18 +10,22 @@ # make clean # Delete unneeded files created by build process -LIB_TARGET=druntime-dmd.lib -DUP_TARGET=druntime.lib -LIB_MASK=druntime*.lib +LIB_BASE=druntime-dmd +LIB_BUILD= +LIB_TARGET=$(LIB_BASE)$(LIB_BUILD).lib +LIB_MASK=$(LIB_BASE)*.lib +DUP_TARGET=druntime$(LIB_BUILD).lib +DUP_MASK=druntime*.lib +MAKE_LIB=lib DIR_CC=common DIR_RT=compiler\dmd DIR_GC=gc\basic DIR_GC_STUB=gc\stub -LIB_CC=$(DIR_CC)\druntime-core.lib -LIB_RT=$(DIR_RT)\druntime-rt-dmd.lib -LIB_GC=$(DIR_GC)\druntime-gc-basic.lib +LIB_CC=$(DIR_CC)\druntime-core$(LIB_BUILD).lib +LIB_RT=$(DIR_RT)\druntime-rt-dmd$(LIB_BUILD).lib +LIB_GC=$(DIR_GC)\druntime-gc-basic$(LIB_BUILD).lib CP=xcopy /y RM=del /f @@ -49,18 +53,32 @@ ALL_DOCS= ###################################################### +unittest : + make -fdmd-win32.mak lib MAKE_LIB="unittest" + dmd -unittest main ..\import\core\stdc\stdarg -defaultlib="$(DUP_TARGET)" -debuglib="$(DUP_TARGET)" + $(RM) stdarg.obj + main + +release : + make -fdmd-win32.mak lib MAKE_LIB="release" + +debug : + make -fdmd-win32.mak lib MAKE_LIB="debug" LIB_BUILD="-d" + +###################################################### + lib : $(ALL_OBJS) cd $(DIR_CC) - make -fwin32.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" + make -fwin32.mak $(MAKE_LIB) DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" cd .. cd $(DIR_RT) - make -fwin32.mak lib DC=$(DC) + make -fwin32.mak $(MAKE_LIB) DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" cd ..\.. cd $(DIR_GC) - make -fwin32.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" + make -fwin32.mak $(MAKE_LIB) DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" cd ..\.. cd $(DIR_GC_STUB) - make -fwin32.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" + make -fwin32.mak $(MAKE_LIB) DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" cd ..\.. $(RM) $(LIB_TARGET) $(LC) -c -n $(LIB_TARGET) $(LIB_CC) $(LIB_RT) $(LIB_GC) @@ -101,6 +119,8 @@ clean : make -fwin32.mak clean cd ..\.. $(RM) $(LIB_MASK) + $(RM) $(DUP_MASK) + $(RM) main.exe main.obj main.map install : cd $(DIR_CC) @@ -116,3 +136,4 @@ install : make -fwin32.mak install cd ..\.. $(CP) $(LIB_MASK) $(LIB_DEST)\. + $(CP) $(DUP_MASK) $(LIB_DEST)\. diff --git a/src/gc/basic/posix.mak b/src/gc/basic/posix.mak index b4633f5..adf9942 100644 --- a/src/gc/basic/posix.mak +++ b/src/gc/basic/posix.mak @@ -10,8 +10,10 @@ # make clean # Delete unneeded files created by build process -LIB_TARGET=libdruntime-gc-basic.a -LIB_MASK=libdruntime-gc-basic*.a +LIB_BASE=libdruntime-gc-basic +LIB_BUILD= +LIB_TARGET=$(LIB_BASE)$(LIB_BUILD).a +LIB_MASK=$(LIB_BASE)*.a CP=cp -f RM=rm -f @@ -20,14 +22,17 @@ MD=mkdir -p ADD_CFLAGS= ADD_DFLAGS= -CFLAGS=-O $(ADD_CFLAGS) -#CFLAGS=-g $(ADD_CFLAGS) +CFLAGS_RELEASE=-O $(ADD_CFLAGS) +CFLAGS_DEBUG=-g $(ADD_CFLAGS) +CFLAGS=$(CFLAGS_RELEASE) -DFLAGS=-release -O -inline -w -nofloat $(ADD_DFLAGS) -#DFLAGS=-g -w -nofloat $(ADD_DFLAGS) +DFLAGS_RELEASE=-release -O -inline -w -nofloat $(ADD_DFLAGS) +DFLAGS_DEBUG=-debug -g -w -nofloat $(ADD_DFLAGS) +DFLAGS=$(DFLAGS_RELEASE) -TFLAGS=-O -inline -w -nofloat $(ADD_DFLAGS) -#TFLAGS=-g -w -nofloat $(ADD_DFLAGS) +TFLAGS_RELEASE=-O -inline -w -nofloat $(ADD_DFLAGS) +TFLAGS_DEBUG=-debug -g -w -nofloat $(ADD_DFLAGS) +TFLAGS=$(TFLAGS_RELEASE) DOCFLAGS=-version=DDoc @@ -78,6 +83,17 @@ ALL_DOCS= ###################################################### +unittest : + make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE) -unittest" + +release : + make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE)" + +debug : + make -fposix.mak DC="$(DC)" LIB_BUILD="-d" DFLAGS="$(DFLAGS_DEBUG)" + +###################################################### + basic.lib : $(LIB_TARGET) $(LIB_TARGET) : $(ALL_OBJS) diff --git a/src/gc/basic/win32.mak b/src/gc/basic/win32.mak index ba4d66e..ac81683 100644 --- a/src/gc/basic/win32.mak +++ b/src/gc/basic/win32.mak @@ -10,8 +10,10 @@ # make clean # Delete unneeded files created by build process -LIB_TARGET=druntime-gc-basic.lib -LIB_MASK=druntime-gc-basic*.lib +LIB_BASE=druntime-gc-basic +LIB_BUILD= +LIB_TARGET=$(LIB_BASE)$(LIB_BUILD).lib +LIB_MASK=$(LIB_BASE)*.lib CP=xcopy /y RM=del /f @@ -20,14 +22,17 @@ MD=mkdir ADD_CFLAGS= ADD_DFLAGS= -CFLAGS=-mn -6 -r $(ADD_CFLAGS) -#CFLAGS=-g -mn -6 -r $(ADD_CFLAGS) +CFLAGS_RELEASE=-mn -6 -r $(ADD_CFLAGS) +CFLAGS_DEBUG=-D -g -mn -6 -r $(ADD_CFLAGS) +CFLAGS=$(CFLAGS_RELEASE) -DFLAGS=-release -O -inline -w -nofloat $(ADD_DFLAGS) -#DFLAGS=-g -w -nofloat $(ADD_DFLAGS) +DFLAGS_RELEASE=-release -O -inline -w -nofloat $(ADD_DFLAGS) +DFLAGS_DEBUG=-debug -g -w -nofloat $(ADD_DFLAGS) +DFLAGS=$(DFLAGS_RELEASE) -TFLAGS=-O -inline -w -nofloat $(ADD_DFLAGS) -#TFLAGS=-g -w -nofloat $(ADD_DFLAGS) +TFLAGS_RELEASE=-O -inline -w -nofloat $(ADD_DFLAGS) +TFLAGS_DEBUG=-debug -g -w -nofloat $(ADD_DFLAGS) +TFLAGS=$(TFLAGS_RELEASE) DOCFLAGS=-version=DDoc @@ -75,6 +80,17 @@ ALL_DOCS= ###################################################### +unittest : + make -fwin32.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE) -unittest" + +release : + make -fwin32.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE)" + +debug : + make -fwin32.mak DC="$(DC)" LIB_BUILD="-d" DFLAGS="$(DFLAGS_DEBUG)" + +###################################################### + basic.lib : $(LIB_TARGET) $(LIB_TARGET) : $(ALL_OBJS) diff --git a/src/gc/stub/posix.mak b/src/gc/stub/posix.mak index 58d35f7..48681e3 100644 --- a/src/gc/stub/posix.mak +++ b/src/gc/stub/posix.mak @@ -10,8 +10,10 @@ # make clean # Delete unneeded files created by build process -LIB_TARGET=libdruntime-gc-stub.a -LIB_MASK=libdruntime-gc-stub*.a +LIB_BASE=libdruntime-gc-stub +LIB_BUILD= +LIB_TARGET=$(LIB_BASE)$(LIB_BUILD).a +LIB_MASK=$(LIB_BASE)*.a CP=cp -f RM=rm -f @@ -20,15 +22,17 @@ MD=mkdir -p ADD_CFLAGS= ADD_DFLAGS= -CFLAGS=-O $(ADD_CFLAGS) -#CFLAGS=-g $(ADD_CFLAGS) +CFLAGS_RELEASE=-O $(ADD_CFLAGS) +CFLAGS_DEBUG=-g $(ADD_CFLAGS) +CFLAGS=$(CFLAGS_RELEASE) -DFLAGS=-release -O -inline -w -nofloat $(ADD_DFLAGS) -#DFLAGS=-g -w -nofloat $(ADD_DFLAGS) +DFLAGS_RELEASE=-release -O -inline -w -nofloat $(ADD_DFLAGS) +DFLAGS_DEBUG=-debug -g -w -nofloat $(ADD_DFLAGS) +DFLAGS=$(DFLAGS_RELEASE) - -TFLAGS=-O -inline -w -nofloat $(ADD_DFLAGS) -#TFLAGS=-g -w -nofloat $(ADD_DFLAGS) +TFLAGS_RELEASE=-O -inline -w -nofloat $(ADD_DFLAGS) +TFLAGS_DEBUG=-debug -g -w -nofloat $(ADD_DFLAGS) +TFLAGS=$(TFLAGS_RELEASE) DOCFLAGS=-version=DDoc @@ -75,6 +79,17 @@ ALL_DOCS= ###################################################### +unittest : + make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE) -unittest" + +release : + make -fposix.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE)" + +debug : + make -fposix.mak DC="$(DC)" LIB_BUILD="-d" DFLAGS="$(DFLAGS_DEBUG)" + +###################################################### + stub.lib : $(LIB_TARGET) $(LIB_TARGET) : $(ALL_OBJS) diff --git a/src/gc/stub/win32.mak b/src/gc/stub/win32.mak index 9b3158e..e55472e 100644 --- a/src/gc/stub/win32.mak +++ b/src/gc/stub/win32.mak @@ -10,8 +10,10 @@ # make clean # Delete unneeded files created by build process -LIB_TARGET=druntime-gc-stub.lib -LIB_MASK=druntime-gc-stub*.lib +LIB_BASE=druntime-gc-stub +LIB_BUILD= +LIB_TARGET=$(LIB_BASE)$(LIB_BUILD).lib +LIB_MASK=$(LIB_BASE)*.lib CP=xcopy /y RM=del /f @@ -20,15 +22,17 @@ MD=mkdir ADD_CFLAGS= ADD_DFLAGS= -CFLAGS=-mn -6 -r $(ADD_CFLAGS) -#CFLAGS=-g -mn -6 -r $(ADD_CFLAGS) +CFLAGS_RELEASE=-mn -6 -r $(ADD_CFLAGS) +CFLAGS_DEBUG=-D -g -mn -6 -r $(ADD_CFLAGS) +CFLAGS=$(CFLAGS_RELEASE) -DFLAGS=-release -O -inline -w -nofloat $(ADD_DFLAGS) -#DFLAGS=-g -w -nofloat $(ADD_DFLAGS) +DFLAGS_RELEASE=-release -O -inline -w -nofloat $(ADD_DFLAGS) +DFLAGS_DEBUG=-debug -g -w -nofloat $(ADD_DFLAGS) +DFLAGS=$(DFLAGS_RELEASE) - -TFLAGS=-O -inline -w -nofloat $(ADD_DFLAGS) -#TFLAGS=-g -w -nofloat $(ADD_DFLAGS) +TFLAGS_RELEASE=-O -inline -w -nofloat $(ADD_DFLAGS) +TFLAGS_DEBUG=-debug -g -w -nofloat $(ADD_DFLAGS) +TFLAGS=$(TFLAGS_RELEASE) DOCFLAGS=-version=DDoc @@ -72,6 +76,17 @@ ALL_DOCS= ###################################################### +unittest : + make -fwin32.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE) -unittest" + +release : + make -fwin32.mak DC="$(DC)" LIB_BUILD="" DFLAGS="$(DFLAGS_RELEASE)" + +debug : + make -fwin32.mak DC="$(DC)" LIB_BUILD="-d" DFLAGS="$(DFLAGS_DEBUG)" + +###################################################### + stub.lib : $(LIB_TARGET) $(LIB_TARGET) : $(ALL_OBJS) diff --git a/src/test-dmd.bat b/src/test-dmd.bat new file mode 100644 index 0000000..9c9f24c --- /dev/null +++ b/src/test-dmd.bat @@ -0,0 +1,7 @@ +@echo off +set OLDHOME=%HOME% +set HOME=%CD% +make clean -fdmd-win32.mak +make unittest -fdmd-win32.mak +make clean -fdmd-win32.mak +set HOME=%OLDHOME% \ No newline at end of file diff --git a/src/unittest.d b/src/unittest.d new file mode 100644 index 0000000..8dbf3f2 --- /dev/null +++ b/src/unittest.d @@ -0,0 +1,4 @@ +void main() +{ + +}