forked from cisco/ChezScheme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.i3nt
134 lines (111 loc) · 4.8 KB
/
Makefile.i3nt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Makefile.i3nt
# Copyright 1984-2016 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 = i3nt
# following have to use \ for directory separator
SchemeInclude = ..\boot\$m
KernelDll = ..\bin\$m\csv941.dll
KernelLib = ..\bin\$m\csv941.lib
MTKernelLib = ..\boot\$m\csv941mt.lib
MDKernelLib = ..\boot\$m\csv941md.lib
KernelExp = ..\bin\$m\csv941.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 /I$(SchemeInclude) /I..\zlib /DUSE_ANSI_PROTOTYPES /DI386 /DWIN32 /D_CRT_SECURE_NO_WARNINGS
MDCFLAGS=$(CFLAGS) /MD
MTCFLAGS=$(CFLAGS) /MT
DLLLDFLAGS=/machine:ix86 /release /nologo
# see note in Makefile.a6nt regarding stack size. we use 8MB here to be consistent.
EXELDFLAGS=/machine:ix86 /incremental:no /release /nologo /STACK:0x800000
# use following flags for debugging
# CFLAGS=/nologo /Od /W3 /MDd /I$(SchemeInclude) /I..\zlib /DUSE_ANSI_PROTOTYPES /DI386 /DNO_UNISTD_H
# LDFLAGS=/machine:ix86 /incremental:no /release /nologo /debug
SystemLib=rpcrt4.lib ole32.lib advapi32.lib User32.lib
MDZlibLib=..\zlib\zlib.lib
MTZlibLib=..\zlib\zlibmt.lib
csrc=statics.c segment.c alloc.c symbol.c intern.c gcwrapper.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
cobj=statics.obj segment.obj alloc.obj symbol.obj intern.obj gcwrapper.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
hsrc=system.h types.h version.h globals.h externs.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
$(MTKernelLib): $(csrc) $(MTZlibLib)
-del /f $(MTKernelLib)
cl /DSCHEME_STATIC /c $(MTCFLAGS) $(csrc)
link /lib /nologo -out:$(MTKernelLib) $(cobj) $(MTZlibLib)
$(MDKernelLib): $(csrc) $(MDZlibLib)
-del /f $(MDKernelLib)
cl /DSCHEME_STATIC /c $(MDCFLAGS) $(csrc)
link /lib /nologo -out:$(MDKernelLib) $(cobj) $(MDZlibLib)
# 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 <exefile>' to check.
# we no longer attempt to rebase other the CRT dll since it
# has already been signed.
$(KernelLib): $(ResFile) $(csrc) $(MDZlibLib)
-del /f $(KernelLib)
-del /f $(KernelDll)
cl /c $(MDCFLAGS) $(csrc)
link -dll -out:$(KernelDll) $(DLLLDFLAGS) $(ResFile) $(cobj) $(MDZlibLib) $(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
clean:
-del /f $(cobj) main.obj $(KernelExp)
-del /f mtscheme.exe
-del /f mdscheme.exe