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