Fixed typo.
[reactos.git] / reactos / lib / kernel32 / makefile
1 # $Id: makefile,v 1.25 1999/09/27 20:58:44 ariadne 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 ifneq ($(HOST),mingw32-windows)
14 ifneq ($(HOST),mingw32-linux)
15 DLLTARGET=$(TARGET).a
16 else
17 DLLTARGET=$(TARGET).dll
18 endif
19 else
20 DLLTARGET=$(TARGET).dll
21 endif
22
23 all: $(DLLTARGET)
24
25 SYNCH_OBJECTS = synch/critical.o synch/event.o synch/wait.o synch/intrlck.o synch/timer.o
26
27 MISC_OBJECTS = misc/error.o misc/atom.o misc/handle.o misc/env.o misc/dllmain.o \
28 misc/console.o misc/time.o misc/stubs.o
29
30 FILE_OBJECTS = file/file.o file/curdir.o file/lfile.o file/dir.o \
31 file/iocompl.o file/volume.o file/deviceio.o file/dosdev.o \
32 file/create.o file/find.o file/copy.o file/pipe.o \
33 file/move.o file/lock.o file/rw.o file/delete.o
34
35 MEM_OBJECTS = mem/virtual.o mem/heap.o mem/utils.o mem/section.o
36
37 NLS_OBJECTS = nls/codepage.o nls/cpmisc.o nls/cptable.o\
38 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\
39 nls/cp860.o nls/cp861.o nls/cp863.o nls/cp865.o nls/cp866.o nls/cp869.o nls/cp875.o nls/cp1026.o\
40 nls/cp1250.o nls/cp1251.o nls/cp1252.o nls/cp1253.o nls/cp1254.o nls/cp1255.o nls/cp1256.o nls/cp1257.o\
41 nls/cp10000.o nls/cp10006.o nls/cp10007.o nls/cp10029.o nls/cp10079.o nls/cp10081.o\
42 nls/lctable.o\
43 nls/lcAFK.o nls/lcBEL.o nls/lcBGR.o nls/lcCAT.o nls/lcCSY.o nls/lcDAN.o\
44 nls/lcDEA.o nls/lcDEC.o nls/lcDEL.o nls/lcDES.o nls/lcDEU.o\
45 nls/lcELL.o\
46 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\
47 nls/lcENU.o nls/lcENZ.o\
48 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\
49 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\
50 nls/lcESY.o nls/lcESZ.o\
51 nls/lcETI.o nls/lcEUQ.o nls/lcFIN.o nls/lcFOS.o\
52 nls/lcFRA.o nls/lcFRB.o nls/lcFRC.o nls/lcFRL.o nls/lcFRS.o\
53 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\
54 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\
55 nls/lcSLV.o nls/lcSQI.o nls/lcSRB.o nls/lcSRL.o nls/lcSVE.o nls/lcSVF.o nls/lcTRK.o nls/lcUKR.o\
56 nls/locale.o nls/mbtowc.o nls/wctomb.o nls/ole2nls.o
57
58 THREAD_OBJECTS = thread/thread.o thread/tls.o
59
60 PROCESS_OBJECTS = process/proc.o process/cmdline.o process/create.o \
61 process/lib.o
62
63 STRING_OBJECTS = string/lstring.o
64
65 INTERNAL_OBJECTS = internal/dprintf.o internal/string.o
66
67 EXCEPT_OBJECTS = except/except.o
68
69 RESOURCE_OBJECT = $(TARGET).coff
70
71
72 OBJECTS = $(MISC_OBJECTS) $(FILE_OBJECTS) $(THREAD_OBJECTS) \
73 $(PROCESS_OBJECTS) $(STRING_OBJECTS) $(MEM_OBJECTS) \
74 $(INTERNAL_OBJECTS) $(SYNCH_OBJECTS) $(EXCEPT_OBJECTS) \
75 $(RESOURCE_OBJECT)
76
77 ifeq ($(DOSCLI),yes)
78 CLEAN_FILES = except\*.o file\*.o internal\*.o mem\*.o misc\*.o nls\*.o \
79 process\*.o string\*.o synch\*.o thread\*.o \
80 $(TARGET).o $(TARGET).a junk.tmp base.tmp temp.exp \
81 $(TARGET).dll $(TARGET).sym $(TARGET).coff
82 else
83 CLEAN_FILES = except/*.o file/*.o internal/*.o mem/*.o misc/*.o nls/*.o \
84 process/*.o string/*.o synch/*.o thread/*.o \
85 $(TARGET).o $(TARGET).a junk.tmp base.tmp temp.exp \
86 $(TARGET).dll $(TARGET).sym $(TARGET).coff
87 endif
88
89 nls/ole2nls.o: nls/ole2nls.c
90 $(CC) $(CFLAGS) -I. nls/ole2nls.c
91
92 $(TARGET).coff: $(TARGET).rc ../../include/reactos/resource.h
93
94 $(TARGET).a: $(OBJECTS)
95 $(AR) csr $(TARGET).a $(OBJECTS)
96
97 $(TARGET).dll: $(DLLMAIN) $(OBJECTS) $(TARGET).def
98 $(LD) \
99 -r $(OBJECTS) \
100 -o $(TARGET).o
101 $(DLLTOOL) \
102 --dllname $(TARGET).dll \
103 --def $(TARGET).def \
104 --kill-at \
105 --output-lib $(TARGET).a
106 $(CC) \
107 -specs=k32_specs \
108 -mdll \
109 -o junk.tmp \
110 -Wl,--base-file,base.tmp \
111 $(TARGET).o \
112 ../ntdll/ntdll.a
113 - $(RM) junk.tmp
114 $(DLLTOOL) \
115 --dllname $(TARGET).dll \
116 --base-file base.tmp \
117 --output-exp temp.exp \
118 --def $(TARGET).edf
119 - $(RM) base.tmp
120 $(CC) \
121 -specs=k32_specs \
122 -mdll \
123 -o $(TARGET).dll \
124 $(TARGET).o \
125 ../ntdll/ntdll.a \
126 -Wl,--image-base,$(KERNEL32_BASE) \
127 -Wl,--file-alignment,0x1000 \
128 -Wl,--section-alignment,0x1000 \
129 -Wl,temp.exp
130 - $(RM) temp.exp
131 $(NM) --numeric-sort $(TARGET).dll > $(TARGET).sym
132
133 clean: $(CLEAN_FILES:%=%_clean)
134
135 $(CLEAN_FILES:%=%_clean): %_clean:
136 - $(RM) $*
137
138 .PHONY: clean $(CLEAN_FILES:%=%_clean)
139
140 floppy: $(FLOPPY_DIR)/dlls/$(TARGET).dll
141
142 $(FLOPPY_DIR)/dlls/$(TARGET).dll: $(TARGET).dll
143 ifeq ($(DOSCLI),yes)
144 $(CP) $(TARGET).dll $(FLOPPY_DIR)\dlls\$(TARGET).dll
145 else
146 $(CP) $(TARGET).dll $(FLOPPY_DIR)/dlls/$(TARGET).dll
147 endif
148
149 dist: $(DIST_DIR)/dlls/$(TARGET).dll
150
151 $(DIST_DIR)/dlls/$(TARGET).dll: $(TARGET).dll
152 ifeq ($(DOSCLI),yes)
153 $(CP) $(TARGET).dll ..\..\$(DIST_DIR)\dlls\$(TARGET).dll
154 else
155 $(CP) $(TARGET).dll ../../$(DIST_DIR)/dlls/$(TARGET).dll
156 endif
157
158 #WARNINGS_ARE_ERRORS = yes
159 include ../../rules.mak