# Makefile.ti3nt # Copyright 1984-2017 Cisco Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. m = ti3nt # following have to use \ for directory separator SchemeInclude = ..\boot\$m KernelDll = ..\bin\$m\csv959.dll KernelLib = ..\bin\$m\csv959.lib MTKernelLib = ..\boot\$m\csv959mt.lib MDKernelLib = ..\boot\$m\csv959md.lib KernelExp = ..\bin\$m\csv959.exp Exec = ..\bin\$m\scheme.exe MTMain = ..\boot\$m\mainmt.obj MDMain = ..\boot\$m\mainmd.obj ResFile = ..\boot\$m\scheme.res # We use MD so that we can link with and load DLLs built against msvcrxxx.dll CFLAGS=/nologo /fp:precise /Ox /W3 /Zi /I$(SchemeInclude) /I..\zlib /I..\lz4\lib /DI386 /DWIN32 /D_CRT_SECURE_NO_WARNINGS MDCFLAGS=$(CFLAGS) /MD MTCFLAGS=$(CFLAGS) /MT DLLLDFLAGS=/debug:full /machine:ix86 /nologo # see note in Makefile.a6nt regarding stack size. we use 8MB here to be consistent. EXELDFLAGS=/debug:full /machine:ix86 /incremental:no /nologo /STACK:0x800000 # use following flags for debugging # CFLAGS=/nologo /fp:precise /Od /W3 /Zi /I$(SchemeInclude) /I..\zlib /I..\lz4\lib /DI386 /DWIN32 /D_CRT_SECURE_NO_WARNINGS # MDCFLAGS=$(CFLAGS) /MDd # MTCFLAGS=$(CFLAGS) /MTd SystemLib=rpcrt4.lib ole32.lib advapi32.lib User32.lib MDZlibLib=..\zlib\zlib.lib MTZlibLib=..\zlib\zlibmt.lib MDLZ4Lib=..\lz4\lib\liblz4.lib MTLZ4Lib=..\lz4\lib\liblz4mt.lib csrc=statics.c segment.c alloc.c symbol.c intern.c gcwrapper.c gc-011.c gc-oce.c gc-ocd.c\ number.c schsig.c io.c new-io.c print.c fasl.c stats.c\ foreign.c prim.c prim5.c flushcache.c\ windows.c\ schlib.c thread.c expeditor.c scheme.c compress-io.c cobj=statics.obj segment.obj alloc.obj symbol.obj intern.obj gcwrapper.obj gc-011.obj gc-oce.obj gc-ocd.obj\ number.obj schsig.obj io.obj new-io.obj print.obj fasl.obj stats.obj\ foreign.obj prim.obj prim5.obj flushcache.obj\ windows.obj\ schlib.obj thread.obj expeditor.obj scheme.obj compress-io.obj hsrc=system.h types.h version.h globals.h externs.h compress-io.h segment.h gc.c thread.h sort.h itest.c .SUFFIXES: all: $(Exec) $(MTKernelLib) $(MDKernelLib) $(MTMain) $(KernelLib) $(MTKernelLib) $(MDKernelLib): $(hsrc) $(KernelLib) $(MTKernelLib) $(MDKernelLib): $(SchemeInclude)/equates.h $(SchemeInclude)/scheme.h $(KernelLib) $(MTKernelLib) $(MDKernelLib): ..\zlib/zconf.h ..\zlib/zlib.h $(KernelLib) $(MTKernelLib) $(MDKernelLib): ../lz4/lib/lz4.h ../lz4/lib/lz4frame.h $(MTKernelLib): $(csrc) $(MTZlibLib) $(MTLZ4Lib) -del /f $(MTKernelLib) cl /DSCHEME_STATIC /c $(MTCFLAGS) $(csrc) link /lib /nologo -out:$(MTKernelLib) $(cobj) $(MTZlibLib) $(MTLZ4Lib) $(MDKernelLib): $(csrc) $(MDZlibLib) $(MDLZ4Lib) -del /f $(MDKernelLib) cl /DSCHEME_STATIC /c $(MDCFLAGS) $(csrc) link /lib /nologo -out:$(MDKernelLib) $(cobj) $(MDZlibLib) $(MDLZ4Lib) # nmake builds Dll twice if we list it with $(KernelLib) below $(KernelDll): $(KernelLib) # base chosen to be consistent with "microsoft conventions" # http://www.windevnet.com/documents/s=7482/win1078945937961/ # but set at a basically odd address to reduce likelihood of # conflicts with other dlls. use 'depends ' to check. # we no longer attempt to rebase other the CRT dll since it # has already been signed. $(KernelLib): $(ResFile) $(csrc) $(MDZlibLib) $(MDLZ4Lib) -del /f $(KernelLib) -del /f $(KernelDll) cl /c $(MDCFLAGS) $(csrc) link -dll -out:$(KernelDll) $(DLLLDFLAGS) $(ResFile) $(cobj) $(MDZlibLib) $(MDLZ4Lib) $(SystemLib) editbin /nologo /rebase:base=0x67480000 $(KernelDll) $(MTMain): main.c -del /f $(MTMain) cl /DSCHEME_STATIC /c $(MTCFLAGS) main.c copy main.obj $(MTMain) $(MDMain): main.c -del /f $(MDMain) cl /c $(MDCFLAGS) main.c copy main.obj $(MDMain) $(Exec): $(ResFile) $(MDMain) $(KernelLib) -del /f $(Exec) link /out:$(Exec) $(EXELDFLAGS) $(ResFile) $(MDMain) $(KernelLib) mt -manifest ..\..\c\scheme.exe.manifest -outputresource:$(Exec);1 $(ResFile): scheme.rc -del /f $(ResFile) rc -r /fo $(ResFile) -DWIN32 scheme.rc # for testing mt kernel and mainmt.obj: mtscheme.exe: $(ResFile) $(MTMain) $(MTKernelLib) -del /f mtscheme.exe link /out:mtscheme.exe $(EXELDFLAGS) $(ResFile) $(MTMain) $(MTKernelLib) $(SystemLib) # for testing md kernel and mainmd.obj: mdscheme.exe: $(ResFile) $(MDMain) $(MDKernelLib) -del /f mdscheme.exe link /out:mdscheme.exe $(EXELDFLAGS) $(ResFile) $(MDMain) $(MDKernelLib) $(SystemLib) ..\zlib\zlib.h ..\zlib\zconf.h $(MDZlibLib) $(MTZlibLib): cd ../zlib nmake /nologo -f win32/Makefile.msc AR="link /lib" CFLAGS="-nologo -MT -O2 $(LOC)" ren zlib.lib zlibmt.lib nmake /nologo -f win32/Makefile.msc clean nmake /nologo -f win32/Makefile.msc AR="link /lib" cd ../c $(MDLZ4Lib) $(MTLZ4Lib): ../lz4/lib/lz4.c ../lz4/lib/lz4frame.c ../lz4/lib/lz4hc.c cl /c /Fo../lz4/lib/lz4.obj $(MDCFLAGS) ../lz4/lib/lz4.c cl /c /Fo../lz4/lib/lz4frame.obj $(MDCFLAGS) ../lz4/lib/lz4frame.c cl /c /Fo../lz4/lib/lz4hc.obj $(MDCFLAGS) ../lz4/lib/lz4hc.c cl /c /Fo../lz4/lib/xxhash.obj $(MDCFLAGS) ../lz4/lib/xxhash.c lib /OUT:$(MDLZ4Lib) ../lz4/lib/lz4.obj ../lz4/lib/lz4frame.obj ../lz4/lib/lz4hc.obj ../lz4/lib/xxhash.obj cl /c /Fo../lz4/lib/lz4mt.obj $(MTCFLAGS) ../lz4/lib/lz4.c cl /c /Fo../lz4/lib/lz4framemt.obj $(MTCFLAGS) ../lz4/lib/lz4frame.c cl /c /Fo../lz4/lib/lz4hcmt.obj $(MTCFLAGS) ../lz4/lib/lz4hc.c cl /c /Fo../lz4/lib/xxhashmt.obj $(MTCFLAGS) ../lz4/lib/xxhash.c lib /OUT:$(MTLZ4Lib) ../lz4/lib/lz4mt.obj ../lz4/lib/lz4framemt.obj ../lz4/lib/lz4hcmt.obj ../lz4/lib/xxhashmt.obj clean: -del /f $(cobj) main.obj $(KernelExp) -del /f mtscheme.exe -del /f mdscheme.exe