Debian Codegraph @

external/bdwgc/NT_MAKEFILE

raw
1 # Makefile for Windows NT. Assumes Microsoft compiler.
2 # Use "nmake -f NT_MAKEFILE nodebug=1 all" for optimized versions of library,
3 # gctest and editor. Please adjust/uncomment CPU, CVTRES_CPU, GC_DLL, GC_LIB,
4 # CFLAGS_SPECIFIC, LINK_GC variables below for the desired configuration.
5
6 # For building x86 (32-bit) library:
7 CPU=i386
8 CVTRES_CPU=X86
9 #
10 # For building x64 (amd64) library:
11 #CPU=AMD64
12 #CVTRES_CPU=X64
13
14 !include <ntwin32.mak>
15
16 # For a static single-threaded collector library:
17 #CFLAGS_SPECIFIC=$(cvars) -DGC_NOT_DLL
18 #GC_DLL=
19 #GC_LIB=gc.lib
20 #LINK_GC=lib /out:$(GC_LIB)
21 #
22 # For a static multi-threaded collector library:
23 #CFLAGS_SPECIFIC=$(cvarsmt) -DGC_NOT_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK
24 #GC_DLL=
25 #GC_LIB=gc.lib
26 #LINK_GC=lib /out:$(GC_LIB)
27 #
28 # For a dynamic 32-bit multi-threaded collector library:
29 CFLAGS_SPECIFIC=$(cvarsmt) -DGC_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK
30 GC_DLL=gc.dll
31 GC_LIB=gc_dll.lib
32 #
33 # For a dynamic 64-bit multi-threaded collector library:
34 #CFLAGS_SPECIFIC=$(cvarsmt) -DGC_DLL -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK
35 #GC_DLL=gc64.dll
36 #GC_LIB=gc64_dll.lib
37
38 LINK_DLL_FLAGS=kernel32.lib user32.lib \
39 /nologo /subsystem:windows /dll /incremental:no /pdb:"gc.pdb" \
40 /out:$(GC_DLL) /implib:$(GC_LIB)
41
42 # For a dynamic 32- or 64-bit multi-threaded collector library:
43 LINK_GC=link $(ldebug) $(LINK_DLL_FLAGS)
44
45
46 # Make sure that .cc is not viewed as a suffix. It is for VC++2005, but
47 # not earlier versions. We can deal with either, but not inconsistency.
48 .SUFFIXES:
49 .SUFFIXES: .obj .cpp .c
50
51 # Atomic_ops installation directory. For win32, the source directory
52 # should do, since we only need the headers.
53 # We assume this was manually unpacked.
54 AO_SRC_DIR=libatomic_ops/src
55 AO_INCLUDE_DIR=$(AO_SRC_DIR)
56
57 OBJS= alloc.obj reclaim.obj allchblk.obj misc.obj mach_dep.obj os_dep.obj mark_rts.obj headers.obj mark.obj obj_map.obj blacklst.obj finalize.obj new_hblk.obj dbg_mlc.obj fnlz_mlc.obj malloc.obj dyn_load.obj typd_mlc.obj ptr_chck.obj gc_cpp.obj mallocx.obj win32_threads.obj extra\msvc_dbg.obj thread_local_alloc.obj
58
59 all: gctest.exe cord\de.exe test_cpp.exe
60
61 .c.obj:
62 $(cc) $(cdebug) $(cflags) $(CFLAGS_SPECIFIC) -Iinclude -I$(AO_INCLUDE_DIR) -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DCORD_NOT_DLL -D_CRT_SECURE_NO_DEPRECATE $*.c /Fo$*.obj /wd4100 /wd4127 /wd4701
63 # Disable crt security warnings, since unfortunately they warn about all sorts
64 # of safe uses of strncpy. It would be nice to leave the rest enabled.
65
66 .cpp.obj:
67 $(cc) $(cdebug) $(cflags) $(CFLAGS_SPECIFIC) -Iinclude -I$(AO_INCLUDE_DIR) -DALL_INTERIOR_POINTERS -D_CRT_SECURE_NO_DEPRECATE $*.cpp /Fo$*.obj
68
69 $(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
70
71 $(GC_LIB): $(OBJS)
72 $(LINK_GC) /MACHINE:$(CPU) $(OBJS)
73
74 gctest.exe: tests\test.obj $(GC_LIB)
75 $(link) /MACHINE:$(CPU) $(ldebug) $(guiflags) -out:$*.exe tests\test.obj $(guilibs) $(GC_LIB)
76 # mapsympe -n -o gctest.sym gctest.exe
77 # This produces a GUI app that opens no window and writes to gctest.gc.log.
78
79 cord\tests\de_win.rbj: cord\tests\de_win.res
80 cvtres /MACHINE:$(CVTRES_CPU) /OUT:cord\tests\de_win.rbj cord\tests\de_win.res
81
82 cord\tests\de.obj cord\tests\de_win.obj: include\cord.h include\cord_pos.h cord\tests\de_win.h cord\tests\de_cmds.h
83
84 cord\tests\de_win.res: cord\tests\de_win.rc cord\tests\de_win.h cord\tests\de_cmds.h
85 $(rc) $(rcvars) -r -fo cord\tests\de_win.res cord\tests\de_win.rc
86
87 # Cord/de is a real win32 GUI app.
88 cord\de.exe: cord\cordbscs.obj cord\cordxtra.obj cord\tests\de.obj cord\tests\de_win.obj cord\tests\de_win.rbj $(GC_LIB)
89 $(link) /MACHINE:$(CPU) $(ldebug) $(guiflags) -out:cord\de.exe cord\cordbscs.obj cord\cordxtra.obj cord\tests\de.obj cord\tests\de_win.obj cord\tests\de_win.rbj $(GC_LIB) $(guilibs)
90
91 gc_cpp.obj: include\gc_cpp.h include\gc.h
92
93 test_cpp.cpp: tests\test_cpp.cc
94 copy tests\test_cpp.cc test_cpp.cpp
95
96 # This generates the C++ test executable. The executable expects
97 # a single numeric argument, which is the number of iterations.
98 # The output appears in test_cpp.gc.log file.
99 test_cpp.exe: test_cpp.obj include\gc_cpp.h include\gc.h $(GC_LIB)
100 $(link) /MACHINE:$(CPU) $(ldebug) $(guiflags) -out:test_cpp.exe test_cpp.obj $(GC_LIB) $(guilibs)
101
102 $(AO_SRC_DIR):
103 tar xvfz $(AO_SRC_DIR).tar.gz
104
105 clean:
106 del *.exe *.log *.obj *.pdb cord\*.exe cord\*.exp cord\*.lib cord\*.obj cord\*.pdb cord\tests\*.rbj cord\tests\*.res cord\tests\*.obj extra\*.obj gc*.lib gc*.dll gc*.exp test_cpp.cpp tests\*.obj 2> nul