OSDN Git Service

bfb127af4e2465dba7cb0f7cb921b3ee77627a95
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / frv / Makefile
1 # Makefile for uClibc
2 #
3 # Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org>
4 # ported to FR-V by Alexandre Oliva <aoliva@redhat.com>
5 #
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
9 # later version.
10 #
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
14 # details.
15 #
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
19
20 TOPDIR=../../../../
21 include $(TOPDIR)Rules.mak
22
23 CRT0_SRC = crt0.S
24 CRT0_OBJ = crt0.o crt1.o
25 SCRT0_OBJ = $(patsubst %,S%, $(CRT0_OBJ))
26 CRT0_DEPS=gmon-start.S
27
28 CTOR_TARGETS = crti.o crtn.o
29
30 SSRC=__longjmp.S setjmp.S clone.S vfork.S
31 SOBJS=$(patsubst %.S,%.o, $(SSRC))
32
33 CSRC=mmap.c sysdep.c syscall.c brk.c sbrk.c __init_brk.c dl-iterate-phdr.c
34 CSRC+=xstatconv.c stat.c stat64.c fstat.c fstat64.c lstat.c lstat64.c
35 COBJS=$(patsubst %.c,%.o, $(CSRC))
36
37 OBJS=$(SOBJS) $(COBJS)
38
39 OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
40
41 all: $(OBJ_LIST)
42
43 $(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS)
44         echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
45         $(INSTALL) -d $(TOPDIR)lib/
46         cp $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS) $(TOPDIR)lib/
47
48 $(CRT0_OBJ): $(CRT0_SRC) crtreloc.o
49         $(CC) $(ASFLAGS) -DL_$* -r -nostdlib $< crtreloc.o -o $*.o
50         $(STRIPTOOL) -x -R .note -R .comment $*.o
51
52 crtreloc.o: crtreloc.c
53         $(CC) $(CFLAGS) -c $< -o $@
54
55 $(SCRT0_OBJ): $(CRT0_SRC) Scrtreloc.o
56         $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* -r -nostdlib $< Scrtreloc.o -o $*.o
57         $(STRIPTOOL) -x -R .note -R .comment $*.o
58
59 Scrtreloc.o: crtreloc.c
60         $(CC) $(CFLAGS) $(PIEFLAG) -c $< -o $@
61
62 $(CTOR_TARGETS): %.o : %.S
63         $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
64         $(STRIPTOOL) -x -R .note -R .comment $*.o
65
66 $(SOBJS): %.o : %.S
67         $(CC) $(ASFLAGS) -c $< -o $@
68         $(STRIPTOOL) -x -R .note -R .comment $*.o
69
70 $(COBJS): %.o : %.c
71         $(CC) $(CFLAGS) -c $< -o $@
72         $(STRIPTOOL) -x -R .note -R .comment $*.o
73
74 headers:
75         $(LN) -fs ../libc/sysdeps/linux/frv/link.h $(TOPDIR)/include/
76
77 clean:
78         $(RM) *.o *~ core
79         $(RM) $(TOPDIR)/include/link.h