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 \
93 # - Shared are in either the shared linklib, or the arosc.library module
98 __arosc_set_environptr \
230 locale/fix_grouping \
249 locale/setrunelocale \
317 sharecontextwithchild \
388 # Note: These files are compiled differently
389 # depending on whether -DAROSC_ROM is used
453 # Objects for rom.lib, from the static build.
455 __filesystem_support \
484 #MM- core-linklibs : linklibs-arosc linklibs-rom
485 #MM- linklibs : linklibs-clib-shared-linklib linklibs-rom
486 #MM- linklibs-clib : linklibs-clib-shared linklibs-rom
487 #MM- linklibs-clib-shared : includes linklibs-mlib \
488 #MM linklibs-clib-common linklibs-autoinit
489 #MM- linklibs-clib-shared-linklib : includes linklibs-clib-common
490 #MM- linklibs-rom : includes linklibs-clib-common
491 #MM- linklibs-clib-quick : linklibs-clib-shared-quick \
492 #MM linklibs-clib-common-quick linklibs-rom-quick
493 #MM- linklibs-clib-clean : linklibs-clib-shared-clean \
494 #MM linklibs-clib-common-clean linklibs-rom-clean
496 #MM- linklibs-clib-quick : linklibs-clib-shared-quick linklibs-rom-quick
498 %build_linklib mmake=linklibs-clib-common \
499 libname=arosccommon files="$(COMMON) $(add-prefix arch/,$(COMMON_ARCH))" \
503 # Also build $(AROS_LIB)/librom.a
505 # This is a library that is allowed to be used inside modules and the
506 # kernel. It must include no code which refers to global variables.
508 # Currently the main difference is that it includes a different __assert()
509 # function to handle asserts in the kernel.
511 ROM_COMMON_OBJS := $(addsuffix .o, \
512 $(addprefix $(OBJDIR)/,$(ROM_COMMON)) \
513 $(addprefix $(OBJDIR)/arch/,$(ROM_COMMON_ARCH)) \
515 %build_linklib mmake=linklibs-rom \
516 libname=rom files="$(ROM_ONLY) $(ROM_STATIC)" objs=$(ROM_COMMON_OBJS) \
517 cflags="$(CFLAGS) -DAROSC_STATIC -DAROSC_ROM"
518 objdir=$(OBJDIR)/static
522 AROSC_LINKLIB_OBJS := $(addsuffix .o, \
523 $(addprefix $(OBJDIR)/,$(COMMON)) \
524 $(addprefix $(OBJDIR)/arch/,$(COMMON_ARCH)) \
526 USER_LDFLAGS := -L$(OBJDIR)
527 %build_module mmake=linklibs-clib-shared \
528 modname=arosc modtype=library objdir=$(OBJDIR)/shared \
529 cflags="$(CFLAGS) -DAROSC_SHARED" \
530 files="$(SHARED) $(SHARED_ARCH)" \
531 linklibfiles=$(SHARED_LINKLIB) linklibobjs=$(AROSC_LINKLIB_OBJS) \
532 uselibs="arosccommon"
535 # x86_64 needs a reduced 32bit librom.a lib.
536 %rule_compile_multi basenames=$(ROM_COMMON) \
537 cflags="-m32 -DAROSC_LIB32 $(CFLAGS)" targetdir=$(OBJDIR)/32bit
539 ROM_COMMON_OBJ32 := $(addsuffix .o, $(addprefix $(OBJDIR)/32bit/,$(ROM_COMMON)))
540 %build_linklib mmake=linklibs-clib32 \
541 libname=rom files="$(ROM_ONLY) $(ROM_STATIC)" objs=$(ROM_COMMON_OBJ32) \
542 cflags="-m32 $(CFLAGS) -DAROSC_LIB32 -DAROSC_STATIC -DAROSC_ROM" \
543 objdir=$(OBJDIR)/static libdir=$(GENDIR)/lib32
547 check : $(TESTDIR)/snprintf
549 $(TESTDIR)/snprintf : snprintf.c $(LIBDIR)/startup.o $(DEPLIBS)
550 $(CC) -DTEST $(ILDFLAGS) $< -o $@ $(LIBS)
554 -$(RM) $(OBJDIR) *.err $(LIB)