From 96f873b9215ea1a75e2b17c055fe5c6ad32e10d6 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 20 Feb 1995 10:23:07 +0000 Subject: * Makeconfig [elf=yes] (+preinit, +postinit): New variables, set to crt[in].o. (csu-objpfx): New variable. (+link): Use it to find start.o and $(+preinit), $(+postinit). * Rules (subdir_lib, all): Depend on objs. --- Makeconfig | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Makeconfig') diff --git a/Makeconfig b/Makeconfig index 434f8b2d19..48a4a95ef8 100644 --- a/Makeconfig +++ b/Makeconfig @@ -254,11 +254,22 @@ endif # Command for linking programs with the C library. ifndef +link +link = $(CC) -nostdlib $(LDFLAGS) -o $@ \ - $(common-objpfx)start.o $(^:lib=$(libc.a)) $(gnulib) $(libc.a) + $(addprefix $(csu-objpfx),start.o $(+preinit)) \ + $(^:lib=$(libc.a)) $(gnulib) $(libc.a) \ + $(addprefix $(csu-objpfx),$(+postinit)) endif ifndef gnulib gnulib := -lgcc endif +ifeq ($(elf),yes) ++preinit = crti.o ++postinit = crtn.o +endif +ifdef objpfx +csu-objpfx = $(objpfx) +else +csu-objpfx = $(..)csu +endif ifndef LD LD := ld -X -- cgit v1.2.3