3 # Copyright (C) 2001,2002 NEC Corporation
4 # Copyright (C) 2001,2002 Miles Bader <miles@gnu.org>
6 # This program is free software; you can redistribute it and/or modify it under
7 # the terms of the GNU Library General Public License as published by the Free
8 # Software Foundation; either version 2 of the License, or (at your option) any
11 # This program is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
16 # You should have received a copy of the GNU Library General Public License
17 # along with this program; if not, write to the Free Software Foundation, Inc.,
18 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 include $(TOPDIR)Rules.mak
24 ASFLAGS+=-I.. -D__ASSEMBLER -DASM_GLOBAL_DIRECTIVE=.globl
26 TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine)
29 CRT0_OBJ = crt0.o crt1.o
30 CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
32 SSRC = setjmp.S __longjmp.S vfork.S
33 SOBJS = $(patsubst %.S,%.o, $(SSRC))
35 CSRC = mmap.c syscall.c clone.c
36 COBJS = $(patsubst %.c,%.o, $(CSRC))
38 OBJS = $(SOBJS) $(COBJS)
40 OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
44 $(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
45 echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
46 $(INSTALL) -d $(TOPDIR)lib/
47 cp $(CRT0_OBJ) $(TOPDIR)lib/
49 $(CRT0_OBJ): $(CRT0_SRC)
50 $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o
51 $(STRIPTOOL) -x -R .note -R .comment $*.o
54 $(CC) $(ASFLAGS) -c $< -o $@
55 $(STRIPTOOL) -x -R .note -R .comment $*.o
58 $(CC) $(CFLAGS) -c $< -o $@
59 $(STRIPTOOL) -x -R .note -R .comment $*.o
61 ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
63 $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o
65 $(TOPDIR)lib/crti.o: crti.o
66 $(INSTALL) -d $(TOPDIR)lib/
67 cp crti.o $(TOPDIR)lib/
70 $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o
72 $(TOPDIR)lib/crtn.o: crtn.o
73 $(INSTALL) -d $(TOPDIR)lib/
74 cp crtn.o $(TOPDIR)lib/
77 $(INSTALL) -d $(TOPDIR)lib/
78 $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o
80 $(INSTALL) -d $(TOPDIR)lib/
81 $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o