diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-06-19 12:15:30 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-06-19 12:27:52 +0300 |
commit | 2e2cf93f6e54d7e8b52a6774deb4a78381a0a803 (patch) | |
tree | 59097a567194e122e3c523c31ebee9acb0590ffa /NT_MAKEFILE | |
parent | 71dee52a3aebf90bc1efa37ccd1db954873ae71b (diff) | |
download | bdwgc-2e2cf93f6e54d7e8b52a6774deb4a78381a0a803.tar.gz |
Add cpu, make_as_lib, nothreads options to NT_MAKEFILE
The optional cpu=i386 and cpu=AMD64 arguments are now handled properly.
Issue #223 (bdwgc).
* NT_MAKEFILE: Update header comment (document "make_as_lib=1" and
"nothreads=1" options).
* NT_MAKEFILE (CVTRES_CPU): Defined depending on CPU variable value.
* NT_MAKEFILE [!NOTHREADS] (CFLAGS_MT): Define variable.
* NT_MAKEFILE (CFLAGS_GCDLL, GC_LIB, LINK_GC, GC_DLL, LINK_DLL_FLAGS):
Define depending on the value of MAKE_AS_LIB and CPU variables.
* NT_MAKEFILE (CFLAGS_SPECIFIC): Use CFLAGS_GCDLL, CFLAGS_MT.
Diffstat (limited to 'NT_MAKEFILE')
-rw-r--r-- | NT_MAKEFILE | 68 |
1 files changed, 31 insertions, 37 deletions
diff --git a/NT_MAKEFILE b/NT_MAKEFILE index 4cfa2196..1c7c4189 100644 --- a/NT_MAKEFILE +++ b/NT_MAKEFILE @@ -1,47 +1,41 @@ # Makefile for Windows NT. Assumes Microsoft compiler. -# Use "nmake -f NT_MAKEFILE nodebug=1 all" for optimized versions of library, -# gctest and editor. Please adjust/uncomment CPU, CVTRES_CPU, GC_DLL, GC_LIB, -# CFLAGS_SPECIFIC, LINK_GC variables below for the desired configuration. - -# For building x86 (32-bit) library: -CPU=i386 -CVTRES_CPU=X86 -# -# For building x64 (amd64) library: -#CPU=AMD64 -#CVTRES_CPU=X64 +# Should be invoked as "nmake -f NT_MAKEFILE [<args>]"; the optional arguments +# are: "cpu=AMD64" - to target x64, "cpu=i386" - to target x86, +# "make_as_lib=1" - to build it as a static library, "nodebug=1" - to produce +# the release variant of the library, "nothreads=1" - to build the library and +# the tests without threads support. !include <ntwin32.mak> -# For a static single-threaded collector library: -#CFLAGS_SPECIFIC=$(cvars) -DGC_NOT_DLL -#GC_DLL= -#GC_LIB=gc.lib -#LINK_GC=lib /out:$(GC_LIB) -# -# For a static multi-threaded collector library: -#CFLAGS_SPECIFIC=$(cvarsmt) -DGC_NOT_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK -#GC_DLL= -#GC_LIB=gc.lib -#LINK_GC=lib /out:$(GC_LIB) -# -# For a dynamic 32-bit multi-threaded collector library: -CFLAGS_SPECIFIC=$(cvarsmt) -DGC_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK +!IF "$(CPU)" == "i386" +CVTRES_CPU=X86 +!ELSEIF "$(CPU)" == "AMD64" +CVTRES_CPU=X64 +!ENDIF + +!IFNDEF NOTHREADS +CFLAGS_MT=$(cvarsmt) -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK +!ENDIF + +!IFDEF MAKE_AS_LIB +CFLAGS_GCDLL=-DGC_NOT_DLL +GC_LIB=gc.lib +LINK_GC=lib /out:$(GC_LIB) +!ELSE +CFLAGS_GCDLL=-DGC_DLL +!IF "$(CPU)" == "AMD64" +GC_DLL=gc64.dll +GC_LIB=gc64_dll.lib +!ELSE GC_DLL=gc.dll GC_LIB=gc_dll.lib -# -# For a dynamic 64-bit multi-threaded collector library: -#CFLAGS_SPECIFIC=$(cvarsmt) -DGC_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK -#GC_DLL=gc64.dll -#GC_LIB=gc64_dll.lib - -LINK_DLL_FLAGS=kernel32.lib user32.lib \ - /nologo /subsystem:windows /dll /incremental:no /pdb:"gc.pdb" \ - /out:$(GC_DLL) /implib:$(GC_LIB) - -# For a dynamic 32- or 64-bit multi-threaded collector library: -LINK_GC=link $(ldebug) $(LINK_DLL_FLAGS) +!ENDIF +LINK_DLL_FLAGS=kernel32.lib user32.lib /subsystem:windows /dll \ + /INCREMENTAL:NO /pdb:"gc.pdb" /out:$(GC_DLL) /implib:$(GC_LIB) +LINK_GC=$(link) $(ldebug) $(LINK_DLL_FLAGS) +!ENDIF +CFLAGS_SPECIFIC=$(CFLAGS_GCDLL) $(CFLAGS_MT) # Make sure that .cc is not viewed as a suffix. It is for VC++2005, but # not earlier versions. We can deal with either, but not inconsistency. |