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 TESTDIR := $(BINDIR)/Tests
17 # - Common always exist in the link library.
20 __filesystem_support \
81 # - Shared are in either the shared linklib, or the arosc module
270 sharecontextwithchild \
340 # Note: These files are compiled differently
341 # depending on whether -DAROSC_ROM is used
396 # Objects for libarosc.static.a, from the static build.
398 __filesystem_support \
426 #MM- core-linklibs : linklibs-arosc linklibs-rom
427 #MM- linklibs : linklibs-clib-shared-linklib linklibs-rom
428 #MM- linklibs-clib : linklibs-clib-shared linklibs-rom
429 #MM- linklibs-clib-shared : includes linklibs-mlib \
430 #MM linklibs-clib-common linklibs-autoinit
431 #MM- linklibs-clib-shared-linklib : includes linklibs-clib-common
432 #MM- linklibs-rom : includes linklibs-clib-common
433 #MM- linklibs-clib-quick : linklibs-clib-shared-quick \
434 #MM linklibs-clib-common-quick linklibs-rom-quick
435 #MM- linklibs-clib-clean : linklibs-clib-shared-clean \
436 #MM linklibs-clib-common-clean linklibs-rom-clean
438 #MM- linklibs-clib-quick : linklibs-clib-shared-quick linklibs-rom-quick
440 %build_linklib mmake=linklibs-clib-common \
441 libname=arosccommon files="$(COMMON) $(add-prefix arch/,$(COMMON_ARCH))" \
445 # Also build $(AROS_LIB)/libarosc.static.a
447 # This is a library that is allowed to be used inside modules and the
448 # kernel. It must include no code which refers to global variables.
450 # Currently the main difference is that it includes a different __assert()
451 # function to handle asserts in the kernel.
453 ROM_ARCH_OBJS := $(addsuffix .o, \
454 $(addprefix $(OBJDIR)/arch/,$(ROM_COMMON_ARCH)) \
456 %build_linklib mmake=linklibs-rom \
457 libname=arosc.static files="$(ROM_ONLY) $(ROM_COMMON) $(ROM_STATIC)" objs="$(ROM_ARCH_OBJS)" \
458 cflags="$(CFLAGS) -DAROSC_STATIC -DAROSC_ROM" \
459 objdir=$(OBJDIR)/static
463 AROSC_LINKLIB_OBJS := $(addsuffix .o, \
464 $(addprefix $(OBJDIR)/,$(COMMON)) \
465 $(addprefix $(OBJDIR)/arch/,$(COMMON_ARCH)) \
467 USER_LDFLAGS := -L$(OBJDIR)
468 %build_module mmake=linklibs-clib-shared \
469 modname=arosc modtype=library objdir=$(OBJDIR)/shared \
470 cflags="$(CFLAGS) -DAROSC_SHARED" \
471 files="$(SHARED) $(SHARED_ARCH)" \
472 linklibfiles=$(SHARED_LINKLIB) linklibobjs=$(AROSC_LINKLIB_OBJS) \
473 uselibs="arosccommon"
476 # x86_64 needs a reduced 32bit libarosc.a lib.
477 %rule_compile_multi basenames=$(ROM_COMMON) \
478 cflags="-m32 -DAROSC_LIB32 $(CFLAGS)" targetdir=$(OBJDIR)/32bit
480 ROM_COMMON_OBJ32 := $(addsuffix .o, $(addprefix $(OBJDIR)/32bit/,$(ROM_COMMON)))
481 %build_linklib mmake=linklibs-clib32 \
482 libname=arosc.static files="$(ROM_ONLY) $(ROM_STATIC)" objs=$(ROM_COMMON_OBJ32) \
483 cflags="-m32 $(CFLAGS) -DAROSC_LIB32 -DAROSC_STATIC -DAROSC_ROM" \
484 objdir=$(GENDIR)/$(CURDIR)/32bit libdir=$(GENDIR)/lib32
488 check : $(TESTDIR)/snprintf
490 $(TESTDIR)/snprintf : snprintf.c $(LIBDIR)/startup.o $(DEPLIBS)
491 $(CC) -DTEST $(ILDFLAGS) $< -o $@ $(LIBS)
495 -$(RM) $(OBJDIR) *.err $(LIB)