# Makefile for Windows (Win32/64). 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,
# "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.
!IFDEF ENABLE_STATIC
CFLAGS_GCDLL=-DGC_NOT_DLL
CORDFLAG=
!ELSE
CFLAGS_GCDLL=-DGC_DLL
# cord.dll and its clients should not link C library statically otherwise
# FILE-related functions might not work (because own set of opened FILEs
# is maintained by each copy of the C library thus making impossible to pass
# FILE pointer from .exe code to .dll code).
cvarsmt=
!IFDEF NODEBUG
CORDFLAG=-MD
!ELSE
CORDFLAG=-MDd
!ENDIF
!ENDIF
# 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.
SUFFIXES:
SUFFIXES: .obj .cpp .c
# Atomic_ops installation directory. For Win32, the source directory
# should do, since we only need the headers.
# We assume this was manually unpacked.
AO_SRC_DIR=libatomic_ops/src
AO_INCLUDE_DIR=$(AO_SRC_DIR)
c.obj:
$(cc) $(cdebug) $(cflags) $(CFLAGS_SPECIFIC) $(CORDFLAG) -Iinclude -I$(AO_INCLUDE_DIR) $(CFLAGS_DEFAULT) -D_CRT_SECURE_NO_DEPRECATE $*.c /Fo$*.obj /wd4100 /wd4127 /wd4701
# Disable crt security warnings, since unfortunately they warn about all sorts
# of safe uses of strncpy. It would be nice to leave the rest enabled.
# This generates the C++ test executable. The executable expects
# a single numeric argument, which is the number of iterations.
# The output appears in test_cpp.gc.log file.
test_cpp.exe: test_cpp.obj include\gc_cpp.h include\gc.h gc.lib gccpp.lib
$(link) /MACHINE:$(CPU) /INCREMENTAL:NO $(ldebug) $(lflags) user32.lib -out:test_cpp.exe test_cpp.obj gc.lib gccpp.lib