1 | # $Id: Makefile.kmk 3371 2020-06-10 10:58:58Z bird $
|
---|
2 | ## @file
|
---|
3 | # Sub-makefile for kWorker.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (c) 2016 knut st. osmundsen <[email protected]>
|
---|
8 | #
|
---|
9 | # This file is part of kBuild.
|
---|
10 | #
|
---|
11 | # kBuild is free software; you can redistribute it and/or modify
|
---|
12 | # it under the terms of the GNU General Public License as published by
|
---|
13 | # the Free Software Foundation; either version 3 of the License, or
|
---|
14 | # (at your option) any later version.
|
---|
15 | #
|
---|
16 | # kBuild is distributed in the hope that it will be useful,
|
---|
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
19 | # GNU General Public License for more details.
|
---|
20 | #
|
---|
21 | # You should have received a copy of the GNU General Public License
|
---|
22 | # along with kBuild. If not, see <http://www.gnu.org/licenses/>
|
---|
23 | #
|
---|
24 | #
|
---|
25 |
|
---|
26 |
|
---|
27 | SUB_DEPTH = ../..
|
---|
28 | include $(PATH_KBUILD)/subheader.kmk
|
---|
29 |
|
---|
30 |
|
---|
31 | PROGRAMS += kWorker
|
---|
32 | kWorker_TEMPLATE = BIN-STATIC-THREADED
|
---|
33 | kWorker_DEFS := KWORKER
|
---|
34 | kWorker_DEFS.debug = K_STRICT
|
---|
35 | kWorker_DEFS.release = NASSERT
|
---|
36 | ifeq ($(USERNAME),bird)
|
---|
37 | kWorker_CFLAGS = -W4 -wd4127 -wd4100 -wd4214 -wd4201 -wd4204
|
---|
38 | endif
|
---|
39 | kWorker_SOURCES = \
|
---|
40 | kWorker.c \
|
---|
41 | ../kmk/kmkbuiltin/kDepObj.c \
|
---|
42 | ../kmk/kmkbuiltin/err.c
|
---|
43 | kWorker_INCS = \
|
---|
44 | ../kmk/ \
|
---|
45 | ../kmk/kmkbuiltin
|
---|
46 | kWorker_LIBS = \
|
---|
47 | $(kStuff_1_TARGET) \
|
---|
48 | $(kWorkerLib_1_TARGET)
|
---|
49 | include $(KBUILD_PATH)/sdks/WINDDK71.kmk
|
---|
50 | kWorker_LIBS.win = \
|
---|
51 | $(TEMPLATE_BIN-STATIC-THREADED_LIBS) \
|
---|
52 | $(PATH_SDK_WINDDK71_LIB_WNET)/ntdll.lib \
|
---|
53 | $(PATH_SDK_WINDDK71_LIB_WNET)/psapi.lib
|
---|
54 | kWorker_LDFLAGS.win = \
|
---|
55 | /DYNAMICBASE:NO /FIXED
|
---|
56 | kWorker_LDFLAGS.win.x86 = /BASE:0x00010000
|
---|
57 | kWorker_LDFLAGS.win.amd64 = /BASE:0x0000000420000000 /STACK:16777216,262144
|
---|
58 |
|
---|
59 | #kWorker_LDFLAGS.win.x86 = \
|
---|
60 | # /SAFESEH:NO - doesn't help anyone.
|
---|
61 |
|
---|
62 |
|
---|
63 | #
|
---|
64 | # Stuff from ../libs. Need to rebuilt it with static CRT.
|
---|
65 | #
|
---|
66 | LIBRARIES += kWorkerLib
|
---|
67 | kWorkerLib_TEMPLATE = LIB-STATIC-THREADED
|
---|
68 | kWorkerLib_DEFPATH = ../lib # Need fix from r2837.
|
---|
69 | kWorkerLib_DEFPATH := $(PATH_SUB_CURRENT)/../lib
|
---|
70 | kWorkerLib_DEFS := KWORKER
|
---|
71 | kWorkerLib_SOURCES = \
|
---|
72 | crc32.c \
|
---|
73 | md5.c \
|
---|
74 | kbuild_version.c \
|
---|
75 | kDep.c
|
---|
76 | kWorkerLib_SOURCES.win = \
|
---|
77 | nt_fullpath.c \
|
---|
78 | nt_fullpath_cached.c \
|
---|
79 | quoted_spawn.c \
|
---|
80 | nt/nthlpcore.c \
|
---|
81 | nt/nthlpfs.c \
|
---|
82 | nt/ntdir.c \
|
---|
83 | nt/ntstat.c \
|
---|
84 | nt/ntunlink.c \
|
---|
85 | nt/kFsCache.c \
|
---|
86 | win_get_processor_group_active_mask.c \
|
---|
87 | quote_argv.c \
|
---|
88 | is_console.c \
|
---|
89 | maybe_con_write.c \
|
---|
90 | maybe_con_fwrite.c \
|
---|
91 | msc_buffered_printf.c
|
---|
92 | kbuild_version.c_DEFS = KBUILD_SVN_REV=$(KBUILD_SVN_REV)
|
---|
93 |
|
---|
94 | #
|
---|
95 | # kStuff library.
|
---|
96 | #
|
---|
97 | LIBRARIES += kStuff
|
---|
98 | kStuff_TEMPLATE = LIB-STATIC-THREADED
|
---|
99 | kStuff_DEFS.debug = K_STRICT
|
---|
100 | kStuff_INCS = kStuff/include
|
---|
101 | kStuff_DEFPATH = $(PATH_ROOT)/src/lib
|
---|
102 |
|
---|
103 | # kLdr
|
---|
104 | kStuff_SOURCES += \
|
---|
105 | kStuff/kLdr/kLdr.c \
|
---|
106 | kStuff/kLdr/kLdrDyld.c \
|
---|
107 | kStuff/kLdr/kLdrDyldFind.c \
|
---|
108 | kStuff/kLdr/kLdrDyldMod.c \
|
---|
109 | kStuff/kLdr/kLdrDyldOS.c \
|
---|
110 | kStuff/kLdr/kLdrDyLdSem.c \
|
---|
111 | kStuff/kLdr/kLdrMod.c \
|
---|
112 | kStuff/kLdr/kLdrModLX.c \
|
---|
113 | kStuff/kLdr/kLdrModMachO.c \
|
---|
114 | kStuff/kLdr/kLdrModNative.c \
|
---|
115 | kStuff/kLdr/kLdrModPE.c
|
---|
116 | kLdr_SOURCES.os2 += \
|
---|
117 | kStuff/kLdr/kLdr-os2.c \
|
---|
118 | kStuff/kLdr/kLdrA-os2.asm
|
---|
119 | kLdr_SOURCES.win += \
|
---|
120 | kStuff/kLdr/kLdr-win.c
|
---|
121 |
|
---|
122 | # kRdr
|
---|
123 | kStuff_SOURCES += \
|
---|
124 | kStuff/kRdr/kRdr.cpp \
|
---|
125 | kStuff/kRdr/kRdrFile.cpp \
|
---|
126 | kStuff/kRdr/kRdrBuffered.cpp
|
---|
127 |
|
---|
128 | # kCpu
|
---|
129 | kStuff_SOURCES += \
|
---|
130 | kStuff/kCpu/kCpuCompare.c \
|
---|
131 | kStuff/kCpu/kCpuGetArchAndCpu.c
|
---|
132 |
|
---|
133 | # kHlp (CRT)
|
---|
134 | kStuff_SOURCES += \
|
---|
135 | kStuff/kHlp/Generic/kHlpMemPComp.c \
|
---|
136 | kStuff/kHlp/Generic/kHlpMemICompAscii.c \
|
---|
137 | kStuff/kHlp/Generic/kHlpStrPCat.c \
|
---|
138 | kStuff/kHlp/Generic/kHlpStrNPCat.c \
|
---|
139 | kStuff/kHlp/Generic/kHlpStrPComp.c \
|
---|
140 | kStuff/kHlp/Generic/kHlpStrNPComp.c \
|
---|
141 | kStuff/kHlp/Generic/kHlpStrICompAscii.c \
|
---|
142 | kStuff/kHlp/Generic/kHlpStrIPCompAscii.c \
|
---|
143 | kStuff/kHlp/Generic/kHlpStrNICompAscii.c \
|
---|
144 | kStuff/kHlp/Generic/kHlpStrNIPCompAscii.c \
|
---|
145 | kStuff/kHlp/Generic/kHlpStrPCopy.c \
|
---|
146 | kStuff/kHlp/Generic/kHlpStrNLen.c \
|
---|
147 | kStuff/kHlp/Generic/kHlpInt2Ascii.c \
|
---|
148 | \
|
---|
149 | kStuff/kHlp/Generic/kHlpGetEnvUZ.c \
|
---|
150 | \
|
---|
151 | kStuff/kHlp/Generic/kHlpGetExt.c \
|
---|
152 | kStuff/kHlp/Generic/kHlpGetFilename.c \
|
---|
153 | kStuff/kHlp/Generic/kHlpIsFilenameOnly.c \
|
---|
154 | \
|
---|
155 | kStuff/kHlp/Generic/kHlpPage.c \
|
---|
156 | \
|
---|
157 | kStuff/kHlp/CRT/kHlpCRTAlloc.cpp \
|
---|
158 | kStuff/kHlp/CRT/kHlpCRTEnv.cpp \
|
---|
159 | kStuff/kHlp/CRT/kHlpCRTString.cpp
|
---|
160 | kStuff_SOURCES.darwin += \
|
---|
161 | kStuff/kHlp/Bare/kHlpSys-darwin.c
|
---|
162 |
|
---|
163 |
|
---|
164 | #
|
---|
165 | # A couple of dummy DLLs we use for grabbing LDR TLS entries.
|
---|
166 | #
|
---|
167 | DLLS += kWorkerTls1K kWorkerTls1K01 kWorkerTls1K02 kWorkerTls1K03 kWorkerTls1K04 kWorkerTls1K05 kWorkerTls1K06 kWorkerTls1K07 \
|
---|
168 | kWorkerTls1K08 kWorkerTls1K09 kWorkerTls1K10 kWorkerTls1K11 kWorkerTls1K12 kWorkerTls1K13 kWorkerTls1K14 kWorkerTls1K15
|
---|
169 | kWorkerTls1K_TEMPLATE = BIN-STATIC-THREADED
|
---|
170 | kWorkerTls1K_DEFS = TLS_SIZE=1024
|
---|
171 | kWorkerTls1K_SOURCES = kWorkerTlsXxxK.c
|
---|
172 | kWorkerTls1K_LDFLAGS = /Entry:DummyDllEntry
|
---|
173 |
|
---|
174 | kWorkerTls1K01_EXTENDS = kWorkerTls1K
|
---|
175 | kWorkerTls1K02_EXTENDS = kWorkerTls1K
|
---|
176 | kWorkerTls1K03_EXTENDS = kWorkerTls1K
|
---|
177 | kWorkerTls1K04_EXTENDS = kWorkerTls1K
|
---|
178 | kWorkerTls1K05_EXTENDS = kWorkerTls1K
|
---|
179 | kWorkerTls1K06_EXTENDS = kWorkerTls1K
|
---|
180 | kWorkerTls1K07_EXTENDS = kWorkerTls1K
|
---|
181 | kWorkerTls1K08_EXTENDS = kWorkerTls1K
|
---|
182 | kWorkerTls1K09_EXTENDS = kWorkerTls1K
|
---|
183 | kWorkerTls1K10_EXTENDS = kWorkerTls1K
|
---|
184 | kWorkerTls1K11_EXTENDS = kWorkerTls1K
|
---|
185 | kWorkerTls1K12_EXTENDS = kWorkerTls1K
|
---|
186 | kWorkerTls1K13_EXTENDS = kWorkerTls1K
|
---|
187 | kWorkerTls1K14_EXTENDS = kWorkerTls1K
|
---|
188 | kWorkerTls1K15_EXTENDS = kWorkerTls1K
|
---|
189 |
|
---|
190 |
|
---|
191 | DLLS += kWorkerTls64K kWorkerTls64K01 kWorkerTls64K02 kWorkerTls64K03 kWorkerTls64K04 kWorkerTls64K05 kWorkerTls64K06 kWorkerTls64K07
|
---|
192 | kWorkerTls64K_TEMPLATE = BIN-STATIC-THREADED
|
---|
193 | kWorkerTls64K_DEFS = TLS_SIZE=65536
|
---|
194 | kWorkerTls64K_SOURCES = kWorkerTlsXxxK.c
|
---|
195 | kWorkerTls64K_LDFLAGS = /Entry:DummyDllEntry
|
---|
196 |
|
---|
197 | kWorkerTls64K01_EXTENDS = kWorkerTls64K
|
---|
198 | kWorkerTls64K02_EXTENDS = kWorkerTls64K
|
---|
199 | kWorkerTls64K03_EXTENDS = kWorkerTls64K
|
---|
200 | kWorkerTls64K04_EXTENDS = kWorkerTls64K
|
---|
201 | kWorkerTls64K05_EXTENDS = kWorkerTls64K
|
---|
202 | kWorkerTls64K06_EXTENDS = kWorkerTls64K
|
---|
203 | kWorkerTls64K07_EXTENDS = kWorkerTls64K
|
---|
204 |
|
---|
205 |
|
---|
206 | DLLS += kWorkerTls128K kWorkerTls128K01 kWorkerTls128K02 kWorkerTls128K03 kWorkerTls128K04 kWorkerTls128K05 kWorkerTls128K06 kWorkerTls128K07
|
---|
207 | kWorkerTls128K_TEMPLATE = BIN-STATIC-THREADED
|
---|
208 | kWorkerTls128K_DEFS = TLS_SIZE=131072
|
---|
209 | kWorkerTls128K_SOURCES = kWorkerTlsXxxK.c
|
---|
210 | kWorkerTls128K_LDFLAGS = /Entry:DummyDllEntry
|
---|
211 |
|
---|
212 | kWorkerTls128K01_EXTENDS = kWorkerTls128K
|
---|
213 | kWorkerTls128K02_EXTENDS = kWorkerTls128K
|
---|
214 | kWorkerTls128K03_EXTENDS = kWorkerTls128K
|
---|
215 | kWorkerTls128K04_EXTENDS = kWorkerTls128K
|
---|
216 | kWorkerTls128K05_EXTENDS = kWorkerTls128K
|
---|
217 | kWorkerTls128K06_EXTENDS = kWorkerTls128K
|
---|
218 | kWorkerTls128K07_EXTENDS = kWorkerTls128K
|
---|
219 |
|
---|
220 |
|
---|
221 | DLLS += kWorkerTls512K kWorkerTls512K01 kWorkerTls512K02 kWorkerTls512K03 kWorkerTls512K04 kWorkerTls512K05 kWorkerTls512K06 kWorkerTls512K07
|
---|
222 | kWorkerTls512K_TEMPLATE = BIN-STATIC-THREADED
|
---|
223 | kWorkerTls512K_DEFS = TLS_SIZE=524288
|
---|
224 | kWorkerTls512K_SOURCES = kWorkerTlsXxxK.c
|
---|
225 | kWorkerTls512K_LDFLAGS = /Entry:DummyDllEntry
|
---|
226 |
|
---|
227 | kWorkerTls512K01_EXTENDS = kWorkerTls512K
|
---|
228 | kWorkerTls512K02_EXTENDS = kWorkerTls512K
|
---|
229 | kWorkerTls512K03_EXTENDS = kWorkerTls512K
|
---|
230 | kWorkerTls512K04_EXTENDS = kWorkerTls512K
|
---|
231 | kWorkerTls512K05_EXTENDS = kWorkerTls512K
|
---|
232 | kWorkerTls512K06_EXTENDS = kWorkerTls512K
|
---|
233 | kWorkerTls512K07_EXTENDS = kWorkerTls512K
|
---|
234 |
|
---|
235 |
|
---|
236 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
237 |
|
---|