Subversion Repositories Kolibri OS

Rev

Rev 3923 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3923 Rev 4102
1
CC = gcc
1
CC = gcc
2
AR = ar rc
2
AR = ar rc
3
LD = ld
3
LD = ld
4
 
4
 
5
CFLAGS = -c -O2 -fomit-frame-pointer -DBUILD_DLL
5
CFLAGS = -c -O2 -fomit-frame-pointer -DBUILD_DLL
6
LDFLAGS = -nostdlib -shared -s -T libcdll.lds --output-def libc.orig.def --out-implib libc.dll.a --image-base 0
6
LDFLAGS = -nostdlib -shared -s -T libcdll.lds --output-def libc.orig.def --out-implib libc.dll.a --image-base 0
7
 
7
 
8
LIBC_TOPDIR   = .
8
LIBC_TOPDIR   = .
9
LIBC_INCLUDES = $(LIBC_TOPDIR)/include
9
LIBC_INCLUDES = $(LIBC_TOPDIR)/include
10
 
10
 
11
NAME:=	  libc
11
NAME:=	  libc
12
 
12
 
13
DEFINES:= -D_IEEE_LIBM
13
DEFINES:= -D_IEEE_LIBM
14
 
14
 
15
INCLUDES:=  -I $(LIBC_INCLUDES)
15
INCLUDES:=  -I $(LIBC_INCLUDES)
16
 
16
 
17
STATIC_SRCS:=					\
17
STATIC_SRCS:=					\
18
         		crt/start.S		\
18
         		crt/start.S		\
19
         		crt/crt1.c		\
19
         		crt/crt1.c		\
20
			crt/crt2.c		\
20
			crt/crt2.c		\
21
         		crt/chkstk.S		\
21
         		crt/chkstk.S		\
22
         		crt/exit.S		\
22
         		crt/exit.S		\
23
			pe/crtloader.c
23
			pe/crtloader.c
24
 
24
 
25
LIBDLL_SRCS:=					\
25
LIBDLL_SRCS:=					\
26
			crt/dllstart.c 		\
26
			crt/dllstart.c 		\
27
         		crt/chkstk.S         	\
27
         		crt/chkstk.S         	\
28
         		crt/exit.S           	\
28
         		crt/exit.S           	\
29
			crt/pseudo-reloc.c	\
29
			crt/pseudo-reloc.c	\
30
			crt/setjmp.S
30
			crt/setjmp.S
31
 
31
 
32
 
32
 
33
LIBCDLL_SRCS:=					\
33
LIBCDLL_SRCS:=					\
34
			crt/crtdll.c		\
34
			crt/crtdll.c		\
35
			crt/pseudo-reloc.c	\
35
			crt/pseudo-reloc.c	\
36
			crt/chkstk.S		\
36
			crt/chkstk.S		\
37
			crt/exit.S		\
37
			crt/exit.S		\
38
			pe/loader.c
38
			pe/loader.c
39
 
39
 
40
LIBCRT_SRCS:=					\
40
LIBCRT_SRCS:=					\
41
			crt/start.S		\
41
			crt/start.S		\
42
			crt/chkstk.S		\
42
			crt/chkstk.S		\
43
			crt/crt3.c		\
43
			crt/crt3.c		\
44
			crt/pseudo-reloc.c	\
44
			crt/pseudo-reloc.c	\
45
			pe/crtloader.c
45
			pe/crtloader.c
46
 
46
 
47
CORE_SRCS:=                   			\
47
CORE_SRCS:=                   			\
48
			argz/buf_findstr.c	\
48
			argz/buf_findstr.c	\
49
			argz/envz_get.c		\
49
			argz/envz_get.c		\
50
         		crt/emutls.c         	\
50
         		crt/emutls.c         	\
51
         		crt/thread.S         	\
51
         		crt/thread.S         	\
52
         		crt/tls.S            	\
52
         		crt/tls.S            	\
53
			crt/setjmp.S		\
53
			crt/setjmp.S		\
54
         		crt/assert.c         	\
54
         		crt/assert.c         	\
55
			crt/cpu_features.c	\
55
			crt/cpu_features.c	\
56
			ctype/ctype_.c 		\
56
			ctype/ctype_.c 		\
57
			ctype/isascii.c		\
57
			ctype/isascii.c		\
58
			ctype/isblank.c		\
58
			ctype/isblank.c		\
59
         		ctype/isalnum.c      	\
59
         		ctype/isalnum.c      	\
60
         		ctype/isalpha.c      	\
60
         		ctype/isalpha.c      	\
61
         		ctype/iscntrl.c      	\
61
         		ctype/iscntrl.c      	\
62
         		ctype/isdigit.c      	\
62
         		ctype/isdigit.c      	\
63
         		ctype/islower.c      	\
63
         		ctype/islower.c      	\
64
			ctype/isupper.c      	\
64
			ctype/isupper.c      	\
65
         		ctype/isprint.c      	\
65
         		ctype/isprint.c      	\
66
         		ctype/ispunct.c      	\
66
         		ctype/ispunct.c      	\
