- Made pciuhci.device and pciehci.device compile again: completed
[AROS.git] / compiler / clib / mmakefile.src
blob5ac794a5a92087cf69c4b0bbaf3e7e1418788147
1 # $Id$
2 include $(TOP)/config/make.cfg
5 #   This is a rather special makefile. It builds both a shared library
6 #   and a link library from the same source, with only a small amount of
7 #   overlap.
9 USER_CFLAGS :=  -I$(SRCDIR)/$(CURDIR) -I$(SRCDIR)/$(CURDIR)/include \
10         -D__mb_cur_max=MB_CUR_MAX               \
11         -DADATE="\"$(shell date '+%d.%m.%Y')\"" \
12         -fno-builtin
14 TESTDIR := $(BINDIR)/Tests
16 # Lists of files
17 #   - Common always exist in the link library.
19 COMMON  := \
20         __alloca \
21         __filesystem_support \
22         __isinf \
23         atof \
24         div \
25         _errstrings \
26         getopt \
27         getopt_long \
28         isinf \
29         ldiv \
30         lldiv \
31         mblen \
32         mbtowc \
33         mbstowcs \
34         memchr \
35         memcmp \
36         memcpy \
37         memmove \
38         memset \
39         putchar \
40         stcd_l \
41         stcl_d \
42         stcl_h \
43         stcl_o \
44         stch_l \
45         stco_l \
46         stcu_d \
47         stccpy \
48         stpblk \
49         stpcpy \
50         stpsym \
51         strcasecmp \
52         strcasestr \
53         strcat \
54         strchr \
55         strcmp \
56         strcoll \
57         strcpy \
58         strcspn \
59         strdup \
60         strndup \
61         strlcat \
62         strlcpy \
63         strlen \
64         strlwr \
65         strncasecmp \
66         strncat \
67         strncmp \
68         strncpy \
69         strpbrk \
70         strrchr \
71         strrev \
72         strsep \
73         strspn \
74         strstr \
75         strtod \
76         strtok \
77         strupr \
78         strxfrm \
79         swab \
80         wctomb \
81         wcstombs
83 COMMON_ARCH := \
84         longjmp \
85         setjmp
87 #   - Shared are in either the shared linklib, or the arosc module
88 SHARED  := \
89         __arosc_gmtoffset \
90         __arosc_init \
91         __arosc_ioerr2errno \
92         __arosc_nixmain \
93         __arosc_set_environptr \
94         __arosc_startup \
95         __arosc_userdata \
96         __assert \
97         __ctype \
98         __get_default_file \
99         __env \
100         __exec \
101         __exitfunc \
102         __fdesc \
103         __rand48 \
104         __signal \
105         __spawnv \
106         __stat \
107         __stdio \
108         __upath \
109         __vcformat \
110         __vcscan \
111         __vfork \
112         abort \
113         abs \
114         access \
115         asctime \
116         asctime_r \
117         atexit \
118         atoi \
119         atol \
120         basename \
121         bsearch \
122         calloc \
123         cfgetispeed \
124         cfgetospeed \
125         cfsetispeed \
126         cfsetospeed \
127         chdir \
128         chmod \
129         chown \
130         clearerr \
131         ctime \
132         ctime_r \
133         clock \
134         close \
135         closedir \
136         creat \
137         difftime \
138         dirfd \
139         dirname \
140         drand48 \
141         dup \
142         dup2 \
143         endgrent \
144         endpwent \
145         erand48 \
146         execl \
147         execlp \
148         execv \
149         execve \
150         execvp \
151         exit \
152         _exit \
153     fchdir \
154         fchmod \
155         fchown \
156         fclose \
157         fcntl \
158         fdopen \
159         feof \
160         ferror \
161         fflush \
162         fgetc \
163         fgetpos \
164         fgets \
165         fileno \
166         flock \
167         fopen \
168         fprintf \
169         fscanf \
170         fsync \
171         fputc \
172         fputs \
173         fread \
174         free \
175         freopen \
176         fseek \
177         fseeko \
178         fsetpos \
179         fstat \
180         ftell \
181         ftello \
182         ftime \
183         ftruncate \
184         fwrite \
185         gcvt \
186         getc \
187         getchar \
188         getcwd \
189         getenv \
190         getfsstat \
191         statfs \
192         getpid \
193         getrlimit \
194         gettimeofday \
195         getuid \
196         geteuid \
197         getgid \
198         getegid \
199         getgrgid \
200         getgroups \
201         getgrnam \
202         getgrent \
203         getlogin \
204         getpgrp \
205         getppid \
206         getpwent \
207         getpwnam \
208         getpwuid \
209         gets \
210         getw \
211         getloadavg \
212         gmtime \
213     gmtime_r \
214         isatty \
215         ioctl \
216         jrand48 \
217         kill \
218         labs \
219         lcong48 \
220         link \
221         localeconv \
222         localtime \
223         localtime_r \
224         lrand48 \
225         lseek \
226         lstat \
227         malloc \
228         mkdir \
229         mknod \
230         mkstemp \
231         mktemp \
232         mktime \
233         mrand48 \
234         nanosleep \
235         nrand48 \
236         on_exit \
237         open \
238         opendir \
239         pathconf \
240         pclose \
241         perror \
242         pipe \
243         popen \
244         posix_memalign \
245         printf \
246         putenv \
247         putc \
248         puts \
249         putw \
250         qsort \
251         raise \
252         rand \
253         random \
254         read \
255         readdir \
256         readlink \
257         realloc \
258         realloc_nocopy \
259         realpath \
260         regex/regerror  \
261         regex/regexec   \
262         regex/regcomp   \
263         regex/regfree   \
264         remove \
265         rename \
266         rewind \
267         rewinddir \
268         rmdir \
269         scanf \
270         seed48 \
271         seekdir \
272         setbuf \
273         setenv \
274         setgid \
275         setgrent \
276         setlinebuf \
277         setlocale \
278         setpwent \
279         setrlimit \
280         setuid \
281         setvbuf \
282         sharecontextwithchild \
283         sigaction \
284         sigaddset \
285         sigdelset \
286         sigemptyset \
287         sigfillset \
288         sigismember \
289         signal \
290         sigpending \
291         sigprocmask \
292         sigsuspend \
293         sleep \
294         snprintf \
295         spawnv \
296         spawnvp \
297         sprintf \
298         srand48 \
299         sscanf \
300         stat \
301         strftime \
302         strerror \
303         strptime \
304         strtoimax \
305         strtol \
306         strtoll \
307         strtoul \
308         strtoull \
309         strtoumax \
310         sync \
311         sysconf \
312         symlink \
313         system \
314         tcgetattr \
315         telldir \
316         tempnam \
317         time \
318         times \
319         tmpfile \
320         tmpnam \
321         truncate \
322         tcsetattr \
323         ttyname \
324         umask \
325         ungetc \
326         uname \
327         unlink \
328         unsetenv \
329         updatestdio \
330         usleep \
331         utime \
332         utimes \
333         vfprintf \
334         vfscanf \
335         vprintf \
336         vscanf \
337         vsnprintf \
338         vsprintf \
339         vsscanf \
340         wait \
341         waitpid \
342         write
344 SHARED_ARCH := \
345     vfork \
346     vfork_longjmp
348 SHARED_LINKLIB := \
349         arosc_environ \
350         bcmp \
351         bcopy \
352         bzero \
353         __ctype_linklib
355 # Note: These files are compiled differently
356 #       depending on whether -DAROSC_ROM is used
357 #       or not.
358 ROM_ONLY := \
359         __ctype \
360         __arosc_userdata \
361         __assert_kernel \
362         __vcformat \
363         __vcscan
365 ROM_COMMON := \
366         atof \
367         div \
368         ldiv \
369         lldiv \
370         mblen \
371         mbtowc \
372         mbstowcs \
373         memchr \
374         memcmp \
375         memcpy \
376         memmove \
377         memset \
378         stccpy \
379         stcd_l \
380         stcl_d \
381         stcl_h \
382         stcl_o \
383         stch_l \
384         stco_l \
385         stcu_d \
386         stpblk \
387         stpcpy \
388         strcasecmp \
389         strcasestr \
390         strcat \
391         strchr \
392         strcmp \
393         strcpy \
394         strcspn \
395         _errstrings \
396         strerror_rom \
397         strlen \
398         strlcat \
399         strlcpy \
400         strncasecmp \
401         strncat \
402         strncmp \
403         strncpy \
404         strpbrk \
405         strrchr \
406         strrev \
407         strspn \
408         strstr \
409         strtod \
410         wctomb \
411         wcstombs
413 ROM_COMMON_ARCH := \
414         longjmp \
415         setjmp
417 # Objects for libarosc.static.a, from the static build.
418 ROM_STATIC := \
419         __filesystem_support \
420         __isinf \
421         abs \
422         atoi \
423         atol \
424         bsearch \
425         isinf \
426         labs \
427         qsort \
428         rand_rom \
429         snprintf \
430         sprintf \
431         sscanf \
432         stcd_l \
433         stch_l \
434         stcl_d \
435         strchr \
436         strerror_rom \
437         strspn \
438         strtol \
439         strtoll \
440         strtoul \
441         strtoull \
442         strtok \
443         vsnprintf \
444         vsprintf \
445         vsscanf
448 #MM- core-linklibs : linklibs-arosc linklibs-rom
449 #MM- linklibs : linklibs-clib-shared-linklib linklibs-rom
450 #MM- linklibs-clib : linklibs-clib-shared linklibs-rom
451 #MM- linklibs-clib-shared : includes linklibs-mlib \
452 #MM      linklibs-clib-common linklibs-autoinit
453 #MM- linklibs-clib-shared-linklib : includes linklibs-clib-common
454 #MM- linklibs-rom : includes linklibs-clib-common
455 #MM- linklibs-clib-quick : linklibs-clib-shared-quick \
456 #MM      linklibs-clib-common-quick linklibs-rom-quick
457 #MM- linklibs-clib-clean : linklibs-clib-shared-clean \
458 #MM      linklibs-clib-common-clean linklibs-rom-clean
460 #MM- linklibs-clib-quick : linklibs-clib-shared-quick linklibs-rom-quick
462 %build_linklib mmake=linklibs-clib-common \
463     libname=arosccommon files="$(COMMON) $(add-prefix arch/,$(COMMON_ARCH))" \
464     libdir=$(OBJDIR)
467 #   Also build $(AROS_LIB)/libarosc.static.a
469 #   This is a library that is allowed to be used inside modules and the
470 #   kernel. It must include no code which refers to global variables.
472 #   Currently the main difference is that it includes a different __assert()
473 #   function to handle asserts in the kernel.
475 ROM_ARCH_OBJS := $(addsuffix .o, \
476     $(addprefix $(OBJDIR)/arch/,$(ROM_COMMON_ARCH)) \
478 %build_linklib mmake=linklibs-rom \
479     libname=arosc.static files="$(ROM_ONLY) $(ROM_COMMON) $(ROM_STATIC)" objs="$(ROM_ARCH_OBJS)" \
480     cflags="$(CFLAGS) -DAROSC_STATIC -DAROSC_ROM" \
481     objdir=$(OBJDIR)/static
485 AROSC_LINKLIB_OBJS := $(addsuffix .o, \
486     $(addprefix $(OBJDIR)/,$(COMMON)) \
487     $(addprefix $(OBJDIR)/arch/,$(COMMON_ARCH)) \
489 USER_LDFLAGS := -L$(OBJDIR)
490 %build_module mmake=linklibs-clib-shared \
491     modname=arosc modtype=library objdir=$(OBJDIR)/shared \
492     cflags="$(CFLAGS) -DAROSC_SHARED" \
493     files="$(SHARED) $(SHARED_ARCH)" \
494     linklibfiles=$(SHARED_LINKLIB) linklibobjs=$(AROSC_LINKLIB_OBJS) \
495     uselibs="arosccommon"
498 # x86_64 needs a reduced 32bit libarosc.a lib.
499 %rule_compile_multi basenames=$(ROM_COMMON) \
500     cflags="-m32 -DAROSC_LIB32 $(CFLAGS)" targetdir=$(OBJDIR)/32bit
502 ROM_COMMON_OBJ32 := $(addsuffix .o, $(addprefix $(OBJDIR)/32bit/,$(ROM_COMMON)))
503 %build_linklib mmake=linklibs-clib32 \
504     libname=arosc.static files="$(ROM_ONLY) $(ROM_STATIC)" objs=$(ROM_COMMON_OBJ32) \
505     cflags="-m32 $(CFLAGS) -DAROSC_LIB32 -DAROSC_STATIC -DAROSC_ROM" \
506     objdir=$(GENDIR)/$(CURDIR)/32bit libdir=$(GENDIR)/lib32
510 check : $(TESTDIR)/snprintf
512 $(TESTDIR)/snprintf : snprintf.c $(LIBDIR)/startup.o $(DEPLIBS)
513         $(CC) -DTEST $(ILDFLAGS) $< -o $@ $(LIBS)
516 clean ::
517         -$(RM) $(OBJDIR) *.err $(LIB)