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