67
         		ctype/isspace.c      	\
67
         		ctype/isspace.c      	\
68
         		ctype/iswctype.c     	\
68
         		ctype/iswctype.c     	\
69
         		ctype/iswalnum.c     	\
69
         		ctype/iswalnum.c     	\
70
         		ctype/iswalpha.c     	\
70
         		ctype/iswalpha.c     	\
71
         		ctype/iswblank.c     	\
71
         		ctype/iswblank.c     	\
72
         		ctype/iswcntrl.c     	\
72
         		ctype/iswcntrl.c     	\
73
         		ctype/iswdigit.c     	\
73
         		ctype/iswdigit.c     	\
74
         		ctype/iswgraph.c     	\
74
         		ctype/iswgraph.c     	\
75
         		ctype/iswlower.c     	\
75
         		ctype/iswlower.c     	\
76
         		ctype/iswprint.c     	\
76
         		ctype/iswprint.c     	\
77
         		ctype/iswpunct.c     	\
77
         		ctype/iswpunct.c     	\
78
         		ctype/iswspace.c     	\
78
         		ctype/iswspace.c     	\
79
         		ctype/iswupper.c     	\
79
         		ctype/iswupper.c     	\
80
         		ctype/iswxdigit.c    	\
80
         		ctype/iswxdigit.c    	\
81
         		ctype/isxdigit.c     	\
81
         		ctype/isxdigit.c     	\
82
			ctype/toascii.c		\
82
			ctype/toascii.c		\
83
         		ctype/tolower.c      	\
83
         		ctype/tolower.c      	\
84
			ctype/toupper.c		\
84
			ctype/toupper.c		\
85
         		ctype/towctrans.c    	\
85
         		ctype/towctrans.c    	\
86
         		ctype/towlower.c     	\
86
         		ctype/towlower.c     	\
87
         		ctype/towupper.c     	\
87
         		ctype/towupper.c     	\
88
			ctype/wctrans.c		\
88
			ctype/wctrans.c		\
89
         		ctype/wctype.c       	\
89
         		ctype/wctype.c       	\
90
         		errno/errno.c        	\
90
         		errno/errno.c        	\
91
			locale/locale.c		\
91
			locale/locale.c		\
92
			locale/lctype.c		\
92
			locale/lctype.c		\
93
         		reent/impure.c       	\
93
         		reent/impure.c       	\
94
			reent/init_reent.c	\
94
			reent/init_reent.c	\
95
	         	reent/getreent.c     	\
95
	         	reent/getreent.c     	\
96
			reent/mutex.c		\
96
			reent/mutex.c		\
97
			reent/gettimeofdayr.c	\
97
			reent/gettimeofdayr.c	\
98
         		reent/hdlman.c       	\
98
         		reent/hdlman.c       	\
99
			reent/isattyr.c		\
99
			reent/isattyr.c		\
100
         		reent/openr.c        	\
100
         		reent/openr.c        	\
101
         		reent/closer.c       	\
101
         		reent/closer.c       	\
102
         		reent/readr.c        	\
102
         		reent/readr.c        	\
103
         		reent/lseekr.c       	\
103
         		reent/lseekr.c       	\
104
         		reent/fstatr.c       	\
104
         		reent/fstatr.c       	\
105
         		reent/writer.c       	\
105
         		reent/writer.c       	\
106
         		search/qsort.c       	\
106
         		search/qsort.c       	\
107
         		search/bsearch.c     	\
107
         		search/bsearch.c     	\
108
			signal/signal.c		\
108
			signal/signal.c		\
109
         		sys/create.c         	\
109
         		sys/create.c         	\
110
         		sys/delete.c         	\
110
         		sys/delete.c         	\
111
         		sys/finfo.c          	\
111
         		sys/finfo.c          	\
112
         		sys/read.c           	\
112
         		sys/read.c           	\
113
         		sys/write.c          	\
113
         		sys/write.c          	\
114
         		sys/fsize.c          	\
114
         		sys/fsize.c          	\
115
         		time/asctime.c       	\
115
         		time/asctime.c       	\
116
         		time/asctime_r.c     	\
116
         		time/asctime_r.c     	\
117
         		time/clock.c         	\
117
         		time/clock.c         	\
118
         		time/ctime.c         	\
118
         		time/ctime.c         	\
119
         		time/ctime_r.c       	\
119
         		time/ctime_r.c       	\
120
			time/difftime.c		\
120
			time/difftime.c		\
121
         		time/gettzinfo.c     	\
121
         		time/gettzinfo.c     	\
122
         		time/gmtime.c        	\
122
         		time/gmtime.c        	\
123
			time/gmtime_r.c		\
123
			time/gmtime_r.c		\
124
         		time/mktime.c        	\
124
         		time/mktime.c        	\
125
         		time/mktm_r.c        	\
125
         		time/mktm_r.c        	\
126
         		time/lcltime.c       	\
126
         		time/lcltime.c       	\
127
         		time/lcltime_r.c     	\
127
         		time/lcltime_r.c     	\
128
			time/strftime.c		\
