3 # Copyright (C) 2000-2005 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
25 CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
27 SSRC := __longjmp.S vfork.S setjmp.S syscall.S bsd-setjmp.S bsd-_setjmp.S clone.S
28 SOBJ := $(patsubst %.S,%.o, $(SSRC))
30 CSRC := brk.c sigaction.c __syscall_error.c mmap.c
31 COBJ := $(patsubst %.c,%.o, $(CSRC))
33 OBJS := $(SOBJ) $(COBJ)
35 OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH)
37 all: $(OBJ_LIST) $(CTOR_TARGETS)
39 $(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ)
40 $(STRIPTOOL) -x -R .note -R .comment $^
41 $(INSTALL) -d $(TOPDIR)lib/
42 cp $(CRT_OBJ) $(SCRT_OBJ) $(TOPDIR)lib/
43 echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@
45 $(CRT_OBJ): $(CRT_SRC)
46 $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o
48 $(SCRT_OBJ): $(CRT_SRC)
49 $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o
52 $(CC) $(ASFLAGS) -c $< -o $@
55 $(CC) $(CFLAGS) -c $< -o $@
57 ifeq ($(UCLIBC_CTOR_DTOR),y)
58 $(TOPDIR)lib/crti.o: crti.S
59 $(INSTALL) -d $(TOPDIR)lib/
60 $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
62 $(TOPDIR)lib/crtn.o: crtn.S
63 $(INSTALL) -d $(TOPDIR)lib/
64 $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
67 $(INSTALL) -d $(TOPDIR)lib/
72 $(LN) -fs ../libc/sysdeps/linux/x86_64/fpu_control.h $(TOPDIR)/include/