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