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 \
92 # - Shared are in either the shared linklib, or the arosc.library module
97 __arosc_set_environptr \
229 locale/fix_grouping \
248 locale/setrunelocale \
316 sharecontextwithchild \
386 # Note: These files are compiled differently
387 # depending on whether -DAROSC_ROM is used
451 # Objects for rom.lib, from the static build.
453 __filesystem_support \
482 #MM- core-linklibs : linklibs-arosc linklibs-rom
483 #MM- linklibs : linklibs-clib-shared-linklib linklibs-rom
484 #MM- linklibs-clib : linklibs-clib-shared linklibs-rom
485 #MM- linklibs-clib-shared : includes linklibs-mlib \
486 #MM linklibs-clib-common linklibs-autoinit
487 #MM- linklibs-clib-shared-linklib : includes linklibs-clib-common
488 #MM- linklibs-rom : includes linklibs-clib-common
489 #MM- linklibs-clib-quick : linklibs-clib-shared-quick \
490 #MM linklibs-clib-common-quick linklibs-rom-quick
491 #MM- linklibs-clib-clean : linklibs-clib-shared-clean \
492 #MM linklibs-clib-common-clean linklibs-rom-clean
494 #MM- linklibs-clib-quick : linklibs-clib-shared-quick linklibs-rom-quick
496 %build_linklib mmake=linklibs-clib-common \
497 libname=arosccommon files="$(COMMON) $(add-prefix arch/,$(COMMON_ARCH))" \
501 # Also build $(AROS_LIB)/librom.a
503 # This is a library that is allowed to be used inside modules and the
504 # kernel. It must include no code which refers to global variables.
506 # Currently the main difference is that it includes a different __assert()
507 # function to handle asserts in the kernel.
509 ROM_COMMON_OBJS := $(addsuffix .o, \
510 $(addprefix $(OBJDIR)/,$(ROM_COMMON)) \
511 $(addprefix $(OBJDIR)/arch/,$(ROM_COMMON_ARCH)) \
513 %build_linklib mmake=linklibs-rom \
514 libname=rom files="$(ROM_ONLY) $(ROM_STATIC)" objs=$(ROM_COMMON_OBJS) \
515 cflags="$(CFLAGS) -DAROSC_STATIC -DAROSC_ROM"
516 objdir=$(OBJDIR)/static
520 AROSC_LINKLIB_OBJS := $(addsuffix .o, \
521 $(addprefix $(OBJDIR)/,$(COMMON)) \
522 $(addprefix $(OBJDIR)/arch/,$(COMMON_ARCH)) \
524 USER_LDFLAGS := -L$(OBJDIR)
525 %build_module mmake=linklibs-clib-shared \
526 modname=arosc modtype=library objdir=$(OBJDIR)/shared \
527 cflags="$(CFLAGS) -DAROSC_SHARED" \
528 files="$(SHARED) $(SHARED_ARCH)" \
529 linklibfiles=$(SHARED_LINKLIB) linklibobjs=$(AROSC_LINKLIB_OBJS) \
530 uselibs="arosccommon"
533 # x86_64 needs a reduced 32bit librom.a lib.
534 %rule_compile_multi basenames=$(ROM_COMMON) \
535 cflags="-m32 -DAROSC_LIB32 $(CFLAGS)" targetdir=$(OBJDIR)/32bit
537 ROM_COMMON_OBJ32 := $(addsuffix .o, $(addprefix $(OBJDIR)/32bit/,$(ROM_COMMON)))
538 %build_linklib mmake=linklibs-clib32 \
539 libname=rom files="$(ROM_ONLY) $(ROM_STATIC)" objs=$(ROM_COMMON_OBJ32) \
540 cflags="-m32 $(CFLAGS) -DAROSC_LIB32 -DAROSC_STATIC -DAROSC_ROM" \
541 objdir=$(OBJDIR)/static libdir=$(GENDIR)/lib32
545 check : $(TESTDIR)/snprintf
547 $(TESTDIR)/snprintf : snprintf.c $(LIBDIR)/startup.o $(DEPLIBS)
548 $(CC) -DTEST $(ILDFLAGS) $< -o $@ $(LIBS)
552 -$(RM) $(OBJDIR) *.err $(LIB)