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.
21 __filesystem_support \
87 # - Shared are in either the shared linklib, or the arosc module
278 sharecontextwithchild \
349 # Note: These files are compiled differently
350 # depending on whether -DAROSC_ROM is used
411 # Objects for libarosc.static.a, from the static build.
413 __filesystem_support \
442 #MM- core-linklibs : linklibs-arosc linklibs-rom
443 #MM- linklibs : linklibs-clib-shared-linklib linklibs-rom
444 #MM- linklibs-clib : linklibs-clib-shared linklibs-rom
445 #MM- linklibs-clib-shared : includes linklibs-mlib \
446 #MM linklibs-clib-common linklibs-autoinit
447 #MM- linklibs-clib-shared-linklib : includes linklibs-clib-common
448 #MM- linklibs-rom : includes linklibs-clib-common
449 #MM- linklibs-clib-quick : linklibs-clib-shared-quick \
450 #MM linklibs-clib-common-quick linklibs-rom-quick
451 #MM- linklibs-clib-clean : linklibs-clib-shared-clean \
452 #MM linklibs-clib-common-clean linklibs-rom-clean
454 #MM- linklibs-clib-quick : linklibs-clib-shared-quick linklibs-rom-quick
456 %build_linklib mmake=linklibs-clib-common \
457 libname=arosccommon files="$(COMMON) $(add-prefix arch/,$(COMMON_ARCH))" \
461 # Also build $(AROS_LIB)/libarosc.static.a
463 # This is a library that is allowed to be used inside modules and the
464 # kernel. It must include no code which refers to global variables.
466 # Currently the main difference is that it includes a different __assert()
467 # function to handle asserts in the kernel.
469 ROM_ARCH_OBJS := $(addsuffix .o, \
470 $(addprefix $(OBJDIR)/arch/,$(ROM_COMMON_ARCH)) \
472 %build_linklib mmake=linklibs-rom \
473 libname=arosc.static files="$(ROM_ONLY) $(ROM_COMMON) $(ROM_STATIC)" objs="$(ROM_ARCH_OBJS)" \
474 cflags="$(CFLAGS) -DAROSC_STATIC -DAROSC_ROM" \
475 objdir=$(OBJDIR)/static
479 AROSC_LINKLIB_OBJS := $(addsuffix .o, \
480 $(addprefix $(OBJDIR)/,$(COMMON)) \
481 $(addprefix $(OBJDIR)/arch/,$(COMMON_ARCH)) \
483 USER_LDFLAGS := -L$(OBJDIR)
484 %build_module mmake=linklibs-clib-shared \
485 modname=arosc modtype=library objdir=$(OBJDIR)/shared \
486 cflags="$(CFLAGS) -DAROSC_SHARED" \
487 files="$(SHARED) $(SHARED_ARCH)" \
488 linklibfiles=$(SHARED_LINKLIB) linklibobjs=$(AROSC_LINKLIB_OBJS) \
489 uselibs="arosccommon"
492 # x86_64 needs a reduced 32bit libarosc.a lib.
493 %rule_compile_multi basenames=$(ROM_COMMON) \
494 cflags="-m32 -DAROSC_LIB32 $(CFLAGS)" targetdir=$(OBJDIR)/32bit
496 ROM_COMMON_OBJ32 := $(addsuffix .o, $(addprefix $(OBJDIR)/32bit/,$(ROM_COMMON)))
497 %build_linklib mmake=linklibs-clib32 \
498 libname=arosc.static files="$(ROM_ONLY) $(ROM_STATIC)" objs=$(ROM_COMMON_OBJ32) \
499 cflags="-m32 $(CFLAGS) -DAROSC_LIB32 -DAROSC_STATIC -DAROSC_ROM" \
500 objdir=$(GENDIR)/$(CURDIR)/32bit libdir=$(GENDIR)/lib32
504 check : $(TESTDIR)/snprintf
506 $(TESTDIR)/snprintf : snprintf.c $(LIBDIR)/startup.o $(DEPLIBS)
507 $(CC) -DTEST $(ILDFLAGS) $< -o $@ $(LIBS)
511 -$(RM) $(OBJDIR) *.err $(LIB)