3 # Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org>
5 # This program is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU Library General Public License as published by the Free
7 # Software Foundation; either version 2 of the License, or (at your option) any
10 # This program is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
15 # You should have received a copy of the GNU Library General Public License
16 # along with this program; if not, write to the Free Software Foundation, Inc.,
17 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 include $(TOPDIR)Rules.mak
23 CRT0_OBJ = crt0.o crt1.o
24 SCRT0_OBJ = $(patsubst %,S%, $(CRT0_OBJ))
25 CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
27 SSRC=__longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \
28 bsd-_setjmp.S sigrestorer.S mmap64.S
29 SOBJS=$(patsubst %.S,%.o, $(SSRC))
31 CSRC=brk.c syscall.c ioperm.c sigaction.c
32 COBJS=$(patsubst %.c,%.o, $(CSRC))
34 OBJS=$(SOBJS) $(MOBJ) $(COBJS)
36 OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
40 $(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS)
41 echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
42 $(INSTALL) -d $(TOPDIR)lib/
43 cp $(CRT0_OBJ) $(SCRT0_OBJ) $(TOPDIR)lib/
44 ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
45 $(RM) $(TOPDIR)lib/Scrt0.o
47 mv $(TOPDIR)lib/Scrt0.o $(TOPDIR)lib/Scrt1.o
50 $(CRT0_OBJ): $(CRT0_SRC)
51 $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o
52 $(STRIPTOOL) -x -R .note -R .comment $*.o
54 $(SCRT0_OBJ): $(CRT0_SRC)
55 $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o
56 $(STRIPTOOL) -x -R .note -R .comment $*.o
59 $(CC) $(ASFLAGS) -c $< -o $@
60 $(STRIPTOOL) -x -R .note -R .comment $*.o
63 $(CC) $(CFLAGS) -c $< -o $@
64 $(STRIPTOOL) -x -R .note -R .comment $*.o
66 ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
68 $(CC) $(ASFLAGS) -c crti.S -o crti.o
70 $(TOPDIR)lib/crti.o: crti.o
71 $(INSTALL) -d $(TOPDIR)lib/
72 cp crti.o $(TOPDIR)lib/
75 $(CC) $(ASFLAGS) -c crtn.S -o crtn.o
77 $(TOPDIR)lib/crtn.o: crtn.o
78 $(INSTALL) -d $(TOPDIR)lib/
79 cp crtn.o $(TOPDIR)lib/
82 $(INSTALL) -d $(TOPDIR)lib/
83 $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o
85 $(INSTALL) -d $(TOPDIR)lib/
86 $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
90 $(LN) -fs ../libc/sysdeps/linux/arm/fpu_control.h $(TOPDIR)/include/