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