128
			time/strftime.c		\
129
         		time/time.c          	\
129
         		time/time.c          	\
130
         		time/tzlock.c        	\
130
         		time/tzlock.c        	\
131
         		time/tzvars.c
131
         		time/tzvars.c
132
 
132
 
133
 
133
 
134
STDLIB_SRCS=                 			\
134
STDLIB_SRCS=                 			\
135
         		__atexit.c          	\
135
         		__atexit.c          	\
136
         		__call_atexit.c     	\
136
         		__call_atexit.c     	\
137
         		abort.c              	\
137
         		abort.c              	\
138
         		abs.c               	\
138
         		abs.c               	\
139
         		atof.c              	\
139
         		atof.c              	\
140
         		atoi.c              	\
140
         		atoi.c              	\
141
			atol.c			\
141
			atol.c			\
142
         		div.c               	\
142
         		div.c               	\
143
         		dtoa.c               	\
143
         		dtoa.c               	\
144
         		dtoastub.c          	\
144
         		dtoastub.c          	\
145
         		exit.c              	\
145
         		exit.c              	\
146
         		gdtoa-gethex.c      	\
146
         		gdtoa-gethex.c      	\
147
         		gdtoa-hexnan.c       	\
147
         		gdtoa-hexnan.c       	\
148
         		getenv.c             	\
148
         		getenv.c             	\
149
         		mprec.c              	\
149
         		mprec.c              	\
150
         		mbtowc.c             	\
150
         		mbtowc.c             	\
151
         		mbtowc_r.c           	\
151
         		mbtowc_r.c           	\
152
         		mbrtowc.c           	\
152
         		mbrtowc.c           	\
153
         		mlock.c              	\
153
         		mlock.c              	\
154
         		calloc.c             	\
154
         		calloc.c             	\
155
         		malloc.c             	\
155
         		malloc.c             	\
156
        		mallocr.c           	\
156
        		mallocr.c           	\
157
        		 rand.c               	\
157
        		 rand.c               	\
158
         		rand_r.c            	\
158
         		rand_r.c            	\
159
         		rand48.c            	\
159
         		rand48.c            	\
160
         		realloc.c            	\
160
         		realloc.c            	\
161
         		seed48.c             	\
161
         		seed48.c             	\
162
         		srand48.c            	\
162
         		srand48.c            	\
163
         		strtod.c            	\
163
         		strtod.c            	\
164
         		strtol.c             	\
164
         		strtol.c             	\
165
         		strtold.c            	\
165
         		strtold.c            	\
166
         		strtoll.c            	\
166
         		strtoll.c            	\
167
         		strtoll_r.c         	\
167
         		strtoll_r.c         	\
168
         		strtoul.c            	\
168
         		strtoul.c            	\
169
         		strtoull.c           	\
169
         		strtoull.c           	\
170
         		strtoull_r.c        	\
170
         		strtoull_r.c        	\
171
         		system.c            	\
171
         		system.c            	\
172
         		wcrtomb.c           	\
172
         		wcrtomb.c           	\
173
			wctomb_r.c
173
			wctomb_r.c
174
 
174
 
175
 
175
 
176
STRING_SRCS=      	memcpy.c    		\
176
STRING_SRCS=      	memcpy.c    		\
177
         		memcmp.c             	\
177
         		memcmp.c             	\
178
         		memmove.c            	\
178
         		memmove.c            	\
179
         		memset.c             	\
179
         		memset.c             	\
180
         		memchr.c             	\
180
         		memchr.c             	\
181
			stpcpy.c	     	\
181
			stpcpy.c	     	\
182
			stpncpy.c		\
182
			stpncpy.c		\
183
			strcat.c            	\
183
			strcat.c            	\
184
         		strchr.c           	\
184
         		strchr.c           	\
185
         		strcmp.c             \
185
         		strcmp.c             \
186
         		strcoll.c            \
186
         		strcoll.c            \
187
         		strcasecmp.c         \
187
         		strcasecmp.c         \
188
         		strncasecmp.c        \
188
         		strncasecmp.c        \
189
         		strncat.c            \
189
         		strncat.c            \
190
         		strncmp.c            \
190
         		strncmp.c            \
191
         		strncpy.c            \
191
         		strncpy.c            \
192
         		strndup.c            \
192
         		strndup.c            \
193
         		strndup_r.c          \
193
         		strndup_r.c          \
194
         		strnlen.c            \
194
         		strnlen.c            \
195
         		strcasestr.c         \
195
         		strcasestr.c         \
196
         		strdup.c             \
196
         		strdup.c             \
197
         		strdup_r.c           \
197
         		strdup_r.c           \
198
         		strerror.c           \
198
         		strerror.c           \
199
         		strlen.c             \
199
         		strlen.c             \
200
         		strrchr.c            \
200
         		strrchr.c            \
201
         		strpbrk.c            \
201
         		strpbrk.c            \
202
         		strsep.c             \
202
         		strsep.c             \
203
         		strstr.c             \
203
         		strstr.c             \
204
         		strtok.c             \
