Some fixes.
[reactos.git] / reactos / lib / kernel32 / makefile
1 # $Id: makefile,v 1.34 2000/05/13 13:50:56 dwelch 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 file/npipe.o
37
38 MEM_OBJECTS = mem/virtual.o mem/heap.o mem/utils.o mem/section.o mem/isbad.o mem/procmem.o
39
40 NLS_OBJECTS = nls/codepage.o nls/cpmisc.o nls/cptable.o\
41 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\
42 nls/cp860.o nls/cp861.o nls/cp863.o nls/cp865.o nls/cp866.o nls/cp869.o nls/cp875.o nls/cp1026.o\
43 nls/cp1250.o nls/cp1251.o nls/cp1252.o nls/cp1253.o nls/cp1254.o nls/cp1255.o nls/cp1256.o nls/cp1257.o\
44 nls/cp10000.o nls/cp10006.o nls/cp10007.o nls/cp10029.o nls/cp10079.o nls/cp10081.o\
45 nls/lctable.o\
46 nls/lcAFK.o nls/lcBEL.o nls/lcBGR.o nls/lcCAT.o nls/lcCSY.o nls/lcDAN.o\
47 nls/lcDEA.o nls/lcDEC.o nls/lcDEL.o nls/lcDES.o nls/lcDEU.o\
48 nls/lcELL.o\
49 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\
50 nls/lcENU.o nls/lcENZ.o\
51 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\
52 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\
53 nls/lcESY.o nls/lcESZ.o\
54 nls/lcETI.o nls/lcEUQ.o nls/lcFIN.o nls/lcFOS.o\
55 nls/lcFRA.o nls/lcFRB.o nls/lcFRC.o nls/lcFRL.o nls/lcFRS.o\
56 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\
57 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\
58 nls/lcSLV.o nls/lcSQI.o nls/lcSRB.o nls/lcSRL.o nls/lcSVE.o nls/lcSVF.o nls/lcTRK.o nls/lcUKR.o\
59 nls/locale.o nls/mbtowc.o nls/wctomb.o nls/ole2nls.o
60
61 THREAD_OBJECTS = thread/thread.o thread/tls.o
62
63 PROCESS_OBJECTS = process/proc.o process/cmdline.o process/create.o \
64 process/lib.o
65
66 STRING_OBJECTS = string/lstring.o
67
68 EXCEPT_OBJECTS = except/except.o
69
70 RESOURCE_OBJECT = $(TARGET).coff
71
72
73 OBJECTS = $(MISC_OBJECTS) $(FILE_OBJECTS) $(THREAD_OBJECTS) \
74 $(PROCESS_OBJECTS) $(STRING_OBJECTS) $(MEM_OBJECTS) \
75 $(SYNCH_OBJECTS) $(EXCEPT_OBJECTS) $(RESOURCE_OBJECT)
76
77 ifeq ($(DOSCLI),yes)
78 CLEAN_FILES = except\*.o file\*.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 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