File: Makefile.ta6nt

package info (click to toggle)
chezscheme 9.5.4%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 61,640 kB
  • sloc: ansic: 17,508; sh: 759; makefile: 509; csh: 423
file content (151 lines) | stat: -rw-r--r-- 6,223 bytes parent folder | download
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# Makefile.ta6nt
# 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 = ta6nt

# following have to use \ for directory separator
SchemeInclude = ..\boot\$m
KernelDll = ..\bin\$m\csv954.dll
KernelLib = ..\bin\$m\csv954.lib
MTKernelLib = ..\boot\$m\csv954mt.lib
MDKernelLib = ..\boot\$m\csv954md.lib
KernelExp = ..\bin\$m\csv954.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 /Ox /W3 /Zi /I$(SchemeInclude) /I..\zlib /I..\lz4\lib /DUSE_ANSI_PROTOTYPES /DX86_64 /DWIN32 /D_CRT_SECURE_NO_WARNINGS
MDCFLAGS=$(CFLAGS) /MD
MTCFLAGS=$(CFLAGS) /MT
DLLLDFLAGS=/debug:full /machine:X64 /nologo
# stack limit is 1MB by default.  this is not enough for one of the mats in foreign.ms, which
# builds up nested C & Scheme stack frames.  2MB seems to be enough, but we set to 16MB.
EXELDFLAGS=/debug:full /machine:X64 /incremental:no /nologo /STACK:0x1000000

# use following flags for debugging
# CFLAGS=/nologo /Od /W3 /Zi /I$(SchemeInclude) /I..\zlib /I..\lz4\lib /DUSE_ANSI_PROTOTYPES /DX86_64 /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 <exefile>' 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