This is to match the behavior of CMake script.
* NT_MAKEFILE: Update header comment (rename make_as_lib to
enable_static).
* NT_MAKEFILE (MAKE_AS_LIB): Rename to ENABLE_STATIC.
* WCC_MAKEFILE (MAKE_AS_DLL): Remove (check "ndef ENABLE_STATIC"
instead).
* WCC_MAKEFILE (MAKE_AS_LIB): Rename to ENABLE_STATIC; update comment.
* doc/README.win32 (Microsoft Tools): Rename make_as_lib to
enable_static.
* doc/README.win64: Likewise.
# Makefile for Windows NT. Assumes Microsoft compiler.
# 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
+# "enable_static=1" - to build it as a static library, "nodebug=1" - to produce
# the release variant of the library, "disable_threads=1" - to build the
# library and the tests without threads support.
CFLAGS_MT=$(cvarsmt) -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK
!ENDIF
-!IFDEF MAKE_AS_LIB
+!IFDEF ENABLE_STATIC
CFLAGS_GCDLL=-DGC_NOT_DLL
!ELSE
CFLAGS_GCDLL=-DGC_DLL
$(OBJS) tests\test.obj: include\private\gc_priv.h include\private\gc_hdrs.h include\gc.h include\private\gcconfig.h include\private\gc_locks.h include\private\gc_pmark.h include\gc_mark.h include\gc_disclaim.h include\private\msvc_dbg.h
-!IFDEF MAKE_AS_LIB
+!IFDEF ENABLE_STATIC
gc.lib: $(OBJS)
lib /out:gc.lib /MACHINE:$(CPU) $(OBJS)
#SYSTEM=DOS4GW
#SYSTEM=OS2
-# The collector can be built either as dynamic or as static library.
-# Select the library type you need.
-MAKE_AS_DLL=1
-#MAKE_AS_LIB=1
+# The collector can be built either as dynamic (the default) or as static
+# library. The latter is selected by setting ENABLE_STATIC variable.
+#ENABLE_STATIC=1
# Select calling conventions.
# Possible choices are r and s.
!else
!error undefined or unsupported target platform: $(SYSTEM)
!endif
-!ifdef MAKE_AS_DLL
-DLLFLAG=-bd -DGC_DLL
-TEST_DLLFLAG=-DGC_DLL
-!else ifdef MAKE_AS_LIB
+
+!ifdef ENABLE_STATIC
DLLFLAG=
TEST_DLLFLAG=-DGC_NOT_DLL
!else
-!error Either MAKE_AS_LIB or MAKE_AS_DLL should be defined
+DLLFLAG=-bd -DGC_DLL
+TEST_DLLFLAG=-DGC_DLL
!endif
CC=wcc386
*gctest.exe
*test_cpp.exe
-!ifdef MAKE_AS_DLL
+!ifdef ENABLE_STATIC
+
+gc.lib: $(OBJS)
+ @%create $*.lb1
+ @for %i in ($(OBJS)) do @%append $*.lb1 +'%i'
+ *wlib -b -c -n -p=512 $@ @$*.lb1
+
+gccpp.lib: gc_cpp.obj
+ @%create $*.lb1
+ @%append $*.lb1 +'gc_cpp.obj'
+ *wlib -b -c -n -p=512 $@ @$*.lb1
+
+!else
gc.lib: gc.dll
*wlib -b -c -n -p=512 $@ +gc.dll
@%append $*.lnk library wr7$(CALLING)dll.lib
*wlink @$*.lnk
-!else
-
-gc.lib: $(OBJS)
- @%create $*.lb1
- @for %i in ($(OBJS)) do @%append $*.lb1 +'%i'
- *wlib -b -c -n -p=512 $@ @$*.lb1
-
-gccpp.lib: gc_cpp.obj
- @%create $*.lb1
- @%append $*.lb1 +'gc_cpp.obj'
- *wlib -b -c -n -p=512 $@ @$*.lb1
-
!endif
-
gctest.exe: test.obj gc.lib
%create $*.lnk
!ifdef DOS4GW
---------------
For Microsoft development tools, type
-"nmake -f NT_MAKEFILE cpu=i386 make_as_lib=1 disable_threads=1 nodebug=1"
+"nmake -f NT_MAKEFILE cpu=i386 disable_threads=1 enable_static=1 nodebug=1"
to build the release variant of the collector as a static library without
threads support.
for the 32-bit library version.
A similar procedure using NT_MAKEFILE is applicable to build the static
-library - just pass "make_as_lib=1" as an extra argument to nmake.
+library - just pass "enable_static=1" as an extra argument to nmake.
If needed, it is also possible to build the library without threads
support - this could be done by passing "disable_threads=1" argument to nmake.