204
         		strtok.c             \
205
         		strtok_r.c           \
205
         		strtok_r.c           \
206
         		strupr.c             \
206
         		strupr.c             \
207
         		strcspn.c            \
207
         		strcspn.c            \
208
         		strspn.c             \
208
         		strspn.c             \
209
         		strcpy.c             \
209
         		strcpy.c             \
210
			u_strerr.c
210
			u_strerr.c
211
 
211
 
212
STDIO_SRCS=					\
212
STDIO_SRCS=					\
213
			clearerr.c		\
213
			clearerr.c		\
214
			diprintf.c		\
214
			diprintf.c		\
215
			dprintf.c		\
215
			dprintf.c		\
216
			printf.c		\
216
			printf.c		\
217
			putchar.c		\
217
			putchar.c		\
218
			fgetc.c			\
218
			fgetc.c			\
219
			fgets.c			\
219
			fgets.c			\
220
			fopen.c			\
220
			fopen.c			\
221
			fclose.c		\
221
			fclose.c		\
222
			fdopen.c		\
222
			fdopen.c		\
223
			fflush.c		\
223
			fflush.c		\
224
			flags.c			\
224
			flags.c			\
225
			fileno.c		\
225
			fileno.c		\
226
			findfp.c		\
226
			findfp.c		\
227
			fiprintf.c		\
227
			fiprintf.c		\
228
			fiscanf.c		\
228
			fiscanf.c		\
229
			fprintf.c		\
229
			fprintf.c		\
230
			fputc.c			\
230
			fputc.c			\
231
			fputs.c			\
231
			fputs.c			\
232
			fputwc.c		\
232
			fputwc.c		\
233
			fread.c			\
233
			fread.c			\
234
			freopen.c		\
234
			freopen.c		\
235
			fscanf.c		\
235
			fscanf.c		\
236
			fseek.c			\
236
			fseek.c			\
237
			fseeko.c		\
237
			fseeko.c		\
238
			ftell.c			\
238
			ftell.c			\
239
			ftello.c		\
239
			ftello.c		\
240
			fwrite.c		\
240
			fwrite.c		\
241
			fvwrite.c		\
241
			fvwrite.c		\
242
			fwalk.c			\
242
			fwalk.c			\
243
			putc.c			\
243
			putc.c			\
244
			puts.c			\
244
			puts.c			\
245
			refill.c		\
245
			refill.c		\
246
			rget.c			\
246
			rget.c			\
247
			remove.c		\
247
			remove.c		\
248
			rename.c		\
248
			rename.c		\
249
			setvbuf.c		\
249
			setvbuf.c		\
250
			stdio.c			\
250
			stdio.c			\
251
			tmpfile.c		\
251
			tmpfile.c		\
252
			tmpnam.c		\
252
			tmpnam.c		\
253
			ungetc.c		\
253
			ungetc.c		\
254
			vasniprintf.c		\
254
			vasniprintf.c		\
255
			vasnprintf.c		\
255
			vasnprintf.c		\
256
			vdprintf.c		\
256
			vdprintf.c		\
257
			vdiprintf.c		\
257
			vdiprintf.c		\
258
			vscanf.c		\
258
			vscanf.c		\
259
			vsprintf.c		\
259
			vsprintf.c		\
260
			vsnprintf.c		\
260
			vsnprintf.c		\
261
			vsscanf.c		\
261
			vsscanf.c		\
262
			makebuf.c		\
262
			makebuf.c		\
263
			wsetup.c		\
263
			wsetup.c		\
264
			wbuf.c			\
264
			wbuf.c			\
265
			sccl.c			\
265
			sccl.c			\
266
			siprintf.c		\
266
			siprintf.c		\
267
			sniprintf.c		\
267
			sniprintf.c		\
268
			snprintf.c		\
268
			snprintf.c		\
269
			sprintf.c		\
269
			sprintf.c		\
270
			sscanf.c
270
			sscanf.c
271
 
271
 
272
 
272
 
273
MATH_SRCS = 	e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c e_exp.c e_fmod.c	\
273
MATH_SRCS = 	e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c e_exp.c e_fmod.c	\
274
		e_hypot.c e_j0.c e_j1.c e_jn.c e_log.c e_log10.c e_pow.c e_rem_pio2.c 		\
274
		e_hypot.c e_j0.c e_j1.c e_jn.c e_log.c e_log10.c e_pow.c e_rem_pio2.c 		\
275
		e_remainder.c e_scalb.c e_sinh.c e_sqrt.c ef_acos.c ef_acosh.c ef_asin.c	\
275
		e_remainder.c e_scalb.c e_sinh.c e_sqrt.c ef_acos.c ef_acosh.c ef_asin.c	\
276
		ef_atan2.c ef_atanh.c ef_cosh.c ef_exp.c ef_fmod.c ef_hypot.c ef_j0.c ef_j1.c	\
276
		ef_atan2.c ef_atanh.c ef_cosh.c ef_exp.c ef_fmod.c ef_hypot.c ef_j0.c ef_j1.c	\
