Partially implemented (handlers only)
[reactos.git] / reactos / lib / kernel32 / makefile
1 # $Id: makefile,v 1.33 2000/04/25 23:22:53 ea Exp $
2 #
3 # ReactOS Operating System
4 #
5 TARGET=kernel32
6
7 KERNEL32_BASE = 0x77f00000
8
9 BASE_CFLAGS = -I../../include
10
11 CFLAGS = $(CFLAGS) -DKERNEL32_BASE=$(KERNEL32_BASE)
12
13 include ../../rules.mak
14 ifneq ($(HOST),mingw32-windows)
15 ifneq ($(HOST),mingw32-linux)
16 DLLTARGET=$(TARGET).a
17 else
18 DLLTARGET=$(TARGET).dll
19 endif
20 else
21 DLLTARGET=$(TARGET).dll
22 endif
23
24 all: $(DLLTARGET)
25
26 SYNCH_OBJECTS = synch/critical.o synch/event.o synch/wait.o synch/intrlck.o synch/timer.o
27
28 MISC_OBJECTS = misc/error.o misc/atom.o misc/handle.o misc/env.o misc/dllmain.o \
29 misc/console.o misc/time.o misc/stubs.o misc/rtl.o misc/ldr.o misc/res.o \
30 misc/debug.o misc/sysinfo.o
31
32 FILE_OBJECTS = file/file.o file/curdir.o file/lfile.o file/dir.o \
33 file/iocompl.o file/volume.o file/deviceio.o file/dosdev.o \
34 file/create.o file/find.o file/copy.o file/pipe.o \
35 file/move.o file/lock.o file/rw.o file/delete.o
36
37 MEM_OBJECTS = mem/virtual.o mem/heap.o mem/utils.o mem/section.o mem/isbad.o mem/procmem.o
38
39 NLS_OBJECTS = nls/codepage.o nls/cpmisc.o nls/cptable.o\
40 nls/cp37.o nls/cp437.o nls/cp500.o nls/cp737.o nls/cp775.o nls/cp850.o nls/cp852.o nls/cp855.o nls/cp857.o\
41 nls/cp860.o nls/cp861.o nls/cp863.o nls/cp865.o nls/cp866.o nls/cp869.o nls/cp875.o nls/cp1026.o\
42 nls/cp1250.o nls/cp1251.o nls/cp1252.o nls/cp1253.o nls/cp1254.o nls/cp1255.o nls/cp1256.o nls/cp1257.o\
43 nls/cp10000.o nls/cp10006.o nls/cp10007.o nls/cp10029.o nls/cp10079.o nls/cp10081.o\
44 nls/lctable.o\
45 nls/lcAFK.o nls/lcBEL.o nls/lcBGR.o nls/lcCAT.o nls/lcCSY.o nls/lcDAN.o\
46 nls/lcDEA.o nls/lcDEC.o nls/lcDEL.o nls/lcDES.o nls/lcDEU.o\
47 nls/lcELL.o\
48 nls/lcENA.o nls/lcENB.o nls/lcENC.o nls/lcENG.o nls/lcENI.o nls/lcENJ.o nls/lcENL.o nls/lcENS.o nls/lcENT.o\
49 nls/lcENU.o nls/lcENZ.o\
50 nls/lcESA.o nls/lcESB.o nls/lcESC.o nls/lcESD.o nls/lcESE.o nls/lcESF.o nls/lcESG.o nls/lcESH.o nls/lcESI.o\
51 nls/lcESL.o nls/lcESM.o nls/lcESN.o nls/lcESO.o nls/lcESP.o nls/lcESR.o nls/lcESS.o nls/lcESU.o nls/lcESV.o\
52 nls/lcESY.o nls/lcESZ.o\
53 nls/lcETI.o nls/lcEUQ.o nls/lcFIN.o nls/lcFOS.o\
54 nls/lcFRA.o nls/lcFRB.o nls/lcFRC.o nls/lcFRL.o nls/lcFRS.o\
55 nls/lcHRV.o nls/lcHUN.o nls/lcIND.o nls/lcISL.o nls/lcITA.o nls/lcITS.o nls/lcLTH.o nls/lcLVI.o nls/lcNLB.o\
56 nls/lcNLD.o nls/lcNON.o nls/lcNOR.o nls/lcPLK.o nls/lcPTB.o nls/lcPTG.o nls/lcROM.o nls/lcRUS.o nls/lcSKY.o\
57 nls/lcSLV.o nls/lcSQI.o nls/lcSRB.o nls/lcSRL.o nls/lcSVE.o nls/lcSVF.o nls/lcTRK.o nls/lcUKR.o\
58 nls/locale.o nls/mbtowc.o nls/wctomb.o nls/ole2nls.o
59
60 THREAD_OBJECTS = thread/thread.o thread/tls.o
61
62 PROCESS_OBJECTS = process/proc.o process/cmdline.o process/create.o
63
64 STRING_OBJECTS = string/lstring.o
65
66 EXCEPT_OBJECTS = except/except.o
67
68 RESOURCE_OBJECT = $(TARGET).coff
69
70
71 OBJECTS = $(MISC_OBJECTS) $(FILE_OBJECTS) $(THREAD_OBJECTS) \
72 $(PROCESS_OBJECTS) $(STRING_OBJECTS) $(MEM_OBJECTS) \
73 $(SYNCH_OBJECTS) $(EXCEPT_OBJECTS) $(RESOURCE_OBJECT)
74
75 ifeq ($(DOSCLI),yes)
76 CLEAN_FILES = except\*.o file\*.o mem\*.o misc\*.o nls\*.o \
77 process\*.o string\*.o synch\*.o thread\*.o \
78 $(TARGET).o $(TARGET).a junk.tmp base.tmp temp.exp \
79 $(TARGET).dll $(TARGET).sym $(TARGET).coff
80 else
81 CLEAN_FILES = except/*.o file/*.o mem/*.o misc/*.o nls/*.o \
82 process/*.o string/*.o synch/*.o thread/*.o \
83 $(TARGET).o $(TARGET).a junk.tmp base.tmp temp.exp \
84 $(TARGET).dll $(TARGET).sym $(TARGET).coff
85 endif
86
87 nls/ole2nls.o: nls/ole2nls.c
88 $(CC) $(CFLAGS) -I. nls/ole2nls.c
89
90 $(TARGET).coff: $(TARGET).rc ../../include/reactos/resource.h
91
92 $(TARGET).a: $(OBJECTS)
93 $(AR) csr $(TARGET).a $(OBJECTS)
94
95 $(TARGET).dll: $(DLLMAIN) $(OBJECTS) $(TARGET).def
96 $(LD) \
97 -r $(OBJECTS) \
98 -o $(TARGET).o
99 $(DLLTOOL) \
100 --dllname $(TARGET).dll \
101 --def $(TARGET).def \
102 --kill-at \
103 --output-lib $(TARGET).a
104 $(CC) \
105 -specs=k32_specs \
106 -mdll \
107 -o junk.tmp \
108 -Wl,--base-file,base.tmp \
109 $(TARGET).o \
110 ../ntdll/ntdll.a
111 - $(RM) junk.tmp
112 $(DLLTOOL) \
113 --dllname $(TARGET).dll \
114 --base-file base.tmp \
115 --output-exp temp.exp \
116 --def $(TARGET).edf
117 - $(RM) base.tmp
118 $(CC) \
119 -specs=k32_specs \
120 -mdll \
121 -o $(TARGET).dll \
122 $(TARGET).o \
123 ../ntdll/ntdll.a \
124 -Wl,--image-base,$(KERNEL32_BASE) \
125 -Wl,--file-alignment,0x1000 \
126 -Wl,--section-alignment,0x1000 \
127 -Wl,temp.exp
128 - $(RM) temp.exp
129 $(NM) --numeric-sort $(TARGET).dll > $(TARGET).sym
130
131 clean: $(CLEAN_FILES:%=%_clean)
132
133 $(CLEAN_FILES:%=%_clean): %_clean:
134 - $(RM) $*
135
136 .PHONY: clean $(CLEAN_FILES:%=%_clean)
137
138 floppy: $(FLOPPY_DIR)/dlls/$(TARGET).dll
139
140 $(FLOPPY_DIR)/dlls/$(TARGET).dll: $(TARGET).dll
141 ifeq ($(DOSCLI),yes)
142 $(CP) $(TARGET).dll $(FLOPPY_DIR)\dlls\$(TARGET).dll
143 else
144 $(CP) $(TARGET).dll $(FLOPPY_DIR)/dlls/$(TARGET).dll
145 endif
146
147 dist: $(DIST_DIR)/dlls/$(TARGET).dll
148
149 $(DIST_DIR)/dlls/$(TARGET).dll: $(TARGET).dll
150 ifeq ($(DOSCLI),yes)
151 $(CP) $(TARGET).dll ..\..\$(DIST_DIR)\dlls\$(TARGET).dll
152 else
153 $(CP) $(TARGET).dll ../../$(DIST_DIR)/dlls/$(TARGET).dll
154 endif
155
156 WARNINGS_ARE_ERRORS = yes
157