source: trunk/src/win32k/win32k.mak@ 4772

Last change on this file since 4772 was 4715, checked in by bird, 25 years ago

Adapted to be more comform with the new makefile style.
Most subdirectories are now using the style while the win32k.sys makefile
is not at all - as allways.

File size: 10.8 KB
Line 
1# $Id: win32k.mak,v 1.1 2000-12-02 23:32:38 bird Exp $
2
3#
4# Win32k.sys makefile.
5#
6# Copyright 1998-2000 knut st. osmundsen
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)\d32hlp.obj \
41 $(WIN32KOBJ)\d32globals.obj \
42 $(WIN32KOBJ)\d16globl.obj \
43 $(WIN32KOBJ)\abort.obj \
44 $(WIN32KOBJ)\asmutils.obj \
45 $(WIN32KOBJ)\calltaba.obj \
46 $(WIN32KOBJ)\malloc.obj \
47 $(WIN32KOBJ)\smalloc_avl.obj \
48 $(WIN32KOBJ)\avl.obj \
49 $(WIN32KOBJ)\rmalloc_avl.obj \
50 $(WIN32KOBJ)\new.obj \
51 $(WIN32KOBJ)\env.obj \
52 $(WIN32KOBJ)\stricmp.obj \
53 $(WIN32KOBJ)\yield.obj \
54 $(WIN32KOBJ)\vsprintf.obj \
55 $(WIN32KOBJ)\vprintf.obj \
56 $(WIN32KOBJ)\ldr.obj \
57 $(WIN32KOBJ)\myldrClose.obj \
58 $(WIN32KOBJ)\myldrOpen.obj \
59 $(WIN32KOBJ)\myldrRead.obj \
60 $(WIN32KOBJ)\myLDRQAppType.obj \
61 $(WIN32KOBJ)\myldrEnum32bitRelRecs.obj \
62 $(WIN32KOBJ)\myldrOpenPath.obj \
63 $(WIN32KOBJ)\myldrOpenPatha.obj \
64 $(WIN32KOBJ)\OS2KTCB.obj \
65 $(WIN32KOBJ)\OS2KPTDA.obj \
66 $(WIN32KOBJ)\pe2lx.obj \
67 $(WIN32KOBJ)\ModuleBase.obj \
68 $(WIN32KOBJ)\d32ElfIOCtl.obj \
69 $(WIN32KOBJ)\d32Win32kIOCtl.obj \
70 $(WIN32KOBJ)\k32AllocMemEx.obj \
71 $(WIN32KOBJ)\k32ProcessReadWrite.obj \
72 $(WIN32KOBJ)\k32QueryOTEs.obj \
73 $(WIN32KOBJ)\k32QueryOptionsStatus.obj \
74 $(WIN32KOBJ)\k32SetOptions.obj \
75 $(WIN32KOBJ)\mytkExecPgm.obj \
76 $(WIN32KOBJ)\mytkStartProcess.obj \
77 $(WIN32KOBJ)\vprntf16.obj \
78 $(WIN32KOBJ)\d32init.obj \
79 $(WIN32KOBJ)\SymDB.obj \
80 $(WIN32KOBJ)\d16init.obj_init \
81 $(WIN32KOBJ)\ProbKrnl.obj_init
82
83LASTOBJ =\
84 $(WIN32KOBJ)\devlast.obj
85
86LIBS =\
87 $(VACPATH)\lib\$(RTLLIB_NRE) \
88 $(DDKPATH)\lib\os2386.lib \
89 $(WIN32KOBJ)\devhelp.lib \
90 $(WIN32KOBJ)\clib.lib
91
92
93#
94# Win32k.sys rule. (Don't mess with the order or objects and libraries!)
95#
96$(NAME).sys: $(WIN32KBIN)\$(NAME).sys
97
98$(WIN32KBIN)\$(NAME).sys: clfix.exe \
99 $(WIN32KINCLUDE)\options.inc \
100 $(OBJS) \
101 $(LIBS) \
102 $(WIN32KOBJ)\$(NAME)new.def \
103 $(LASTOBJ) \
104 $(LIBSINIT) \
105 win32k.mak makefile.inc ..\..\makefile.inc
106 -@$(ECHO) recompiling d16globl to get correct build time and date:
107 $(CC16) -c $(CFLAGS16) $(CDEFINES16) $(CINCLUDES16) -Fo$(WIN32KOBJ)\d16globl.obj \
108 -Fa$(WIN32KLIST)\d16globl.s dev16\d16globl.c
109 -@$(ECHO) linking: $@
110 -4 $(LD) $(LFLAGS) @<<$(WIN32KOBJ)\$(@B).lnk
111/OUT:$@
112/MAP:$(WIN32KBIN)\$(@B).map
113$(OBJS: =^
114)
115/IG
116$(LIBS: =^
117)
118$(LASTOBJ)
119$(WIN32KOBJ)\$(NAME)new.def
120<<KEEP
121 cd $(WIN32KBIN)
122 @mapsym $(*B).map > nul
123 cd $(WIN32KBASE)
124 if not exist $(ODIN32_BIN) $(CREATEPATH) $(ODIN32_BIN)
125 $(CP) $@ $(ODIN32_BIN)
126 $(CP) $*.sym $(ODIN32_BIN)
127 $(CP) $(WIN32KBASE)\$(*B).ddp $(ODIN32_BIN)
128
129# Add bldlevel signature to win32k.def - creates temporary win32knew.def.
130$(WIN32KOBJ)\$(NAME)new.def: $(NAME).def makefile MakeDesc.cmd
131 -$(ECHO) Creates $@ with bldlevel signature string.
132 @$(CP) $(NAME).def $@
133 @MakeDesc.cmd $@ "ODIN" "0.05" "Odin32 Ring-0 support driver - copyright (c) 1998-2000 knut st. osmundsen"
134
135
136
137#
138# Win32ktst.exe object configuration.
139# (It should be as identical as possible to win32k.sys.)
140# (Don't mess with the order or objects and libraries!)
141#
142TSTOBJS =\
143 $(WIN32KOBJ)\devfirst.obj \
144 $(WIN32KOBJ)\$(NAME)tst.obj \
145 $(WIN32KOBJ)\dh.obj \
146 $(WIN32KOBJ)\dos.obj \
147 $(WIN32KOBJ)\dosa.obj \
148 $(WIN32KOBJ)\init.obj \
149 $(WIN32KOBJ)\fake.obj \
150 $(WIN32KOBJ)\fakea.obj \
151 $(WIN32KOBJ)\TstFakers.obj \
152 $(WIN32KOBJ)\d16strat.obj \
153 $(WIN32KOBJ)\d32hlp.obj \
154 $(WIN32KOBJ)\d32globals.obj \
155 $(WIN32KOBJ)\d16globl.obj \
156 $(WIN32KOBJ)\abort.obj \
157 $(WIN32KOBJ)\asmutils.obj \
158 $(WIN32KOBJ)\calltaba.obj \
159 $(WIN32KOBJ)\malloc.obj_tst \
160 $(WIN32KOBJ)\smalloc_avl.obj \
161 $(WIN32KOBJ)\avl.obj \
162 $(WIN32KOBJ)\rmalloc_avl.obj \
163 $(WIN32KOBJ)\new.obj \
164 $(WIN32KOBJ)\env.obj \
165 $(WIN32KOBJ)\stricmp.obj \
166 $(WIN32KOBJ)\yield.obj \
167 $(WIN32KOBJ)\vsprintf.obj \
168 $(WIN32KOBJ)\vprintf.obj_tst \
169 $(WIN32KOBJ)\ldr.obj \
170 $(WIN32KOBJ)\myldrClose.obj \
171 $(WIN32KOBJ)\myldrOpen.obj \
172 $(WIN32KOBJ)\myldrRead.obj \
173 $(WIN32KOBJ)\myLDRQAppType.obj \
174 $(WIN32KOBJ)\myldrEnum32bitRelRecs.obj \
175 $(WIN32KOBJ)\myldrOpenPath.obj \
176 $(WIN32KOBJ)\myldrOpenPatha.obj \
177 $(WIN32KOBJ)\OS2KTCB.obj \
178 $(WIN32KOBJ)\OS2KPTDA.obj \
179 $(WIN32KOBJ)\pe2lx.obj \
180 $(WIN32KOBJ)\ModuleBase.obj \
181 $(WIN32KOBJ)\d32ElfIOCtl.obj \
182 $(WIN32KOBJ)\d32Win32kIOCtl.obj \
183 $(WIN32KOBJ)\k32AllocMemEx.obj \
184 $(WIN32KOBJ)\k32ProcessReadWrite.obj \
185 $(WIN32KOBJ)\k32QueryOTEs.obj \
186 $(WIN32KOBJ)\k32QueryOptionsStatus.obj \
187 $(WIN32KOBJ)\k32SetOptions.obj \
188 $(WIN32KOBJ)\mytkExecPgm.obj \
189 $(WIN32KOBJ)\mytkStartProcess.obj \
190 $(WIN32KOBJ)\vprntf16.obj_tst \
191 $(WIN32KOBJ)\d32init.obj_tst \
192 $(WIN32KOBJ)\SymDB.obj \
193 $(WIN32KOBJ)\d16init.obj_tst_init \
194 $(WIN32KOBJ)\ProbKrnl.obj_tst_init
195
196TSTLASTOBJ = $(LASTOBJ)
197
198TSTLIBS = $(LIBS)
199
200
201#
202# Win32ktst.exe rule.
203# This is a test executable; win32k.sys wrapped into an executable with emulation
204# code for most of the OS/2 kernel dependencies.
205#
206$(NAME)tst.exe: $(WIN32KBIN)\$(NAME)tst.exe
207 $(CP) $(WIN32KBIN)\$@ $@
208$(WIN32KBIN)\$(NAME)tst.exe: clfix.exe \
209 Test\TstFakers.c \
210 $(NAME)tst.def \
211 $(TSTOBJS) \
212 $(TSTLIBS) \
213 $(LASTOBJS) \
214 makefile makefile.inc ..\..\makefile.inc
215 -@$(ECHO) linking: $@
216 -4 $(LD) $(LFLAGS) @<<$(WIN32KOBJ)\$(@B).lnk
217/DEBUG
218/OUT:$@
219/MAP:$(WIN32KBIN)\$(@B).map
220$(TSTOBJS: =^
221)
222/IG
223$(TSTLIBS: =^
224)
225$(LASTOBJ)
226$(NAME)tst.def
227<<KEEP
228
229
230
231#
232#
233# L i b r a r i e s
234#
235#
236
237#
238# Libraries - segments are renamed for the 16-bit libraries.
239#
240
241# List of object files in the converted devhelp library.
242DHLPOBJS = +$(WIN32KOBJ)\dhcall5b.obj +$(WIN32KOBJ)\dhcal11a.obj \
243 +$(WIN32KOBJ)\dhcal11g.obj +$(WIN32KOBJ)\dhret.obj
244
245# Make corrected devhelp library with only the required object files.
246$(WIN32KOBJ)\devhelp.lib: $(DDKPATH)\lib\dhcalls.lib $(WIN32KBIN)\libconv.exe $(DHLPOBJS:+=)
247 @$(RM) $@
248 @cd $(WIN32KOBJ)
249 $(DDKPATH)\tools\lib /nologo $@ $(DHLPOBJS);
250 @cd $(MAKEDIR)
251
252# Convert devhelp library.
253$(WIN32KOBJ)\devhelp_.lib: $(DDKPATH)\lib\dhcalls.lib
254 $(WIN32KBIN)\libconv $** $@
255
256# Extract required object files from the converted devhelp library.
257$(DHLPOBJS:+=): $(WIN32KOBJ)\devhelp_.lib
258 @cd $(WIN32KOBJ)
259 $(DDKPATH)\tools\lib /nologo $** *$@;
260 @cd $(MAKEDIR)
261
262
263# List of object files in the converted crt library.
264CLIBOBJS = +$(WIN32KOBJ)\inp.obj +$(WIN32KOBJ)\outp.obj \
265 +$(WIN32KOBJ)\anfalmul.obj +$(WIN32KOBJ)\anfaldiv.obj \
266 +$(WIN32KOBJ)\anfalrem.obj +$(WIN32KOBJ)\anfauldi.obj \
267 +$(WIN32KOBJ)\anuldiv.obj +$(WIN32KOBJ)\fmemcpy.obj \
268 +$(WIN32KOBJ)\anulrem.obj +$(WIN32KOBJ)\anlmul.obj \
269 +$(WIN32KOBJ)\__AHINCR.obj +$(WIN32KOBJ)\anlshl.obj
270
271# Make corrected crt library with only the required object files.
272$(WIN32KOBJ)\clib.lib: $(MSCPATH)\lib\clibcep.lib $(WIN32KBIN)\libconv.exe $(CLIBOBJS:+=)
273 @$(RM) $@
274 @cd $(WIN32KOBJ)
275 $(DDKPATH)\tools\lib /nologo $@ $(CLIBOBJS);
276 @cd $(MAKEDIR)
277
278# Convert devhelp library.
279$(WIN32KOBJ)\clib_.lib: $(MSCPATH)\lib\clibcep.lib
280 $(WIN32KBIN)\libconv $** $@ > nul
281
282# Extract required object files from the converted crt library.
283$(CLIBOBJS:+=): $(WIN32KOBJ)\clib_.lib
284 @cd $(WIN32KOBJ)
285 $(ILIB) $** *$@;
286 @cd $(MAKEDIR)
287
288
289#
290# Make last library.
291#
292$(WIN32KOBJ)\last.lib: $(WIN32KOBJ)\devlast.obj
293 -@$(RM) $@ > nul 2> nul
294 $(ILIB) $@ $**;
295
296
297#
298#
299# S o u r c e
300#
301#
302
303#
304# Generate calltaba.asm
305#
306ldr\calltaba.asm: dev16\probkrnl.c $(WIN32KBIN)\mkcalltab.exe
307 $(WIN32KBIN)\mkcalltab.exe calltab > $@
308
309
310#
311# Generate TstFakers.c
312#
313test\TstFakers.c: dev16\probkrnl.c include\probkrnl.h $(WIN32KBIN)\mkcalltab.exe
314 $(WIN32KBIN)\mkcalltab.exe tstfakers > $@
315
316
317#
318# Make assembly version of options.h; options.inc
319#
320$(WIN32KINCLUDE)\options.inc: $(WIN32KINCLUDE)\options.h
321 @$(ECHO) H2Inc: $**
322 $(H2INC) $** > $@
323
324
325#
326#
327# T o o l s
328#
329#
330
331#
332# Make the convert tool.
333#
334$(WIN32KBIN)\libconv.exe: libconv.c
335 icc -Q+ -Ti+ -Fe$@ -Fo$(WIN32KOBJ)\$(*B).obj libconv.c
336
337
338#
339# Make the MkCallTab.exe utillity.
340#
341
342# MkCallTab objects.
343MKCALLTABOBJS = \
344 $(WIN32KOBJ)\mkcalltab.obj_c \
345 $(WIN32KOBJ)\probkrnl.obj_c \
346 $(WIN32KOBJ)\d16globl.obj_c \
347 $(WIN32KOBJ)\vprntf16.obj_c
348
349# Rule to build MkCallTab.exe
350$(WIN32KBIN)\mkcalltab.exe: clfix.exe $(MKCALLTABOBJS)
351 $(LD) $(LFLAGS) /pmtype:vio @<<$(WIN32KOBJ)\$(@B).lnk
352 /OUT:$@
353 /MAP:$(WIN32KBIN)\$(@B).map
354 $(MKCALLTABOBJS)
355 $(TOOLKIT)\lib\os2286.lib
356 $(MSCPATH)\lib\clibcep.lib
357<<keep
358
359# Interference rule to make the MkCallTab objects.
360{dev16}.c.obj_c:
361 @$(ECHO) compiling 16bit (mkcalltab): $<
362 @$(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fo$@ -Fa -Zi -Od -Lp -DDEBUG -DEXTRACT \
363 -Fa$(WIN32KLIST)\$(*B)_c.s -Fo$(WIN32KOBJ)\$(@B).obj_c $(CINCLUDES16) $<
364
365
366#
367# Make the clfix.exe utillity - clfix.exe
368# This should fix some of the problems we are experiencing with the
369# MSC v6.0a compiler (cl.exe) (16-bit).
370#
371clfix.exe: clfix.c
372 $(CC) $(@B).c
373
374
375#
376# Make the symbol extract utillity - Extract.exe
377#
378
379# Extract object files.
380EXTRACTOBJS = \
381 $(WIN32KOBJ)\extract.obj_e \
382 $(WIN32KOBJ)\probkrnl.obj_e \
383 $(WIN32KOBJ)\d16globl.obj_e \
384 $(WIN32KOBJ)\vprntf16.obj_e
385
386# Rules to build Extract.exe.
387$(WIN32KBIN)\extract.exe: clfix.exe $(EXTRACTOBJS)
388 $(LD) $(LFLAGS) /pmtype:vio @<<$(WIN32KOBJ)\$(@B).lnk
389 /OUT:$@
390 /MAP:$(WIN32KBIN)\$(@B).map
391 $(EXTRACTOBJS)
392 $(TOOLKIT)\lib\os2286.lib
393 $(MSCPATH)\lib\clibcep.lib
394<<keep
395
396# Copy rule.
397extract.exe: $(WIN32KBIN)\extract.exe
398 $(CP) $** $@
399
400# Interference rule to make the Extract objects.
401{dev16}.c.obj_e:
402 @$(ECHO) compiling 16bit (extract): $<
403 @$(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fo$@ -Fa -Zi -Od -Lp -DDEBUG -DEXTRACT \
404 -Fa$(WIN32KLIST)\$(*B)_e.s -Fo$(WIN32KOBJ)\$(@B).obj_e $(CINCLUDES16) $<
405
406
407
408
409#
410# Include the .depend file.
411#
412!if [$(EXISTS) .depend] == 0
413! include .depend
414!else
415! if [$(ECHO) .depend doesn't exist]
416! endif
417!endif
418
Note: See TracBrowser for help on using the repository browser.