277
		ef_jn.c ef_log.c ef_log10.c ef_pow.c ef_rem_pio2.c ef_remainder.c ef_scalb.c	\
277
		ef_jn.c ef_log.c ef_log10.c ef_pow.c ef_rem_pio2.c ef_remainder.c ef_scalb.c	\
278
		ef_sinh.c ef_sqrt.c er_gamma.c er_lgamma.c erf_gamma.c erf_lgamma.c f_exp.c	\
278
		ef_sinh.c ef_sqrt.c er_gamma.c er_lgamma.c erf_gamma.c erf_lgamma.c f_exp.c	\
279
		f_expf.c f_llrint.c f_llrintf.c f_llrintl.c f_lrint.c f_lrintf.c f_lrintl.c	\
279
		f_expf.c f_llrint.c f_llrintf.c f_llrintl.c f_lrint.c f_lrintf.c f_lrintl.c	\
280
		f_pow.c f_powf.c f_rint.c f_rintf.c f_rintl.c k_cos.c k_rem_pio2.c k_sin.c	\
280
		f_pow.c f_powf.c f_rint.c f_rintf.c f_rintl.c k_cos.c k_rem_pio2.c k_sin.c	\
281
		k_standard.c k_tan.c kf_cos.c kf_rem_pio2.c kf_sin.c kf_tan.c s_asinh.c 	\
281
		k_standard.c k_tan.c kf_cos.c kf_rem_pio2.c kf_sin.c kf_tan.c s_asinh.c 	\
282
		s_atan.c s_cbrt.c s_ceil.c s_copysign.c s_cos.c s_erf.c s_exp10.c s_expm1.c	\
282
		s_atan.c s_cbrt.c s_ceil.c s_copysign.c s_cos.c s_erf.c s_exp10.c s_expm1.c	\
283
		s_fabs.c s_fdim.c s_finite.c s_floor.c s_fma.c s_fmax.c s_fmin.c s_fpclassify.c	\
283
		s_fabs.c s_fdim.c s_finite.c s_floor.c s_fma.c s_fmax.c s_fmin.c s_fpclassify.c	\
284
		s_frexp.c s_ilogb.c s_infconst.c s_infinity.c s_isinf.c s_isinfd.c s_isnan.c	\
284
		s_frexp.c s_ilogb.c s_infconst.c s_infinity.c s_isinf.c s_isinfd.c s_isnan.c	\
285
		s_isnand.c s_ldexp.c s_lib_ver.c s_llrint.c s_llround.c s_log1p.c s_log2.c	\
285
		s_isnand.c s_ldexp.c s_lib_ver.c s_llrint.c s_llround.c s_log1p.c s_log2.c	\
286
		s_logb.c s_lrint.c s_lround.c s_matherr.c s_modf.c s_nan.c s_nearbyint.c	\
286
		s_logb.c s_lrint.c s_lround.c s_matherr.c s_modf.c s_nan.c s_nearbyint.c	\
287
		s_nextafter.c s_pow10.c s_remquo.c s_rint.c s_round.c s_scalbln.c s_scalbn.c	\
287
		s_nextafter.c s_pow10.c s_remquo.c s_rint.c s_round.c s_scalbln.c s_scalbn.c	\
288
		s_signbit.c s_signif.c s_sin.c s_tan.c s_tanh.c s_trunc.c scalblnl.c scalbnl.c	\
288
		s_signbit.c s_signif.c s_sin.c s_tan.c s_tanh.c s_trunc.c scalblnl.c scalbnl.c	\
289
		sf_asinh.c sf_atan.c sf_cbrt.c sf_ceil.c sf_copysign.c sf_cos.c sf_erf.c 	\
289
		sf_asinh.c sf_atan.c sf_cbrt.c sf_ceil.c sf_copysign.c sf_cos.c sf_erf.c 	\
290
		sf_exp10.c sf_expm1.c sf_fabs.c sf_fdim.c sf_finite.c sf_floor.c sf_fma.c	\
290
		sf_exp10.c sf_expm1.c sf_fabs.c sf_fdim.c sf_finite.c sf_floor.c sf_fma.c	\
291
		sf_fmax.c sf_fmin.c sf_fpclassify.c sf_frexp.c sf_ilogb.c sf_infinity.c		\
291
		sf_fmax.c sf_fmin.c sf_fpclassify.c sf_frexp.c sf_ilogb.c sf_infinity.c		\
292
		sf_isinf.c sf_isinff.c sf_isnan.c sf_isnanf.c sf_ldexp.c sf_llrint.c		\
292
		sf_isinf.c sf_isinff.c sf_isnan.c sf_isnanf.c sf_ldexp.c sf_llrint.c		\
293
		sf_llround.c sf_log1p.c sf_log2.c sf_logb.c sf_lrint.c sf_lround.c sf_modf.c	\
293
		sf_llround.c sf_log1p.c sf_log2.c sf_logb.c sf_lrint.c sf_lround.c sf_modf.c	\
294
		sf_nan.c sf_nearbyint.c sf_nextafter.c sf_pow10.c sf_remquo.c sf_rint.c		\
