source: branches/splittup/src/win32k/win32k.mak@ 7029

Last change on this file since 7029 was 6843, checked in by bird, 24 years ago

LASTLIB not LASTOBJ.

File size: 10.3 KB
Line 
1# $Id: win32k.mak,v 1.13.2.2 2001-09-27 03:27:18 bird Exp $
2
3#
4# Win32k.sys makefile.
5#
6# Copyright 1998-2001 knut st. osmundsen (kosmunds@csc.com)
7#
8# Project Odin Software License can be found in LICENSE.TXT
9#
10
11
12#
13# Include path definitions, common stuff and our own tools.
14#
15!include makefile.inc
16!include ../../makefile.inc
17!include win32k.tools.mk
18
19
20#
21# Main targetname
22#
23NAME = Win32k
24
25
26#
27# Main rules.
28#
29!if "$(DDKPATH)" == "" || "$(MSCPATH)" == "" || "$(TOOLKIT)" == "" || "$(VACPATH)" == ""
30all: $(WIN32KBIN)\$(NAME).sys
31!endif
32
33
34#
35# Win32k.sys objects and libraries - Don't mess with the order or objects and libraries!
36#
37OBJS =\
38 $(WIN32KOBJ)\devfirst.obj \
39 $(WIN32KOBJ)\d16strat.obj \
40 $(WIN32KOBJ)\d32CallGate.obj \
41 $(WIN32KOBJ)\d32globals.obj \
42 $(WIN32KOBJ)\d16globl.obj \
43 $(WIN32KOBJ)\PerTaskW32kData.obj \
44 $(WIN32KOBJ)\ldr.obj \
45 $(WIN32KOBJ)\myldrClose.obj \
46 $(WIN32KOBJ)\myldrOpen.obj \
47 $(WIN32KOBJ)\myldrRead.obj \
48 $(WIN32KOBJ)\myLDRQAppType.obj \
49 $(WIN32KOBJ)\myldrEnum32bitRelRecs.obj \
50 $(WIN32KOBJ)\myldrOpenPath.obj \
51 $(WIN32KOBJ)\myldrOpenPatha.obj \
52 $(WIN32KOBJ)\myldrFindModule.obj \
53 $(WIN32KOBJ)\myldrCheckInternalName.obj \
54 $(WIN32KOBJ)\myldrGetFileName.obj \
55 $(WIN32KOBJ)\d32Events.obj \
56 $(WIN32KOBJ)\pe2lx.obj \
57 $(WIN32KOBJ)\ModuleBase.obj \
58 $(WIN32KOBJ)\d32Win32kIOCtl.obj \
59 $(WIN32KOBJ)\d32Win32kOpenClose.obj \
60 $(WIN32KOBJ)\k32AllocMemEx.obj \
61 $(WIN32KOBJ)\k32KillProcessEx.obj \
62 $(WIN32KOBJ)\k32HandleSystemEvent.obj \
63 $(WIN32KOBJ)\k32ProcessReadWrite.obj \
64 $(WIN32KOBJ)\k32QueryCallGate.obj \
65 $(WIN32KOBJ)\k32QueryOTEs.obj \
66 $(WIN32KOBJ)\k32QueryOptionsStatus.obj \
67 $(WIN32KOBJ)\k32QuerySystemMemInfo.obj \
68 $(WIN32KOBJ)\k32SetEnvironment.obj \
69 $(WIN32KOBJ)\k32SetOptions.obj \
70 $(WIN32KOBJ)\mytkExecPgm.obj \
71 $(WIN32KOBJ)\mytkStartProcess.obj \
72 $(WIN32KOBJ)\vprntf16.obj \
73 $(WIN32KOBJ)\d32init.obj \
74 $(WIN32KOBJ)\d16init.obj_init
75
76LASTOBJ =\
77 $(WIN32KOBJ)\devlast.obj
78
79LASTLIB = $(WIN32KOBJ)\lastlib.lib
80
81LIBS =\
82 $(ODIN32_LIB)\kKrnlLib.lib \
83 $(VACPATH)\lib\$(RTLLIB_NRE) \
84 $(DDKPATH)\lib\os2386.lib \
85 $(WIN32KOBJ)\devhelp.lib \
86 $(WIN32KOBJ)\clib.lib
87
88
89#
90# Win32k.sys rule. (Don't mess with the order or objects and libraries!)
91#
92$(NAME).sys: $(WIN32KBIN)\$(NAME).sys
93
94$(WIN32KBIN)\$(NAME).sys: $(WIN32KBIN)\clfix.exe \
95 $(WIN32KINCLUDE)\options.inc \
96 $(WIN32KINCLUDE)\api.inc \
97 $(WIN32KINCLUDE)\win32k.inc \
98 $(OBJS) \
99 $(LIBS) \
100 $(WIN32KOBJ)\$(NAME)bldlevel.def \
101 $(LASTLIB) \
102 $(LIBSINIT) \
103 $(WIN32KOBJ)\$(@B).lnk \
104 win32k.mak makefile.inc ..\..\makefile.inc
105 -@$(ECHO) recompiling d16globl to get correct build time and date:
106 $(CC16) -c $(CFLAGS16) $(CDEFINES16) $(CINCLUDES16) -Fo$(WIN32KOBJ)\d16globl.obj \
107 -Fa$(WIN32KLIST)\d16globl.s dev16\d16globl.c
108 -@$(ECHO) linking: $@
109!ifdef GREP
110 -4 $(LD) /FORCE $(LFLAGS) @$(WIN32KOBJ)\$(@B).lnk | $(GREP) -v LNK4001 | $(GREP) -v LNK4031
111!else
112 -4 $(LD) $(LFLAGS) @$(WIN32KOBJ)\$(@B).lnk
113!endif
114 cd $(WIN32KBIN)
115 @mapsym $(*B).map > nul
116 cd $(WIN32KBASE)
117 if not exist $(ODIN32_BIN) $(CREATEPATH) $(ODIN32_BIN)
118 $(CP) $@ $(ODIN32_BIN)
119 $(CP) $*.sym $(ODIN32_BIN)
120 $(CP) $(WIN32KBASE)\$(*B).ddp $(ODIN32_BIN)
121
122# Linker file.
123$(WIN32KOBJ)\$(NAME).lnk: win32k.mak makefile.inc ..\..\makefile.inc
124 echo Creating linkerfile: @<<$(WIN32KOBJ)\$(NAME).lnk
125/OUT:$(WIN32KBIN)\$(NAME).sys
126/MAP:$(WIN32KBIN)\$(NAME).map
127$(OBJS: =^
128)
129/IG
130$(LIBS: =^
131)
132$(LASTLIB)
133$(WIN32KOBJ)\$(NAME)bldlevel.def
134<<KEEP
135
136# Add bldlevel signature to win32k.def - creates temporary win32kbldlevel.def.
137$(WIN32KOBJ)\$(NAME)bldlevel.def: $(NAME).def win32k.mak
138 -$(ECHO) Creates $@ with bldlevel signature string.
139 $(BLDLEVELINF) $(NAME).def $@ -R"$(NAME).def" \
140 -V"#define=ODIN32_VERSION,$(ODIN32_INCLUDE)\odinbuild.h" \
141 -M"#define=ODIN32_BUILD_NR,$(ODIN32_INCLUDE)\odinbuild.h"
142
143# Last lib - needed to get LASTOBJ in after the importlibraries.
144$(LASTLIB): $(LASTOBJ)
145 -@$(RM) $@ > nul 2> nul
146 $(ILIB) $@ $**;
147
148
149#
150# Win32ktst.exe object configuration.
151# (It should be as identical as possible to win32k.sys.)
152# (Don't mess with the order or objects and libraries!)
153#
154TSTOBJS =\
155 $(WIN32KOBJ)\devfirst.obj \
156 $(WIN32KOBJ)\d16strat.obj \
157 $(WIN32KOBJ)\d32CallGate.obj \
158 $(WIN32KOBJ)\d32hlp.obj \
159 $(WIN32KOBJ)\d32globals.obj \
160 $(WIN32KOBJ)\d16globl.obj \
161 $(WIN32KOBJ)\asmutils.obj \
162 $(WIN32KOBJ)\locks.obj \
163 $(WIN32KOBJ)\PerTaskW32kData.obj \
164 $(WIN32KOBJ)\ldr.obj \
165 $(WIN32KOBJ)\myldrClose.obj \
166 $(WIN32KOBJ)\myldrOpen.obj \
167 $(WIN32KOBJ)\myldrRead.obj \
168 $(WIN32KOBJ)\myLDRQAppType.obj \
169 $(WIN32KOBJ)\myldrEnum32bitRelRecs.obj \
170 $(WIN32KOBJ)\myldrOpenPath.obj \
171 $(WIN32KOBJ)\myldrOpenPatha.obj \
172 $(WIN32KOBJ)\myldrFindModule.obj \
173 $(WIN32KOBJ)\myldrCheckInternalName.obj \
174 $(WIN32KOBJ)\myldrGetFileName.obj \
175 $(WIN32KOBJ)\d32Events.obj \
176 $(WIN32KOBJ)\OS2KTCB.obj \
177 $(WIN32KOBJ)\OS2KPTDA.obj \
178 $(WIN32KOBJ)\pe2lx.obj \
179 $(WIN32KOBJ)\ModuleBase.obj \
180 $(WIN32KOBJ)\d32Win32kIOCtl.obj \
181 $(WIN32KOBJ)\d32Win32kOpenClose.obj \
182 $(WIN32KOBJ)\k32AllocMemEx.obj \
183 $(WIN32KOBJ)\k32KillProcessEx.obj \
184 $(WIN32KOBJ)\k32HandleSystemEvent.obj \
185 $(WIN32KOBJ)\k32ProcessReadWrite.obj \
186 $(WIN32KOBJ)\k32QueryCallGate.obj \
187 $(WIN32KOBJ)\k32QueryOTEs.obj \
188 $(WIN32KOBJ)\k32QueryOptionsStatus.obj \
189 $(WIN32KOBJ)\k32QuerySystemMemInfo.obj \
190 $(WIN32KOBJ)\k32SetEnvironment.obj \
191 $(WIN32KOBJ)\k32SetOptions.obj \
192 $(WIN32KOBJ)\mytkExecPgm.obj \
193 $(WIN32KOBJ)\mytkStartProcess.obj \
194 $(WIN32KOBJ)\vprntf16.obj_tst. \
195 $(WIN32KOBJ)\d32init.obj_tst. \
196 $(WIN32KOBJ)\d16init.obj_tst_init. \
197 $(WIN32KOBJ)\$(NAME)tst.obj \
198 $(WIN32KOBJ)\dh.obj \
199 $(WIN32KOBJ)\dos.obj \
200 $(WIN32KOBJ)\dosa.obj \
201 $(WIN32KOBJ)\init.obj \
202 $(WIN32KOBJ)\fake.obj \
203 $(WIN32KOBJ)\fakea.obj \
204
205TSTLASTOBJ = $(LASTOBJ)
206
207TSTLIBS = $(LIBS)
208
209
210#
211# Win32ktst.exe rule.
212# This is a test executable; win32k.sys wrapped into an executable with emulation
213# code for most of the OS/2 kernel dependencies.
214#
215$(NAME)tst.exe: $(WIN32KBIN)\$(NAME)tst.exe
216 $(CP) $(WIN32KBIN)\$@ $@
217$(WIN32KBIN)\$(NAME)tst.exe: clfix.exe \
218 Test\TstFakers.c \
219 $(NAME)tst.def \
220 $(TSTOBJS:. = ) \
221 $(TSTLIBS) \
222 $(TSTLASTOBJ) \
223 $(WIN32KOBJ)\$(@B).lnk \
224 win32k.mak makefile.inc ..\..\makefile.inc
225 -@$(ECHO) linking: $@
226!ifdef GREP
227 -4 $(LD) $(LFLAGS) @$(WIN32KOBJ)\$(@B).lnk | $(GREP) -v LNK4001 | $(GREP) -v LNK4031
228!else
229 -4 $(LD) $(LFLAGS) @$(WIN32KOBJ)\$(@B).lnk
230!endif
231
232# Linker file.
233$(WIN32KOBJ)\$(NAME)tst.lnk: win32k.mak makefile.inc ..\..\makefile.inc
234 echo Creating linkerfile: @<<$(WIN32KOBJ)\$(NAME)tst.lnk
235/DEBUG
236/OUT:$(WIN32KBIN)\$(NAME)tst.exe
237/MAP:$(WIN32KBIN)\$(NAME)tst.map
238$(TSTOBJS: =^
239)
240/IG
241$(TSTLIBS: =^
242)
243$(TSTLASTOBJ)
244$(NAME)tst.def
245<<KEEP
246
247
248
249#
250#
251# L i b r a r i e s
252#
253#
254
255#
256# Libraries - segments are renamed for the 16-bit libraries.
257#
258
259# List of object files in the converted devhelp library.
260DHLPOBJS = +$(WIN32KOBJ)\dhcall5b.obj +$(WIN32KOBJ)\dhcal11a.obj \
261 +$(WIN32KOBJ)\dhcal11g.obj +$(WIN32KOBJ)\dhret.obj
262
263# Make corrected devhelp library with only the required object files.
264$(WIN32KOBJ)\devhelp.lib: $(DDKPATH)\lib\dhcalls.lib $(WIN32KBIN)\libconv.exe $(DHLPOBJS:+=)
265 @$(RM) $@
266 @cd $(WIN32KOBJ)
267 $(DDKPATH)\tools\lib /nologo $@ $(DHLPOBJS);
268 @cd $(MAKEDIR)
269
270# Convert devhelp library.
271$(WIN32KOBJ)\devhelp_.lib: $(DDKPATH)\lib\dhcalls.lib
272 $(WIN32KBIN)\libconv $** $@
273
274# Extract required object files from the converted devhelp library.
275$(DHLPOBJS:+=): $(WIN32KOBJ)\devhelp_.lib
276 @cd $(WIN32KOBJ)
277 $(DDKPATH)\tools\lib /nologo $** *$@;
278 @cd $(MAKEDIR)
279
280
281# List of object files in the converted crt library.
282CLIBOBJS = +$(WIN32KOBJ)\inp.obj +$(WIN32KOBJ)\outp.obj \
283 +$(WIN32KOBJ)\anfalmul.obj +$(WIN32KOBJ)\anfaldiv.obj \
284 +$(WIN32KOBJ)\anfalrem.obj +$(WIN32KOBJ)\anfauldi.obj \
285 +$(WIN32KOBJ)\anuldiv.obj +$(WIN32KOBJ)\fmemcpy.obj \
286 +$(WIN32KOBJ)\anulrem.obj +$(WIN32KOBJ)\anlmul.obj \
287 +$(WIN32KOBJ)\__AHINCR.obj +$(WIN32KOBJ)\anlshl.obj
288
289# Make corrected crt library with only the required object files.
290$(WIN32KOBJ)\clib.lib: $(MSCPATH)\lib\clibcep.lib $(WIN32KBIN)\libconv.exe $(CLIBOBJS:+=)
291 @$(RM) $@
292 @cd $(WIN32KOBJ)
293 $(DDKPATH)\tools\lib /nologo $@ $(CLIBOBJS);
294 @cd $(MAKEDIR)
295
296# Convert devhelp library.
297$(WIN32KOBJ)\clib_.lib: $(MSCPATH)\lib\clibcep.lib
298 $(WIN32KBIN)\libconv $** $@ > nul
299
300# Extract required object files from the converted crt library.
301$(CLIBOBJS:+=): $(WIN32KOBJ)\clib_.lib
302 @cd $(WIN32KOBJ)
303 $(ILIB) $** *$@;
304 @cd $(MAKEDIR)
305
306
307#
308# Make last library.
309#
310$(WIN32KOBJ)\last.lib: $(WIN32KOBJ)\devlast.obj
311 -@$(RM) $@ > nul 2> nul
312 $(ILIB) $@ $**;
313
314
315#
316#
317# S o u r c e
318#
319#
320
321#
322# Make assembly version of options.h; options.inc
323#
324$(WIN32KINCLUDE)\options.inc: $(WIN32KINCLUDE)\options.h
325 @$(ECHO) H2Inc: $**
326 $(H2INC) $** > $@
327
328
329#
330# Make assembly version of api.h; api.inc
331#
332$(WIN32KINCLUDE)\api.inc: $(WIN32KINCLUDE)\api.h
333 @$(ECHO) H2Inc: $**
334 $(H2INC) $** > $@
335
336#
337# Make assembly version of win32k.h; win32k.inc
338#
339$(WIN32KINCLUDE)\win32k.inc: $(ODIN32_INCLUDE)\win32k.h
340 @$(ECHO) H2Inc: $**
341 $(H2INC) $** > $@
342
343
344#
345#
346# T o o l s
347#
348#
349
350#
351# Make the convert tool.
352#
353$(WIN32KBIN)\libconv.exe: kKrnlLib\tools\libconv.c
354 icc -Q+ -Ti+ -Fe$@ -Fo$(WIN32KOBJ)\$(*B).obj $**
355
356
357#
358# Make the clfix.exe utillity - clfix.exe
359# This should fix some of the problems we are experiencing with the
360# MSC v6.0a compiler (cl.exe) (16-bit).
361#
362$(WIN32KBIN)\clfix.exe: kKrnlLib\tools\clfix.c
363 icc -Q+ -Ti+ -Fe$@ -Fo$(WIN32KOBJ)\$(*B).obj $**
364
365
366#
367# Include the .depend file.
368#
369!if [$(EXISTS) .depend] == 0
370! include .depend
371!else
372! if [$(ECHO) .depend doesn't exist]
373! endif
374!endif
375
Note: See TracBrowser for help on using the repository browser.