From 40fcb59ed30f55076b5e6bbfca798ad0cad0302c Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 24 Jul 2019 11:11:29 +0300 Subject: Build cord.lib by Makefile.direct, NT_MAKEFILE, OS2_MAKEFILE, WCC_MAKEFILE Note: Makefile.direct builds cord.a (not libcord.a or cord.lib). * Makefile.direct: Update header comment about all and cords targets. * Makefile.direct (all): Depend also on cords. * Makefile.direct (cord.a): New target (duplicates cords target). * Makefile.direct (cords): Do not depend on base_lib; create cord.a instead of updating gc.a. * Makefile.direct (cordtest, de): Depend on cords instead of $(CORD_OBJS); pass cord.a (instead of $(CORD_OBJS)) to $(CC). * NT_MAKEFILE (CFLAGS_MT): Move variable definition (which uses cvarsmt) to be after CORDFLAG one. * NT_MAKEFILE (CORDFLAG, COBJS): New variable. * WCC_MAKEFILE (CORDFLAG, COBJS): Likewise. * NT_MAKEFILE [!ENABLE_STATIC] (cvarsmt): Set variable value to empty; add comment. * NT_MAKEFILE (all): Depend also on cord.lib. * OS2_MAKEFILE (all): Likewise. * WCC_MAKEFILE (all): Likewise. * NT_MAKEFILE (check): Depend also on cordtest.exe; run also cordtest. * WCC_MAKEFILE (check): Likewise. * NT_MAKEFILE (.c.obj): Remove -DCORD_NOT_DLL; add $(CORDFLAG). * NT_MAKEFILE (cord.lib, cordtest.exe): New target. * OS2_MAKEFILE (cord.lib, cordtest.exe, clean): Likewise. * WCC_MAKEFILE (cord.lib, cordtest.exe, cordbscs.obj, cordxtra.obj, cordprnt.obj, cordtest.obj): Likewise. * WCC_MAKEFILE [!ENABLE_STATIC] (cord.dll): Likewise. * NT_MAKEFILE (de.exe): Depend on cord.lib instead of cordbscs.obj and cordxtra.obj. * NT_MAKEFILE (clean): Delete cordtst*.tmp files; delete *.lib, *.dll, and *.exp files instead of gc*.lib, gc*.dll, gc*.exp, cord\*.exe, cord\*.exp, cord\*.lib, cord\*.pdb. * README.md (Installation and Portability): Update information about "make cords". --- NT_MAKEFILE | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) (limited to 'NT_MAKEFILE') diff --git a/NT_MAKEFILE b/NT_MAKEFILE index a0477ed7..3266d9af 100644 --- a/NT_MAKEFILE +++ b/NT_MAKEFILE @@ -52,14 +52,25 @@ CVTRES_CPU=X64 CFLAGS_DEBUG=-DGC_ASSERTIONS !ENDIF -!IFNDEF DISABLE_THREADS -CFLAGS_MT=$(cvarsmt) -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK -!ENDIF - !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 + +!IFNDEF DISABLE_THREADS +CFLAGS_MT=$(cvarsmt) -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK !ENDIF CFLAGS_SPECIFIC=$(CFLAGS_DEBUG) $(CFLAGS_GCDLL) $(CFLAGS_MT) @@ -79,14 +90,17 @@ AO_INCLUDE_DIR=$(AO_SRC_DIR) OBJS= misc.obj win32_threads.obj alloc.obj reclaim.obj allchblk.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 gcj_mlc.obj mallocx.obj extra\msvc_dbg.obj thread_local_alloc.obj -all: gc.lib gccpp.lib +COBJS= cord\cordbscs.obj cord\cordxtra.obj cord\cordprnt.obj + +all: gc.lib cord.lib gccpp.lib -check: gctest.exe test_cpp.exe de.exe +check: gctest.exe test_cpp.exe cordtest.exe de.exe gctest.exe + cordtest.exe test_cpp.exe .c.obj: - $(cc) $(cdebug) $(cflags) $(CFLAGS_SPECIFIC) -Iinclude -I$(AO_INCLUDE_DIR) $(CFLAGS_DEFAULT) -DCORD_NOT_DLL -D_CRT_SECURE_NO_DEPRECATE $*.c /Fo$*.obj /wd4100 /wd4127 /wd4701 + $(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. @@ -100,6 +114,9 @@ $(OBJS) tests\test.obj: include\private\gc_priv.h include\private\gc_hdrs.h incl gc.lib: $(OBJS) lib /out:gc.lib /MACHINE:$(CPU) $(OBJS) +cord.lib: $(COBJS) + lib /out:cord.lib /MACHINE:$(CPU) $(COBJS) + gccpp.lib: gc_cpp.obj lib /out:gccpp.lib /MACHINE:$(CPU) gc_cpp.obj @@ -108,6 +125,9 @@ gccpp.lib: gc_cpp.obj gc.lib: $(OBJS) $(link) $(ldebug) kernel32.lib user32.lib /subsystem:windows /dll /INCREMENTAL:NO /pdb:"gc.pdb" /out:gc.dll /implib:gc.lib /MACHINE:$(CPU) $(OBJS) +cord.lib: $(COBJS) gc.lib + $(link) $(ldebug) gc.lib /subsystem:windows /dll /INCREMENTAL:NO /pdb:"cord.pdb" /out:cord.dll /implib:cord.lib /MACHINE:$(CPU) $(COBJS) + gccpp.lib: gc_cpp.obj gc.lib $(link) $(ldebug) gc.lib /subsystem:windows /dll /INCREMENTAL:NO /pdb:"gccpp.pdb" /out:gccpp.dll /implib:gccpp.lib /MACHINE:$(CPU) gc_cpp.obj @@ -127,8 +147,11 @@ cord\tests\de_win.res: cord\tests\de_win.rc cord\tests\de_win.h cord\tests\de_cm $(rc) $(rcvars) -r -fo cord\tests\de_win.res cord\tests\de_win.rc # Cord/de is a real win32 GUI app. -de.exe: cord\cordbscs.obj cord\cordxtra.obj cord\tests\de.obj cord\tests\de_win.obj cord\tests\de_win.rbj gc.lib - $(link) /MACHINE:$(CPU) /INCREMENTAL:NO $(ldebug) $(lflags) -out:de.exe cord\cordbscs.obj cord\cordxtra.obj cord\tests\de.obj cord\tests\de_win.obj cord\tests\de_win.rbj gc.lib gdi32.lib user32.lib +de.exe: cord\tests\de.obj cord\tests\de_win.obj cord\tests\de_win.rbj gc.lib cord.lib + $(link) /MACHINE:$(CPU) /INCREMENTAL:NO $(ldebug) $(lflags) -out:de.exe cord\tests\de.obj cord\tests\de_win.obj cord\tests\de_win.rbj gc.lib cord.lib gdi32.lib user32.lib + +cordtest.exe: cord\tests\cordtest.obj gc.lib cord.lib + $(link) /subsystem:console /MACHINE:$(CPU) /INCREMENTAL:NO $(ldebug) $(lflags) -out:cordtest.exe cord\tests\cordtest.obj gc.lib cord.lib user32.lib gc_cpp.obj: gc_cpp.cc include\gc_cpp.h include\gc.h @@ -145,4 +168,4 @@ $(AO_SRC_DIR): tar xvfz $(AO_SRC_DIR).tar.gz clean: - 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 + del *.dll *.exe *.exp *.lib *.log *.obj *.pdb cordtst*.tmp cord\*.obj cord\tests\*.rbj cord\tests\*.res cord\tests\*.obj extra\*.obj test_cpp.cpp tests\*.obj 2> nul -- cgit v1.2.1