294
		sf_nan.c sf_nearbyint.c sf_nextafter.c sf_pow10.c sf_remquo.c sf_rint.c		\
295
		sf_round.c sf_scalbln.c sf_scalbn.c sf_signif.c sf_sin.c sf_tan.c sf_tanh.c	\
295
		sf_round.c sf_scalbln.c sf_scalbn.c sf_signif.c sf_sin.c sf_tan.c sf_tanh.c	\
296
		sf_trunc.c w_acos.c w_acosh.c w_asin.c w_atan2.c w_atanh.c w_cosh.c w_drem.c	\
296
		sf_trunc.c w_acos.c w_acosh.c w_asin.c w_atan2.c w_atanh.c w_cosh.c w_drem.c	\
297
		w_exp.c w_exp2.c w_fmod.c w_gamma.c w_hypot.c w_j0.c w_j1.c w_jn.c w_lgamma.c	\
297
		w_exp.c w_exp2.c w_fmod.c w_gamma.c w_hypot.c w_j0.c w_j1.c w_jn.c w_lgamma.c	\
298
		w_log.c w_log10.c w_pow.c w_remainder.c w_scalb.c w_sincos.c w_sinh.c w_sqrt.c	\
298
		w_log.c w_log10.c w_pow.c w_remainder.c w_scalb.c w_sincos.c w_sinh.c w_sqrt.c	\
299
		w_tgamma.c wf_acos.c wf_acosh.c wf_asin.c wf_atan2.c wf_atanh.c wf_cosh.c	\
299
		w_tgamma.c wf_acos.c wf_acosh.c wf_asin.c wf_atan2.c wf_atanh.c wf_cosh.c	\
300
		wf_drem.c wf_exp.c wf_exp2.c wf_fmod.c wf_gamma.c wf_hypot.c wf_j0.c wf_j1.c	\
300
		wf_drem.c wf_exp.c wf_exp2.c wf_fmod.c wf_gamma.c wf_hypot.c wf_j0.c wf_j1.c	\
301
		wf_jn.c wf_lgamma.c wf_log.c wf_log10.c wf_pow.c wf_remainder.c wf_scalb.c	\
301
		wf_jn.c wf_lgamma.c wf_log.c wf_log10.c wf_pow.c wf_remainder.c wf_scalb.c	\
302
		wf_sincos.c wf_sinh.c wf_sqrt.c wf_tgamma.c wr_gamma.c wr_lgamma.c wrf_gamma.c	\
302
		wf_sincos.c wf_sinh.c wf_sqrt.c wf_tgamma.c wr_gamma.c wr_lgamma.c wrf_gamma.c	\
303
		wrf_lgamma.c	\
303
		wrf_lgamma.c	\
304
		f_atan2.S f_atan2f.S f_frexp.S f_frexpf.S f_ldexp.S f_ldexpf.S f_log.S		\
304
		f_atan2.S f_atan2f.S f_frexp.S f_frexpf.S f_ldexp.S f_ldexpf.S f_log.S		\
305
		f_log10.S f_log10f.S f_logf.S f_tan.S f_tanf.S
305
		f_log10.S f_log10f.S f_logf.S f_tan.S f_tanf.S
306
 
306
 
307
 
307
 
308
STATIC_OBJS =  $(patsubst %.S, %.o, $(patsubst %.c, %.o, $(STATIC_SRCS)))
308
STATIC_OBJS =  $(patsubst %.S, %.o, $(patsubst %.c, %.o, $(STATIC_SRCS)))
309
 
309
 
310
LIBCRT_OBJS =  $(patsubst %.S, %.o, $(patsubst %.c, %.o, $(LIBCRT_SRCS)))
310
LIBCRT_OBJS =  $(patsubst %.S, %.o, $(patsubst %.c, %.o, $(LIBCRT_SRCS)))
311
 
311
 
312
LIBDLL_OBJS =  $(patsubst %.S, %.o, $(patsubst %.c, %.o, $(LIBDLL_SRCS)))
312
LIBDLL_OBJS =  $(patsubst %.S, %.o, $(patsubst %.c, %.o, $(LIBDLL_SRCS)))
313
 
313
 
314
LIBCDLL_OBJS =  $(patsubst %.S, %.o, $(patsubst %.c, %.o, $(LIBCDLL_SRCS)))
314
LIBCDLL_OBJS =  $(patsubst %.S, %.o, $(patsubst %.c, %.o, $(LIBCDLL_SRCS)))
315
 
315
 
316
CORE_OBJS =  $(patsubst %.S, %.o, $(patsubst %.asm, %.obj,\
316
CORE_OBJS =  $(patsubst %.S, %.o, $(patsubst %.asm, %.obj,\
317
            $(patsubst %.c, %.o, $(CORE_SRCS))))
317
            $(patsubst %.c, %.o, $(CORE_SRCS))))
318
 
318
 
319
STDIO_OBJS =  $(patsubst %.c, stdio/%.o,$(STDIO_SRCS))
319
STDIO_OBJS =  $(patsubst %.c, stdio/%.o,$(STDIO_SRCS))
320
 
