Added more crt functions and fixed some.
[reactos.git] / reactos / lib / ntdll / makefile
1 # $Id: makefile,v 1.21 1999/07/29 21:14:02 ekohl Exp $
2 #
3 # ReactOS Operating System
4 #
5 TARGET=ntdll
6
7 IMAGE_BASE = 0x77f60000
8
9 ifneq ($(HOST),mingw32-windows)
10 ifneq ($(HOST),mingw32-linux)
11 DLLTARGET=$(TARGET).a
12 DLLMAIN=
13 else
14 DLLTARGET=$(TARGET).dll
15 DLLMAIN=main/dllmain.o
16 endif
17 else
18 DLLTARGET=$(TARGET).dll
19 DLLMAIN=main/dllmain.o
20 endif
21
22 all: $(DLLTARGET)
23
24 RTL_OBJECTS = rtl/critical.o rtl/error.o rtl/heap.o rtl/largeint.o \
25 rtl/mem.o rtl/namespc.o rtl/security.o rtl/unicode.o
26
27 STDLIB_OBJECTS = stdlib/atoi.o stdlib/atol.o stdlib/splitp.o \
28 stdlib/strtol.o stdlib/strtoul.o
29
30 STRING_OBJECTS = string/ctype.o string/memccpy.o string/memchr.o \
31 string/memcmp.o string/memcpy.o string/memicmp.o\
32 string/memmove.o string/memset.o string/strcat.o \
33 string/strchr.o string/strcmp.o string/strcspn.o \
34 string/strcpy.o string/stricmp.o string/strlen.o \
35 string/strlwr.o string/strncat.o string/strncmp.o \
36 string/strncpy.o string/strnicmp.o string/strnlen.o \
37 string/strpbrk.o string/strrchr.o string/strspn.o \
38 string/strstr.o string/strupr.o string/wstring.o
39
40 OBJECTS = napi.o ldr/startup.o $(RTL_OBJECTS) \
41 stdio/vsprintf.o $(STDLIB_OBJECTS) $(STRING_OBJECTS) \
42 stubs/stubs.o ldr/utils.o $(TARGET).coff
43
44 ifeq ($(DOSCLI),yes)
45 CLEAN_FILES = napi.o ldr\*.o rtl\*.o stdio\*.o stdlib\*.o string\*.o stubs\*.o \
46 $(TARGET).a main\dllmain.o $(TARGET).o $(TARGET).dll junk.tmp \
47 base.tmp temp.exp $(TARGET).sym $(TARGET).coff
48 else
49 CLEAN_FILES = napi.o ldr/*.o rtl/*.o stdio/*.o stdlib/*.o string/*.o stubs/*.o \
50 $(TARGET).a main/dllmain.o $(TARGET).o $(TARGET).dll junk.tmp \
51 base.tmp temp.exp $(TARGET).sym $(TARGET).coff
52 endif
53
54 $(TARGET).coff: $(TARGET).rc ../../include/reactos/resource.h
55
56 $(TARGET).a: $(OBJECTS)
57 $(AR) csr $(TARGET).a $(OBJECTS)
58
59 $(TARGET).dll: $(DLLMAIN) $(OBJECTS) def/ntdll.def def/ntdll.edf
60 $(LD) \
61 -r $(DLLMAIN) \
62 $(OBJECTS) \
63 -o $(TARGET).o
64 $(DLLTOOL) \
65 --dllname $(TARGET).dll \
66 --def def/$(TARGET).def \
67 --kill-at \
68 --output-lib $(TARGET).a
69 $(CC) \
70 -specs=$(TARGET)_specs \
71 -mdll \
72 -o junk.tmp \
73 -Wl,--base-file,base.tmp \
74 $(TARGET).o
75 - $(RM) junk.tmp
76 $(DLLTOOL) \
77 --dllname $(TARGET).dll \
78 --base-file base.tmp \
79 --output-exp temp.exp \
80 --def def/$(TARGET).edf
81 - $(RM) base.tmp
82 $(CC) \
83 -specs=$(TARGET)_specs \
84 -mdll \
85 -o $(TARGET).dll \
86 $(TARGET).o \
87 -Wl,--entry=_LdrStartup \
88 -Wl,--image-base,$(IMAGE_BASE) \
89 -Wl,--file-alignment,0x1000 \
90 -Wl,--section-alignment,0x1000 \
91 -Wl,temp.exp
92 - $(RM) temp.exp
93 $(NM) --numeric-sort $(TARGET).dll > $(TARGET).sym
94
95 clean: $(CLEAN_FILES:%=%_clean)
96
97 $(CLEAN_FILES:%=%_clean): %_clean:
98 - $(RM) $*
99
100 .PHONY: clean $(CLEAN_FILES:%=%_clean)
101
102 floppy: $(FLOPPY_DIR)/dlls/$(TARGET).dll
103
104 $(FLOPPY_DIR)/dlls/$(TARGET).dll: $(TARGET).dll
105 ifeq ($(DOSCLI),yes)
106 $(CP) $(TARGET).dll $(FLOPPY_DIR)\dlls\$(TARGET).dll
107 else
108 $(CP) $(TARGET).dll $(FLOPPY_DIR)/dlls/$(TARGET).dll
109 endif
110
111 dist: $(DIST_DIR)/dlls/$(TARGET).dll
112
113 $(DIST_DIR)/dlls/$(TARGET).dll: $(TARGET).dll
114 ifeq ($(DOSCLI),yes)
115 $(CP) $(TARGET).dll ..\..\$(DIST_DIR)\dlls\$(TARGET).dll
116 else
117 $(CP) $(TARGET).dll ../../$(DIST_DIR)/dlls/$(TARGET).dll
118 endif
119
120 #WARNINGS_ARE_ERRORS = yes
121 include ../../rules.mak
122