summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/Makefile')
-rw-r--r--libc/sysdeps/linux/common/Makefile18
1 files changed, 16 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/common/Makefile b/libc/sysdeps/linux/common/Makefile
index 8b23a5fad..009d0740d 100644
--- a/libc/sysdeps/linux/common/Makefile
+++ b/libc/sysdeps/linux/common/Makefile
@@ -42,7 +42,7 @@ all: $(STR_SYSCALLS) $(OBJ) $(LIBC)
$(LIBC): ar-target
-ar-target: $(OBJ)
+ar-target: $(OBJ) crti.o crtn.o
$(AR) $(ARFLAGS) $(LIBC) $(OBJ)
$(MOBJ): $(MSRC)
@@ -53,6 +53,20 @@ $(COBJS): %.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
+initfini.s: initfini.c
+ $(CC) $(CFLAGS) -c initfini.c -S -o initfini.s
+
+crti.S crtn.S: initfini.s
+ $(TOPDIR)/extra/scripts/initfini.pl
+
+crti.o: crti.S
+ $(CC) $(CFLAGS) -c crti.S -o crti.o
+ cp crti.o $(TOPDIR)lib/
+
+crtn.o: crtn.S
+ $(CC) $(CFLAGS) -c crtn.S -o crtn.o
+ cp crtn.o $(TOPDIR)lib/
+
clean:
- rm -f *.[oa] *~ core
+ rm -f *.[oa] *~ core crti.* crtn.* initfini.s