320
 
321
 
321
 
322
STRING_OBJS =  $(patsubst %.S, string/%.o, $(patsubst %.asm, string/%.o,\
322
STRING_OBJS =  $(patsubst %.S, string/%.o, $(patsubst %.asm, string/%.o,\
323
               $(patsubst %.c, string/%.o, $(STRING_SRCS))))
323
               $(patsubst %.c, string/%.o, $(STRING_SRCS))))
324
 
324
 
325
STDLIB_OBJS =  $(patsubst %.S, stdlib/%.o, $(patsubst %.asm, stdlib/%.o,\
325
STDLIB_OBJS =  $(patsubst %.S, stdlib/%.o, $(patsubst %.asm, stdlib/%.o,\
326
               $(patsubst %.c, stdlib/%.o, $(STDLIB_SRCS))))
326
               $(patsubst %.c, stdlib/%.o, $(STDLIB_SRCS))))
327
 
327
 
328
 
328
 
329
MATH_OBJS =  $(patsubst %.S, math/%.o, $(patsubst %.asm, math/%.o,\
329
MATH_OBJS =  $(patsubst %.S, math/%.o, $(patsubst %.asm, math/%.o,\
330
               $(patsubst %.c, math/%.o, $(MATH_SRCS))))
330
               $(patsubst %.c, math/%.o, $(MATH_SRCS))))
331
 
331
 
332
 
332
 
333
PRINTF_OBJS= 	stdio/vfprintf.o	\
333
PRINTF_OBJS= 	stdio/vfprintf.o	\
334
		stdio/vfiprintf.o	\
334
		stdio/vfiprintf.o	\
335
		stdio/svfprintf.o	\
335
		stdio/svfprintf.o	\
336
		stdio/svfiprintf.o	\
336
		stdio/svfiprintf.o	\
337
		stdio/vfscanf.o		\
337
		stdio/vfscanf.o		\
338
		stdio/vfiscanf.o	\
338
		stdio/vfiscanf.o	\
339
		stdio/svscanf.o		\
339
		stdio/svscanf.o		\
340
		stdio/svfiscanf.o
340
		stdio/svfiscanf.o
341
 
341
 
342
ifeq ($(findstring static,$(MAKECMDGOALS)),static)
342
ifeq ($(findstring static,$(MAKECMDGOALS)),static)
343
 
343
 
344
LIB_SRCS:=  	$(STATIC_SRCS)
344
LIB_SRCS:=  	$(STATIC_SRCS)
345
LIB_OBJS:=  	$(STATIC_OBJS)
345
LIB_OBJS:=  	$(STATIC_OBJS)
346
 
346
 
347
else
347
else
348
 
348
 
349
LIB_SRCS:=  	$(LIBCDLL_SRCS)
349
LIB_SRCS:=  	$(LIBCDLL_SRCS)
350
LIB_OBJS:=  	$(LIBCDLL_OBJS)
350
LIB_OBJS:=  	$(LIBCDLL_OBJS)
351
 
351
 
352
endif
352
endif
353
 
353
 
354
LIB_SRCS+=				\
354
LIB_SRCS+=				\
355
		$(CORE_SRCS)		\
355
		$(CORE_SRCS)		\
356
		$(STDIO_SRCS) 		\
356
		$(STDIO_SRCS) 		\
357
		$(STRING_SRCS)		\
357
		$(STRING_SRCS)		\
358
		$(STDLIB_SRCS)
358
		$(STDLIB_SRCS)
359
 
359
 
360
LIB_OBJS+=				\
360
LIB_OBJS+=				\
361
		$(CORE_OBJS) 		\
361
		$(CORE_OBJS) 		\
362
		$(STRING_OBJS) 		\
362
		$(STRING_OBJS) 		\
363
		$(STDLIB_OBJS)		\
363
		$(STDLIB_OBJS)		\
364
		$(STDIO_OBJS) 		\
364
		$(STDIO_OBJS) 		\
365
		$(PRINTF_OBJS) 		\
365
		$(PRINTF_OBJS) 		\
366
		$(MATH_OBJS)
366
		$(MATH_OBJS)
367
 
367
 
368
 
368
 
369
 
369
 
370
shared: $(NAME).dll libcrt.a libdll.a
370
shared: $(NAME).dll libcrt.a libdll.a
371
 
371
 
372
 
372
 
373
$(NAME).dll: $(LIB_OBJS) $(SRC_DEP) Makefile
373
$(NAME).dll: $(LIB_OBJS) $(SRC_DEP) Makefile
374
	$(LD) $(LDFLAGS) --exclude-symbols __chkstk,__chkstk_ms,_alloca -Map libcmap -L. -o $@ $(LIB_OBJS) -lgcc --version-script libc.ver
374
	$(LD) $(LDFLAGS) --exclude-symbols __chkstk,__chkstk_ms,_alloca -Map libcmap -L. -o $@ $(LIB_OBJS) -lgcc --version-script libc.ver
375
	sed -e "s/ @[^ ]*//" libc.orig.def > libc.def
