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