OSDN Git Service

9bad495a97d801fcdacd547df30d760c001fb2aa
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / x86_64 / Makefile
1 # Makefile for uClibc
2 #
3 # Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
4 #
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
8 # later version.
9 #
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
13 # details.
14 #
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
18
19 TOPDIR=../../../../
20 include $(TOPDIR)Rules.mak
21
22 CRT_SRC := crt1.S
23 CRT_OBJ := crt1.o
24 SCRT_OBJ := Scrt1.o
25 CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
26
27 SSRC := __longjmp.S vfork.S setjmp.S syscall.S bsd-setjmp.S bsd-_setjmp.S clone.S
28 SOBJ := $(patsubst %.S,%.o, $(SSRC))
29
30 CSRC := brk.c sigaction.c __syscall_error.c mmap.c
31 COBJ := $(patsubst %.c,%.o, $(CSRC))
32
33 OBJS := $(SOBJ) $(COBJ)
34
35 OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH)
36
37 all: $(OBJ_LIST) $(CTOR_TARGETS)
38
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)) > $@
44
45 $(CRT_OBJ): $(CRT_SRC)
46         $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o
47
48 $(SCRT_OBJ): $(CRT_SRC)
49         $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o
50
51 $(SOBJ): %.o : %.S
52         $(CC) $(ASFLAGS) -c $< -o $@
53
54 $(COBJ): %.o : %.c
55         $(CC) $(CFLAGS) -c $< -o $@
56
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 $@
61
62 $(TOPDIR)lib/crtn.o: crtn.S
63         $(INSTALL) -d $(TOPDIR)lib/
64         $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@
65 else
66 $(CTOR_TARGETS):
67         $(INSTALL) -d $(TOPDIR)lib/
68         $(AR) $(ARFLAGS) $@
69 endif
70
71 headers:
72         $(LN) -fs ../libc/sysdeps/linux/x86_64/fpu_control.h $(TOPDIR)/include/
73
74 clean:
75         $(RM) *.o *~ core