*** empty log message ***
[reactos.git] / reactos / ntoskrnl / makefile_rex
1 # $Id: makefile_rex,v 1.52 2000/02/24 23:31:27 ea Exp $
2 #
3 # ReactOS Operating System
4 #
5 TARGET=ntoskrnl
6
7 BASE_CFLAGS = -I../include -D__NTOSKRNL__
8
9 all: objects $(TARGET).exe
10
11 #
12 # Defines $(HAL_OBJECTS)
13 #
14 include hal/x86/sources
15
16 NT_OBJECTS = nt/port.o nt/channel.o nt/ntevent.o nt/nttimer.o nt/atom.o \
17 nt/evtpair.o nt/ntsem.o nt/mutant.o nt/misc.o nt/plugplay.o \
18 nt/profile.o nt/nt.o nt/zw.o
19
20 RTL_OBJECTS = rtl/ctype.o rtl/interlck.o rtl/largeint.o rtl/list.o \
21 rtl/lookas.o rtl/mem.o rtl/memchr.o rtl/memcpy.o \
22 rtl/memmove.o rtl/memset.o rtl/nls.o rtl/regio.o \
23 rtl/return.o rtl/slist.o rtl/sprintf.o rtl/swprintf.o \
24 rtl/stdlib.o rtl/string.o rtl/time.o rtl/unalign.o \
25 rtl/unicode.o rtl/wstring.o
26
27 KE_OBJECTS = ke/main.o ke/timer.o ke/error.o ke/catch.o \
28 ke/dpc.o ke/wait.o ke/kqueue.o ke/dispatch.o \
29 ke/sem.o ke/critical.o ke/event.o ke/apc.o ke/bug.o \
30 ke/mutex.o ke/kernel.o ke/ldt.o \
31 ke/process.o ke/gdt.o ke/idt.o ke/udelay.o
32
33 KE_I386_OBJECTS = ke/i386/thread.o ke/i386/usercall.o ke/i386/exp.o
34
35 MM_OBJECTS = mm/mm.o mm/freelist.o mm/pool.o mm/virtual.o \
36 mm/mdl.o mm/zone.o mm/special.o mm/paging.o \
37 mm/section.o mm/marea.o mm/ppool.o mm/npool.o mm/pagefile.o
38
39 MM_I386_OBJECTS = mm/i386/page.o mm/i386/memsafe.o
40
41 IO_OBJECTS = io/iomgr.o io/create.o io/irp.o io/device.o io/rw.o \
42 io/queue.o io/drvlck.o io/timer.o io/share.o io/errlog.o \
43 io/shutdown.o io/fdisk.o io/cancel.o io/error.o io/arc.o \
44 io/dpc.o io/symlink.o io/adapter.o io/cntrller.o io/mdl.o \
45 io/resource.o io/event.o io/process.o io/file.o io/ioctrl.o \
46 io/fs.o io/vpb.o io/buildirp.o io/flush.o io/dir.o io/iocomp.o \
47 io/mailslot.o io/npipe.o io/lock.o io/page.o io/cleanup.o
48
49 OB_OBJECTS = ob/object.o ob/handle.o ob/namespc.o ob/ntobj.o ob/dirobj.o \
50 ob/security.o
51
52 PS_OBJECTS = ps/psmgr.o ps/thread.o ps/process.o ps/idle.o ps/kill.o \
53 ps/tinfo.o ps/create.o
54
55 EX_OBJECTS = ex/work.o ex/fmutex.o ex/resource.o ex/time.o ex/interlck.o \
56 ex/callback.o ex/napi.o ex/power.o ex/sysinfo.o ex/locale.o \
57 ex/stamp.o ex/init.o
58
59 FS_OBJECTS = fs/name.o fs/mcb.o fs/unc.o fs/util.o
60
61 SE_OBJECTS = se/semgr.o se/acl.o se/sid.o se/sd.o se/token.o se/luid.o \
62 se/priv.o
63
64 CM_OBJECTS = cm/registry.o
65
66 DBG_OBJECTS = dbg/brkpoint.o dbg/errinfo.o dbg/print.o
67
68 LDR_OBJECTS = ldr/loader.o ldr/init.o ldr/syspath.o ldr/sysdll.o ldr/rtl.o \
69 ldr/userldr.o
70
71 NLS_OBJECTS = nls/nls.o
72
73 PO_OBJECTS = po/power.o
74
75 CC_OBJECTS = cc/cacheman.o cc/view.o
76
77 KD_OBJECTS = kd/kdebug.o kd/service.o
78
79 RESOURCE_OBJECT = $(TARGET).coff
80
81 objects:
82 mkdir objects
83
84 objects/hal.o: $(HAL_OBJECTS)
85 $(LD) -r $(HAL_OBJECTS) -o objects/hal.o
86
87 objects/io.o: $(IO_OBJECTS)
88 $(LD) -r $(IO_OBJECTS) -o objects/io.o
89
90 objects/ke.o: $(KE_OBJECTS) $(KE_I386_OBJECTS)
91 $(LD) -r $(KE_OBJECTS) $(KE_I386_OBJECTS) -o objects/ke.o
92
93 objects/rtl.o: $(RTL_OBJECTS)
94 $(LD) -r $(RTL_OBJECTS) -o objects/rtl.o
95
96 objects/mm.o: $(MM_OBJECTS) $(MM_I386_OBJECTS)
97 $(LD) -r $(MM_OBJECTS) $(MM_I386_OBJECTS) -o objects/mm.o
98
99 objects/ob.o: $(OB_OBJECTS)
100 $(LD) -r $(OB_OBJECTS) -o objects/ob.o
101
102 objects/ps.o: $(PS_OBJECTS)
103 $(LD) -r $(PS_OBJECTS) -o objects/ps.o
104
105 objects/ex.o: $(EX_OBJECTS)
106 $(LD) -r $(EX_OBJECTS) -o objects/ex.o
107
108 objects/fs.o: $(FS_OBJECTS)
109 $(LD) -r $(FS_OBJECTS) -o objects/fs.o
110
111 objects/se.o: $(SE_OBJECTS)
112 $(LD) -r $(SE_OBJECTS) -o objects/se.o
113
114 objects/cm.o: $(CM_OBJECTS)
115 $(LD) -r $(CM_OBJECTS) -o objects/cm.o
116
117 objects/dbg.o: $(DBG_OBJECTS)
118 $(LD) -r $(DBG_OBJECTS) -o objects/dbg.o
119
120 objects/ldr.o: $(LDR_OBJECTS)
121 $(LD) -r $(LDR_OBJECTS) -o objects/ldr.o
122
123 objects/nls.o: $(NLS_OBJECTS)
124 $(LD) -r $(NLS_OBJECTS) -o objects/nls.o
125
126 objects/nt.o: $(NT_OBJECTS)
127 $(LD) -r $(NT_OBJECTS) -o objects/nt.o
128
129 objects/po.o: $(PO_OBJECTS)
130 $(LD) -r $(PO_OBJECTS) -o objects/po.o
131
132 objects/cc.o: $(CC_OBJECTS)
133 $(LD) -r $(CC_OBJECTS) -o objects/cc.o
134
135 objects/kd.o: $(KD_OBJECTS)
136 $(LD) -r $(KD_OBJECTS) -o objects/kd.o
137
138 $(TARGET).coff: $(TARGET).rc ../include/reactos/resource.h
139
140
141 OBJECTS = objects/hal.o objects/ke.o objects/rtl.o objects/mm.o \
142 objects/io.o objects/ob.o objects/ps.o objects/ex.o \
143 objects/se.o objects/cm.o objects/dbg.o objects/nt.o \
144 objects/cc.o objects/kd.o objects/ldr.o objects/fs.o \
145 objects/po.o objects/nls.o \
146 $(TARGET).coff
147
148 ifeq ($(DOSCLI),yes)
149 CLEAN_FILES = objects\*.o cc\*.o cm\*.o dbg\*.o ex\*.o hal\x86\*.o io\*.o \
150 ke\*.o ldr\*.o mm\*.o nt\*.o ob\*.o ps\*.o rtl\*.o se\*.o \
151 ke\i386\*.o mm\i386\*.o fs\*.o po\*.o nls\*.o \
152 kd\*.o utils\export\export.exe $(TARGET).o $(TARGET).a junk.tmp \
153 base.tmp temp.exp $(TARGET).exe $(TARGET).sym $(TARGET).coff
154 else
155 CLEAN_FILES = objects/*.o cc/*.o cm/*.o dbg/*.o ex/*.o hal/x86/*.o io/*.o \
156 ke/*.o ldr/*.o mm/*.o nt/*.o ob/*.o ps/*.o rtl/*.o se/*.o \
157 ke/i386/*.o mm/i386/*.o fs/*.o po/*.o nls/*.o \
158 kd/*.o utils/export/export $(TARGET).o $(TARGET).a junk.tmp \
159 base.tmp temp.exp $(TARGET).exe $(TARGET).sym $(TARGET).coff
160 endif
161
162 $(TARGET).exe: $(OBJECTS) $(TARGET).def
163 $(LD) \
164 -r $(OBJECTS) \
165 -o $(TARGET).o
166 $(DLLTOOL) \
167 --dllname $(TARGET).exe \
168 --def $(TARGET).def \
169 --kill-at \
170 --output-lib $(TARGET).a
171 $(CC) \
172 $(TARGET).o \
173 -Wl,-d -specs=../specs \
174 -mdll \
175 -o junk.tmp \
176 -Wl,--image-base,0xc0000000 \
177 -Wl,--file-alignment,0x1000 \
178 -Wl,--section-alignment,0x1000 \
179 -Wl,--defsym,_edata=__data_end__ \
180 -Wl,--defsym,_end=__bss_end__ \
181 -Wl,--defsym,_etext=etext \
182 -Wl,--base-file,base.tmp
183 - $(RM) junk.tmp
184 $(DLLTOOL) \
185 --dllname $(TARGET).exe \
186 --base-file base.tmp \
187 --output-exp temp.exp \
188 --def $(TARGET).edf
189 - $(RM) base.tmp
190 $(CC) \
191 $(TARGET).o \
192 -Wl,-d -specs=../specs \
193 -mdll \
194 -o $(TARGET).exe \
195 -Wl,--image-base,0xc0000000 \
196 -Wl,--file-alignment,0x1000 \
197 -Wl,--section-alignment,0x1000 \
198 -Wl,--defsym,_end=__bss_end__ \
199 -Wl,--defsym,_edata=__data_end__ \
200 -Wl,--defsym,_etext=etext \
201 -Wl,temp.exp
202 - $(RM) temp.exp
203 $(NM) --numeric-sort $(TARGET).exe > $(TARGET).sym
204
205 $(TARGET).o: $(OBJECTS)
206 $(LD) \
207 -r $(OBJECTS) \
208 -o $(TARGET).o
209
210 $(TARGET).a: $(TARGET).def
211 $(DLLTOOL) \
212 --dllname $(TARGET).exe \
213 --def $(TARGET).def \
214 --output-lib $(TARGET).a
215
216 clean: $(CLEAN_FILES:%=%_clean)
217
218 $(CLEAN_FILES:%=%_clean): %_clean:
219 - $(RM) $*
220
221 .PHONY: clean $(CLEAN_FILES:%=%_clean)
222
223 floppy: $(FLOPPY_DIR)/$(TARGET).exe
224
225 $(FLOPPY_DIR)/$(TARGET).exe: $(TARGET).exe
226 ifeq ($(DOSCLI),yes)
227 $(CP) $(TARGET).exe $(FLOPPY_DIR)\$(TARGET).exe
228 else
229 $(CP) $(TARGET).exe $(FLOPPY_DIR)/$(TARGET).exe
230 endif
231
232 .PHONY: dist
233
234 dist: ../$(DIST_DIR)/$(TARGET).exe
235
236 ../$(DIST_DIR)/$(TARGET).exe: $(TARGET).exe
237 ifeq ($(DOSCLI),yes)
238 $(CP) $(TARGET).exe ..\$(DIST_DIR)\$(TARGET).exe
239 else
240 $(CP) $(TARGET).exe ../$(DIST_DIR)/$(TARGET).exe
241 endif
242
243 .PHONY: dist
244
245 ex/napi.o: ex/napi.c ../include/ntdll/napi.h
246
247 ke/main.o: ke/main.c ../include/reactos/buildno.h
248
249 #WITH_DEBUGGING = yes
250 WIN32_LEAN_AND_MEAN = yes
251 WARNINGS_ARE_ERRORS = yes
252 include ../rules.mak
253