fixed bug in scanf
[reactos.git] / reactos / lib / crtdll / makefile
1 ifneq ($(HOST),mingw32-windows)
2 ifneq ($(HOST),mingw32-linux)
3 DLLTARGET=crtdll.a
4 else
5 DLLTARGET=crtdll.dll
6 endif
7 else
8 DLLTARGET=crtdll.dll
9 endif
10
11 all: $(DLLTARGET)
12
13
14 ASSERT_OBJECTS = assert/assert.o
15
16 CTYPE_OBJECTS = ctype/isalnum.o \
17 ctype/isalpha.o ctype/isascii.o ctype/iscntrl.o ctype/isdigit.o ctype/isgraph.o \
18 ctype/islower.o ctype/isprint.o ctype/ispunct.o ctype/isspace.o ctype/isupper.o \
19 ctype/isxdigit.o ctype/toascii.o ctype/tolower.o ctype/toupper.o\
20 ctype/iscsym.o ctype/isctype.o
21
22 CONIO_OBJECTS = conio/cputs.o conio/getch.o conio/getche.o conio/putch.o conio/ungetch.o
23
24 DIRECT_OBJECTS = direct/chdir.o direct/chdrive.o direct/getcwd.o direct/getdrive.o \
25 direct/rmdir.o direct/mkdir.o direct/getdfree.o
26
27 MALLOC_OBJECTS = malloc/expand.o malloc/heap.o
28
29 #MISC_OBJECTS = misc/GetArgs.o misc/setnew.o misc/purecall.o
30 MISC_OBJECTS = misc/GetArgs.o
31
32 STRING_OBJECTS = string/memchr.o string/memcmp.o string/strcat.o \
33 string/strchr.o string/strcmp.o string/strcoll.o \
34 string/strcpy.o string/strcspn.o string/memcpy.o \
35 string/strlen.o string/strncat.o string/strncmp.o \
36 string/strncpy.o string/strpbrk.o string/strrchr.o \
37 string/strspn.o string/strstr.o string/strtok.o \
38 string/strxfrm.o string/memmove.o string/memset.o \
39 string/strdup.o string/strlwr.o string/strupr.o \
40 string/str_old.o string/strerror.o string/stricmp.o\
41 string/strnlen.o string/strnicmp.o
42
43 WCHAR_OBJECTS = wchar/wcscat.o wchar/wcschr.o wchar/wcscmp.o \
44 wchar/wcscoll.o wchar/wcscpy.o wchar/wcscspn.o \
45 wchar/wcsdup.o wchar/wcsicmp.o wchar/wcslen.o \
46 wchar/wcslwr.o wchar/wcsncat.o wchar/wcsncmp.o \
47 wchar/wcsncpy.o
48
49 STDIO_OBJECTS = stdio/getenv.o stdio/filbuf.o \
50 stdio/fclose.o stdio/feof.o stdio/ferror.o stdio/fileno.o\
51 stdio/fflush.o stdio/fgetc.o stdio/fgetpos.o stdio/fgets.o stdio/flsbuf.o \
52 stdio/fopen.o stdio/fprintf.o stdio/fputc.o stdio/fputs.o stdio/setvbuf.o\
53 stdio/fread.o stdio/freopen.o stdio/fscanf.o stdio/fseek.o \
54 stdio/fsetpos.o stdio/ftell.o stdio/fwalk.o stdio/fwrite.o stdio/getc.o \
55 stdio/getchar.o stdio/gets.o stdio/getw.o stdio/perror.o stdio/clearerr.o \
56 stdio/putc.o stdio/putchar.o stdio/puts.o stdio/putw.o \
57 stdio/remove.o stdio/rename.o stdio/rewind.o stdio/allocfil.o\
58 stdio/setbuf.o stdio/setbuffe.o stdlib/obsol.o stdio/setlineb.o\
59 stdio/scanf.o stdio/sscanf.o stdio/vscanf.o stdio/vsscanf.o stdio/vfscanf.o\
60 stdio/stdiohk.o stdio/stdhnd.o stdio/tempnam.o stdio/tmpfile.o stdio/tmpnam.o \
61 stdio/ungetc.o stdio/printf.o stdio/vfprintf.o stdio/vprintf.o stdio/sprintf.o\
62 stdio/fdopen.o stdio/vsprintf.o stdio/frlist.o \
63
64 QUAD_OBJECTS = quad/qdivrem.o quad/divdi3.o quad/moddi3.o quad/udivdi3.o quad/umoddi3.o
65
66 IO_OBJECTS = io/access.o io/close.o io/create.o io/dup.o io/dup2.o io/find.o io/isatty.o io/lseek.o \
67 io/open.o io/read.o io/setmode.o io/unlink.o io/write.o io/fmode.o io/mktemp.o\
68 io/chmod.o io/chsize.o io/commit.o io/locking.o io/pipe.o io/sopen.o io/filelen.o\
69 io/umask.o io/tell.o io/eof.o io/utime.o
70
71 SEARCH_OBJECTS = search/lsearch.o search/lfind.o
72
73 STDLIB_OBJECTS = stdlib/abort.o stdlib/abs.o stdlib/atexit.o stdlib/atof.o stdlib/atoi.o \
74 stdlib/bsearch.o stdlib/div.o stdlib/errno.o stdlib/_exit.o \
75 stdlib/fullpath.o stdlib/labs.o stdlib/ldiv.o \
76 stdlib/makepath.o stdlib/malloc.o stdlib/putenv.o stdlib/qsort.o \
77 stdlib/rand.o stdlib/senv.o stdlib/splitp.o stdlib/strtod.o stdlib/strtol.o \
78 stdlib/strtoul.o stdlib/swab.o stdlib/atol.o
79
80 SIGNAL_OBJECTS = signal/signal.o
81
82 PROCESS_OBJECTS = process/_cwait.o process/dll.o process/spawnl.o process/spawnlp.o process/spawnlpe.o process/spawnvpe.o process/spawnvp.o \
83 process/spawnv.o process/spawnve.o process/spawnle.o process/execl.o process/execlp.o process/execlpe.o \
84 process/execvpe.o process/execvp.o process/execv.o process/execle.o process/_system.o\
85 process/threadid.o
86
87 TCHAR_OBJECTS = tchar/strdec.o tchar/strinc.o tchar/strninc.o tchar/strncnt.o tchar/strnextc.o tchar/strspnp.o
88
89 TIME_OBJECTS = time/ctime.o time/difftime.o time/strftime.o time/time.o time/clock.o
90
91 FLOAT_OBJECTS = float/fpreset.o float/clearfp.o float/cntrlfp.o float/statfp.o float/logb.o\
92 float/chgsign.o float/fpclass.o float/isnan.o
93
94 SYS_STAT_OBJECTS = sys_stat/fstat.o sys_stat/stat.o sys_stat/futime.o
95
96
97
98 MATH_OBJECTS = math/acos.o math/acosh.o math/asin.o math/asinh.o math/atan.o math/atan2.o\
99 math/atanh.o math/ceil.o math/cos.o math/cosh.o math/exp.o math/fabs.o\
100 math/floor.o math/fmod.o math/frexp.o math/huge_val.o math/hypot.o\
101 math/ldexp.o math/log.o math/log10.o math/modf.o math/pow.o\
102 math/sin.o math/sinh.o math/sqrt.o math/tan.o\
103 math/tanh.o math/stubs.o math/j0_y0.o math/j1_y1.o math/jn_yn.o
104
105
106 #OBJECTS = $(ASSERT_OBJECTS) $(CTYPE_OBJECTS) $(CONIO_OBJECTS) $(DIRECT_OBJECTS)\
107 # $(MISC_OBJECTS) $(STRING_OBJECTS) $(STDIO_OBJECTS) $(STDLIB_OBJECTS) \
108 # $(IO_OBJECTS) $(PROCESS_OBJECTS) $(TIME_OBJECTS) $(MALLOC_OBJECTS)\
109 # $(SYS_STAT_OBJECTS) $(SIGNAL_OBJECTS) $(MATH_OBJECTS) $(FLOAT_OBJECTS)\
110 # $(SEARCH_OBJECTS) $(QUAD_OBJECTS)
111
112
113 OLD_OBJECTS = $(MISC_OBJECTS) stdlib/malloc.o stdlib/abort.o \
114 stdlib/_exit.o stdlib/atexit.o stdio/fileno.o io/fmode.o \
115 float/fpreset.o stdio/stdhnd.o io/setmode.o io/open.o \
116 stdio/vsprintf.o $(CTYPE_OBJECTS) stdlib/atoi.o stdlib/strtol.o \
117 stdio/flsbuf.o stdio/putc.o stdio/vfprintf.o $(STRING_OBJECTS)\
118 io/write.o io/isatty.o sys_stat/fstat.o misc/dllmain.o \
119 stdlib/errno.o stdio/printf.o stdio/vprintf.o\
120 $(QUAD_OBJECTS)
121
122 #RESOURCE_OBJECT = crtdll.coff
123
124 OBJECTS = $(MISC_OBJECTS) $(STDLIB_OBJECTS) $(IO_OBJECTS) \
125 $(FLOAT_OBJECTS) $(ASSERT_OBJECTS) $(PROCESS_OBJECTS) \
126 $(STDIO_OBJECTS) $(CTYPE_OBJECTS) $(MATH_OBJECTS) \
127 $(STRING_OBJECTS) $(TIME_OBJECTS) $(WCHAR_OBJECTS) \
128 $(SYS_STAT_OBJECTS) misc/dllmain.o $(MALLOC_OBJECTS) \
129 $(SEARCH_OBJECTS) $(CONIO_OBJECTS) $(DIRECT_OBJECTS) \
130 $(SIGNAL_OBJECTS) $(RESOURCE_OBJECT)
131
132 ifeq ($(DOSCLI), yes)
133 CLEAN_FILES = assert\*.o conio\*.o ctype\*.o direct\*.o dirent\*.o \
134 except\*.o float\*.o io\*.o libc\*.o locale\*.o malloc\*.o \
135 math\*.o mbstring\*.o misc\*.o process\*.o quad\*.o search\*.o \
136 setjmp\*.o stdio\*.o stdlib\*.o string\*.o sys_stat\*.o tchar\*.o \
137 time\*.o wchar\*.o crtdll.a crtdll.o crtdll.dll crtdll.sym
138 else
139 CLEAN_FILES = assert/*.o conio/*.o ctype/*.o direct/*.o dirent/*.o \
140 except/*.o float/*.o io/*.o libc/*.o locale/*.o malloc/*.o \
141 math/*.o mbstring/*.o misc/*.o process/*.o quad/*.o search/*.o \
142 setjmp/*.o stdio/*.o stdlib/*.o string/*.o sys_stat/*.o tchar/*.o \
143 time/*.o wchar/*.o crtdll.a crtdll.o crtdll.dll crtdll.sym
144 endif
145
146 crtdll.coff: crtdll.rc ../../include/reactos/resource.h
147 windres crtdll.rc crtdll.coff
148
149 crtdll.a: $(OBJECTS)
150 $(LD) -r $(OBJECTS) -o crtdll.a
151
152 crtdll.dll: $(DLLMAIN) $(OBJECTS) crtdll.def
153 $(LD) -r $(OBJECTS) -o crtdll.o
154 $(DLLTOOL) --dllname crtdll.dll --def crtdll.def \
155 --output-lib crtdll.a
156 $(CC) -specs=crt_specs -mdll -o junk.tmp \
157 -Wl,--base-file,base.tmp crtdll.o ../kernel32/kernel32.a
158 - $(RM) junk.tmp
159 $(DLLTOOL) --dllname crtdll.dll --base-file base.tmp \
160 --output-exp temp.exp --def crtdll.def
161 - $(RM) base.tmp
162 $(CC) -specs=crt_specs -mdll -o crtdll.dll crtdll.o \
163 ../kernel32/kernel32.a \
164 -Wl,--image-base,0x20000000 \
165 -Wl,--file-alignment,0x1000 \
166 -Wl,--section-alignment,0x1000 \
167 -Wl,temp.exp
168 - $(RM) temp.exp
169 $(NM) --numeric-sort crtdll.dll > crtdll.sym
170
171 clean: $(CLEAN_FILES:%=%_clean)
172
173 $(CLEAN_FILES:%=%_clean): %_clean:
174 - $(RM) $*
175
176
177 include ../../rules.mak
178