1PKGDIR ?= ../.. 2L4DIR ?= $(PKGDIR)/../../.. 3 4# CRT0 lib for statically linked binaries 5SRC_C_libcrt0.a := construction.c support.c 6SRC_S_libcrt0.a := crt0_x.S 7 8# CRT0 lib for dynamically linked binaries 9SRC_C_libcrt0_s.a := construction.c 10SRC_S_libcrt0_s.a := crt0_x.S 11 12# Stand alone lib for initializing the EH frames in statically 13# linked binaries (usually this in n_crt0.S 14SRC_CC_libcrt0_eh.o.a := init_eh_frame.cc 15 16TARGET = libcrt0.a libcrt0_s.a libcrt0_eh.o.a 17MYOBJS = crt0.o 18SYSTEMS = $(SYSTEMS_PLAIN) 19 20# find the arch dependent things 21vpath %.S $(PKGDIR)/lib/src/ARCH-$(ARCH) 22 23INSTALL_TARGET = $(TARGET) $(MYOBJS) 24KEEP_ON_CLEAN = $(MYOBJS) 25 26include $(L4DIR)/mk/lib.mk 27 28crt0.o: crt0_x.o init_eh_frame.o 29 @$(LINK_MESSAGE) 30 $(VERBOSE)$(LD) $(filter-out -gc-sections,$(LDFLAGS)) -r $(filter %.o,$^) -o $@ 31 32crt0.s.o: support.s.o .general.d 33 @$(LINK_MESSAGE) 34 $(VERBOSE)$(LD) $(LDFLAGS) -r $(filter %.o,$^) -o $@ 35