summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/i386/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/i386/Makefile')
-rw-r--r--libc/sysdeps/linux/i386/Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/i386/Makefile b/libc/sysdeps/linux/i386/Makefile
index 9c487bfd1..a6b185c21 100644
--- a/libc/sysdeps/linux/i386/Makefile
+++ b/libc/sysdeps/linux/i386/Makefile
@@ -25,7 +25,10 @@ include $(TOPDIR)Rules.mak
LIBC=$(TOPDIR)libc.a
ASFLAGS=$(CFLAGS)
-SSRC=_start.S longjmp.S setjmp.S #_start.S #clone.S
+CRT0=crt0.S
+CRT0_OBJ=$(patsubst %.S,%.o, $(CRT0))
+
+SSRC=longjmp.S setjmp.S #_start.S #clone.S
ifeq ($(UNIFIED_SYSCALL),true)
SSRC += __uClibc_syscall.S
endif
@@ -37,13 +40,18 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
OBJS=$(SOBJS) $(COBJS)
-all: $(OBJS) $(LIBC)
+all: $(OBJS) $(CRT0_OBJ) $(LIBC)
$(LIBC): ar-target
ar-target: $(OBJS)
$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(CRT0_OBJ): %.o : %.S
+ $(CC) $(CFLAGS) -c $< -o $@
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
+ cp $*.o $(TOPDIR)/libcrt0.o
+
$(SOBJS): %.o : %.S
$(CC) $(CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o