summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/v850/Makefile
blob: 924b13b7ca908f066b040cda70d8566fd03a0c54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#
# libc/sysdeps/linux/v850/Makefile -- Makefile for v850 machine-dependent dir
#
#  Copyright (C) 2001  NEC Corporation
#  Copyright (C) 2001  Miles Bader <miles@gnu.org>
#  Copyright (C) 2000  Lineo, inc.
#
# This file is subject to the terms and conditions of the GNU Library
# General Public License.  See the file COPYING.LIB in the main
# directory of this archive for more details.
#

TOPDIR=../../../../
include $(TOPDIR)Rules.mak
ASFLAGS=$(CFLAGS)

CFLAGS+= -I../ -D__ASSEMBLER__ -DASM_GLOBAL_DIRECTIVE=.globl

TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine)

CRT0=crt0.S
CRT0_OBJ=$(patsubst %.S,%.o, $(CRT0))

SSRC=setjmp.S longjmp.S vfork.S
SOBJS=$(patsubst %.S,%.o, $(SSRC))

CSRC=_mmap.c
COBJS=$(patsubst %.c,%.o, $(CSRC))

OBJS=$(SOBJS) $(MOBJ) $(COBJS)


all: $(OBJS) $(LIBC)

$(LIBC): ar-target 

ar-target: $(OBJS) $(CRT0_OBJ)
	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
	cp $(CRT0_OBJ) $(TOPDIR)libc/$(CRT0_OBJ)

$(CRT0_OBJ): %.o : %.S
	$(CC) $(CFLAGS) -c $< -o $@
	$(STRIPTOOL) -x -R .note -R .comment $*.o

$(SOBJS): %.o : %.S
	$(CC) $(CFLAGS) -c $< -o $@
	$(STRIPTOOL) -x -R .note -R .comment $*.o

$(COBJS): %.o : %.c
	$(CC) $(CFLAGS) -c $< -o $@
	$(STRIPTOOL) -x -R .note -R .comment $*.o

headers:
	@(TOPDIR=$(TOPDIR) CC=$(CC) /bin/sh $(TOPDIR)/extra/scripts/gen_bits_syscall_h.sh > bits/syscall.h ) 

clean:
	rm -f *.[oa] *~ core