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