aa9cf810d6496b66878bf69937546375afdf5981
[reactos.git] / reactos / lib / ntdll / makefile
1 # $Id: makefile,v 1.51 2000/08/11 12:33:18 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 DLLTARGET=$(TARGET).dll
12 DLLMAIN=main/dllmain.o
13
14 all: $(DLLTARGET)
15
16 CSR_OBJECTS = csr/api.o
17
18 DBG_OBJECTS = dbg/brkpoint.o dbg/debug.o dbg/print.o
19
20 RTL_OBJECTS = rtl/critical.o rtl/error.o rtl/heap.o rtl/largeint.o \
21 rtl/math.o rtl/mem.o rtl/nls.o rtl/process.o rtl/sd.o \
22 rtl/thread.o rtl/unicode.o rtl/env.o rtl/path.o rtl/ppb.o \
23 rtl/bitmap.o rtl/time.o rtl/acl.o rtl/sid.o rtl/image.o \
24 rtl/access.o rtl/apc.o rtl/callback.o rtl/luid.o rtl/misc.o \
25 rtl/registry.o
26
27 STDIO_OBJECTS = stdio/sprintf.o stdio/swprintf.o
28
29 STDLIB_OBJECTS = stdlib/abs.o stdlib/atoi.o stdlib/atoi64.o stdlib/atol.o \
30 stdlib/itoa.o stdlib/itow.o stdlib/labs.o stdlib/splitp.o \
31 stdlib/strtol.o stdlib/strtoul.o stdlib/wcstol.o \
32 stdlib/wcstoul.o stdlib/wtoi.o stdlib/wtoi64.o stdlib/wtol.o \
33 stdlib/mbstowcs.o stdlib/wcstombs.o stdlib/qsort.o
34
35 STRING_OBJECTS = string/ctype.o string/memccpy.o string/memchr.o \
36 string/memcmp.o string/memcpy.o string/memicmp.o\
37 string/memmove.o string/memset.o string/strcat.o \
38 string/strchr.o string/strcmp.o string/strcspn.o \
39 string/strcpy.o string/stricmp.o string/strlen.o \
40 string/strlwr.o string/strncat.o string/strncmp.o \
41 string/strncpy.o string/strnicmp.o string/strnlen.o \
42 string/strpbrk.o string/strrchr.o string/strspn.o \
43 string/strstr.o string/strupr.o string/wstring.o
44
45 OBJECTS = napi.o ldr/startup.o $(DBG_OBJECTS) $(RTL_OBJECTS) \
46 $(STDIO_OBJECTS) $(STDLIB_OBJECTS) $(STRING_OBJECTS) \
47 stubs/stubs.o ldr/utils.o $(CSR_OBJECTS) $(TARGET).coff
48
49 ifeq ($(DOSCLI),yes)
50 CLEAN_FILES = napi.o ldr\*.o rtl\*.o stdio\*.o stdlib\*.o string\*.o stubs\*.o \
51 $(TARGET).a main\dllmain.o $(TARGET).o $(TARGET).dll junk.tmp \
52 base.tmp temp.exp $(TARGET).sym $(TARGET).coff
53 else
54 CLEAN_FILES = napi.o ldr/*.o rtl/*.o stdio/*.o stdlib/*.o string/*.o stubs/*.o csr/*.o dbg/*.o \
55 $(TARGET).a main/dllmain.o $(TARGET).o $(TARGET).dll junk.tmp \
56 base.tmp temp.exp $(TARGET).sym $(TARGET).coff
57 endif
58
59 $(TARGET).coff: $(TARGET).rc ../../include/reactos/resource.h
60
61 $(TARGET).a: $(OBJECTS)
62 $(AR) csr $(TARGET).a $(OBJECTS)
63
64 $(TARGET).dll: $(DLLMAIN) $(OBJECTS) def/ntdll.def def/ntdll.edf
65 $(LD) \
66 -r $(DLLMAIN) \
67 $(OBJECTS) \
68 -o $(TARGET).o
69 $(DLLTOOL) \
70 --dllname $(TARGET).dll \
71 --def def/$(TARGET).def \
72 --kill-at \
73 --output-lib $(TARGET).a
74 $(CC) \
75 -specs=$(TARGET)_specs \
76 -mdll \
77 -o junk.tmp \
78 -Wl,--base-file,base.tmp \
79 $(TARGET).o
80 - $(RM) junk.tmp
81 $(DLLTOOL) \
82 --dllname $(TARGET).dll \
83 --base-file base.tmp \
84 --output-exp temp.exp \
85 --def def/$(TARGET).edf
86 - $(RM) base.tmp
87 $(CC) \
88 -specs=$(TARGET)_specs \
89 -mdll \
90 -o $(TARGET).dll \
91 $(TARGET).o \
92 -Wl,--entry=_LdrInitializeThunk@16 \
93 -Wl,--image-base,$(IMAGE_BASE) \
94 -Wl,--file-alignment,0x1000 \
95 -Wl,--section-alignment,0x1000 \
96 -Wl,temp.exp
97 - $(RM) temp.exp
98 $(NM) --numeric-sort $(TARGET).dll > $(TARGET).sym
99
100 clean: $(CLEAN_FILES:%=%_clean)
101
102 $(CLEAN_FILES:%=%_clean): %_clean:
103 - $(RM) $*
104
105 .PHONY: clean $(CLEAN_FILES:%=%_clean)
106
107 install: $(FLOPPY_DIR)/dlls/$(TARGET).dll
108
109 $(FLOPPY_DIR)/dlls/$(TARGET).dll: $(TARGET).dll
110 ifeq ($(DOSCLI),yes)
111 $(CP) $(TARGET).dll $(FLOPPY_DIR)\dlls\$(TARGET).dll
112 else
113 $(CP) $(TARGET).dll $(FLOPPY_DIR)/dlls/$(TARGET).dll
114 endif
115
116 dist: $(DIST_DIR)/dlls/$(TARGET).dll
117
118 $(DIST_DIR)/dlls/$(TARGET).dll: $(TARGET).dll
119 ifeq ($(DOSCLI),yes)
120 $(CP) $(TARGET).dll ..\..\$(DIST_DIR)\dlls\$(TARGET).dll
121 else
122 $(CP) $(TARGET).dll ../../$(DIST_DIR)/dlls/$(TARGET).dll
123 endif
124
125 WITH_DEBUGGING = yes
126 #WARNINGS_ARE_ERRORS = yes
127 include ../../rules.mak