375
	sed -e "s/ @[^ ]*//" libc.orig.def > libc.def
376
	sed -f cmd1.sed libc.def > mem
376
	sed -f cmd1.sed libc.def > mem
377
	sed -f cmd2.sed mem >libc.inc 
377
	sed -f newlib.sed mem >libc.inc 
378
 
378
 
379
 
379
 
380
libcrt.a: $(LIBCRT_OBJS) Makefile
380
libcrt.a: $(LIBCRT_OBJS) Makefile
381
	$(AR) libcrt.a $(LIBCRT_OBJS)
381
	$(AR) libcrt.a $(LIBCRT_OBJS)
382
 
382
 
383
libdll.a: $(LIBDLL_OBJS) Makefile
383
libdll.a: $(LIBDLL_OBJS) Makefile
384
	$(AR) libdll.a $(LIBDLL_OBJS)
384
	$(AR) libdll.a $(LIBDLL_OBJS)
385
 
385
 
386
 
386
 
387
static: $(NAME).a
387
static: $(NAME).a
388
 
388
 
389
$(NAME).a: $(LIB_OBJS) $(SRC_DEP) Makefile
389
$(NAME).a: $(LIB_OBJS) $(SRC_DEP) Makefile
390
	$(AR) $(NAME).a $(LIB_OBJS)
390
	$(AR) $(NAME).a $(LIB_OBJS)
391
 
391
 
392
 
392
 
393
 
393
 
394
stdio/vfprintf.o: stdio/vfprintf.c
394
stdio/vfprintf.o: stdio/vfprintf.c
395
	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DFLOATING_POINT -c stdio/vfprintf.c -o $@
395
	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DFLOATING_POINT -c stdio/vfprintf.c -o $@
396
 
396
 
397
stdio/vfiprintf.o: stdio/vfprintf.c
397
stdio/vfiprintf.o: stdio/vfprintf.c
398
	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DINTEGER_ONLY -c stdio/vfprintf.c -o $@
398
	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DINTEGER_ONLY -c stdio/vfprintf.c -o $@
399
 
399
 
400
stdio/svfprintf.o: stdio/vfprintf.c
400
stdio/svfprintf.o: stdio/vfprintf.c
401
	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DSTRING_ONLY -c stdio/vfprintf.c -o $@
401
	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DSTRING_ONLY -c stdio/vfprintf.c -o $@
402
 
402
 
403
stdio/svfiprintf.o: stdio/vfprintf.c
403
stdio/svfiprintf.o: stdio/vfprintf.c
404
	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DINTEGER_ONLY -DSTRING_ONLY -c stdio/vfprintf.c -o $@
404
	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DINTEGER_ONLY -DSTRING_ONLY -c stdio/vfprintf.c -o $@
405
 
405
 
406
 
406
 
407
stdio/vfscanf.o: stdio/vfscanf.c
407
stdio/vfscanf.o: stdio/vfscanf.c
408
	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES)	stdio/vfscanf.c -o $@
408
	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES)	stdio/vfscanf.c -o $@
409
 
409
 
410
stdio/vfiscanf.o: stdio/vfscanf.c
410
stdio/vfiscanf.o: stdio/vfscanf.c
411
	$(CC) $(CFLAGS) $(DEFINES) -DINTEGER_ONLY $(INCLUDES) stdio/vfscanf.c -o $@
411
	$(CC) $(CFLAGS) $(DEFINES) -DINTEGER_ONLY $(INCLUDES) stdio/vfscanf.c -o $@
412
 
412
 
413
stdio/svscanf.o: stdio/vfscanf.c
413
stdio/svscanf.o: stdio/vfscanf.c
414
	$(CC) $(CFLAGS) $(DEFINES) -DSTRING_ONLY $(INCLUDES) stdio/vfscanf.c -o $@
414
	$(CC) $(CFLAGS) $(DEFINES) -DSTRING_ONLY $(INCLUDES) stdio/vfscanf.c -o $@
415
 
415
 
416
 
416
 
417
stdio/svfiscanf.o: stdio/vfscanf.c
417
stdio/svfiscanf.o: stdio/vfscanf.c
418
	$(CC) $(CFLAGS) $(DEFINES) -DINTEGER_ONLY -DSTRING_ONLY $(INCLUDES) stdio/vfscanf.c -o $@
418
	$(CC) $(CFLAGS) $(DEFINES) -DINTEGER_ONLY -DSTRING_ONLY $(INCLUDES) stdio/vfscanf.c -o $@
419
 
419
 
420
 
420
 
421
 
421
 
422
%.obj : %.asm Makefile
422
%.obj : %.asm Makefile
423
	fasm $< $
423
	fasm $< $
424
 
424
 
425
%.o : %.c Makefile
425
%.o : %.c Makefile
426
	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
426
	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
427
 
427
 
428
 
428
 
429
clean:
429
clean:
430
	-rm -f */*.o
430
	-rm -f */*.o
431
 
431
 
432
 
432
 
433
clean:
433
clean:
434
>
434
>