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
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')\"" \
14 # FIXME: temporary fix for local/xxx.c
15 USER_CFLAGS += -D__BSD_VISIBLE=1
17 TESTDIR := $(BINDIR)/Tests
20 # - Common always exist in the link library.
24 __filesystem_support \
85 # - Shared are in either the shared linklib, or the arosc.library module
89 __arosc_set_environptr \
220 locale/fix_grouping \
239 locale/setrunelocale \
307 sharecontextwithchild \
384 # Note: These files are compiled differently
385 # depending on whether -DAROSC_ROM is used
449 # Objects for rom.lib, from the static build.
451 __filesystem_support \
480 #MM- core-linklibs : linklibs-arosc linklibs-rom
481 #MM- linklibs : linklibs-clib-shared-linklib linklibs-rom
482 #MM- linklibs-clib : linklibs-clib-shared linklibs-rom
483 #MM- linklibs-clib-shared : includes linklibs-mlib \
484 #MM linklibs-clib-common linklibs-autoinit
485 #MM- linklibs-clib-shared-linklib : includes linklibs-clib-common
486 #MM- linklibs-rom : includes linklibs-clib-common
487 #MM- linklibs-clib-quick : linklibs-clib-shared-quick \
488 #MM linklibs-clib-common-quick linklibs-rom-quick
489 #MM- linklibs-clib-clean : linklibs-clib-shared-clean \
490 #MM linklibs-clib-common-clean linklibs-rom-clean
492 #MM- linklibs-clib-quick : linklibs-clib-shared-quick linklibs-rom-quick
494 %build_linklib mmake=linklibs-clib-common \
495 libname=arosccommon files="$(COMMON) $(add-prefix arch/,$(COMMON_ARCH))" \
499 # Also build $(AROS_LIB)/librom.a
501 # This is a library that is allowed to be used inside modules and the
502 # kernel. It must include no code which refers to global variables.
504 # Currently the main difference is that it includes a different __assert()
505 # function to handle asserts in the kernel.
507 ROM_COMMON_OBJS := $(addsuffix .o, \
508 $(addprefix $(OBJDIR)/,$(ROM_COMMON)) \
509 $(addprefix $(OBJDIR)/arch/,$(ROM_COMMON_ARCH)) \
511 %build_linklib mmake=linklibs-rom \
512 libname=rom files="$(ROM_ONLY) $(ROM_STATIC)" objs=$(ROM_COMMON_OBJS) \
513 cflags="$(CFLAGS) -DAROSC_STATIC -DAROSC_ROM"
514 objdir=$(OBJDIR)/static
518 AROSC_LINKLIB_OBJS := $(addsuffix .o, \
519 $(addprefix $(OBJDIR)/,$(COMMON)) \
520 $(addprefix $(OBJDIR)/arch/,$(COMMON_ARCH)) \
522 USER_LDFLAGS := -L$(OBJDIR)
523 %build_module mmake=linklibs-clib-shared \
524 modname=arosc modtype=library objdir=$(OBJDIR)/shared \
525 cflags="$(CFLAGS) -DAROSC_SHARED" \
526 files="$(SHARED) $(SHARED_ARCH)" \
527 linklibfiles=$(SHARED_LINKLIB) linklibobjs=$(AROSC_LINKLIB_OBJS) \
528 uselibs="arosccommon"
531 # x86_64 needs a reduced 32bit librom.a lib.
532 %rule_compile_multi basenames=$(ROM_COMMON) \
533 cflags="-m32 -DAROSC_LIB32 $(CFLAGS)" targetdir=$(OBJDIR)/32bit
535 ROM_COMMON_OBJ32 := $(addsuffix .o, $(addprefix $(OBJDIR)/32bit/,$(ROM_COMMON)))
536 %build_linklib mmake=linklibs-clib32 \
537 libname=rom files="$(ROM_ONLY) $(ROM_STATIC)" objs=$(ROM_COMMON_OBJ32) \
538 cflags="-m32 $(CFLAGS) -DAROSC_LIB32 -DAROSC_STATIC -DAROSC_ROM" \
539 objdir=$(OBJDIR)/static libdir=$(GENDIR)/lib32
543 check : $(TESTDIR)/snprintf
545 $(TESTDIR)/snprintf : snprintf.c $(LIBDIR)/startup.o $(DEPLIBS)
546 $(CC) -DTEST $(ILDFLAGS) $< -o $@ $(LIBS)
550 -$(RM) $(OBJDIR) *.err $(LIB)