OSDN Git Service

2007-06-13 Patrick Mansfield <patmans@us.ibm.com>
[pf3gnuchains/pf3gnuchains4x.git] / libgloss / spu / Makefile.in
1 # Copyright (c) 1998 Cygnus Support
2 #
3 # The authors hereby grant permission to use, copy, modify, distribute,
4 # and license this software and its documentation for any purpose, provided
5 # that existing copyright notices are retained in all copies and that this
6 # notice is included verbatim in any distributions. No written agreement,
7 # license, or royalty fee is required for any of the authorized uses.
8 # Modifications to this software may be copyrighted by their authors
9 # and need not follow the licensing terms described here, provided that
10 # the new terms are clearly indicated on the first page of each file where
11 # they apply.
12
13 VPATH = @srcdir@
14 srcdir = @srcdir@
15 objdir = .
16 srcroot = $(srcdir)/../..
17 objroot = $(objdir)/../..
18
19 prefix = @prefix@
20 exec_prefix = @exec_prefix@
21
22 host_alias = @host_alias@
23 target_alias = @target_alias@
24 program_transform_name = @program_transform_name@
25
26 bindir = @bindir@
27 libdir = @libdir@
28 tooldir = $(exec_prefix)/$(target_alias)
29
30 # Multilib support variables.
31 # TOP is used instead of MULTI{BUILD,SRC}TOP.
32 MULTIDIRS =
33 MULTISUBDIR =
34 MULTIDO = true
35 MULTICLEAN = true
36
37 INSTALL = @INSTALL@
38 INSTALL_PROGRAM = @INSTALL_PROGRAM@
39 INSTALL_DATA = @INSTALL_DATA@
40
41 SHELL = /bin/sh
42
43 CC = @CC@
44
45 AS = @AS@
46
47 AR = @AR@
48
49 LD = @LD@
50
51 RANLIB = @RANLIB@
52
53 OBJDUMP = `t='$(program_transform_name)'; echo objdump | sed -e $$t`
54 OBJCOPY = `t='$(program_transform_name)'; echo objcopy | sed -e $$t`
55
56 # object files needed
57 OBJS = syscalls.o exit.o sbrk.o close.o fstat.o getpid.o isatty.o \
58         kill.o lseek.o nanosleep.o open.o read.o unlink.o write.o stat.o \
59         ftruncate.o dup.o access.o gettimeofday.o
60
61 # Object files specific to particular targets.
62 EVALOBJS = ${OBJS}
63
64 GCC_LDFLAGS = `if [ -d ${objroot}/../gcc ] ; \
65         then echo -L${objroot}/../gcc ; fi`
66
67 CRTOBJS = crti.o crtn.o crt1.o crt2.o
68 OUTPUTS = libgloss.a $(CRTOBJS)
69
70 NEWLIB_CFLAGS = `if [ -d ${objroot}/newlib ]; then echo -I${objroot}/newlib/targ-include -I${srcroot}/newlib/libc/include; fi` -ffunction-sections -fdata-sections
71 NEWLIB_LDFLAGS = `if [ -d ${objroot}/newlib ]; then echo -B${objroot}/newlib/ -L${objroot}/newlib/; fi`
72
73 INCLUDES = -I. -I$(srcdir)/..
74
75 # TODO: Once libspu is installed on the system we can remove this hack
76 INCLUDES += -I${srcroot}/../libspu/include
77
78 # Note that when building the library, ${MULTILIB} is not the way multilib
79 # options are passed; they're passed in $(CFLAGS).
80 CFLAGS_FOR_TARGET = ${MULTILIB} ${INCLUDES} ${NEWLIB_CFLAGS}
81 LDFLAGS_FOR_TARGET = ${MULTILIB} ${NEWLIB_LDFLAGS}
82 AR_FLAGS = qc
83
84 .c.o:
85         $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $<
86
87 .C.o:
88         $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $<
89 .s.o:
90         $(AS) $(ASFLAGS_FOR_TARGET) $(INCLUDES) $(ASFLAGS) -o $*.o $<
91
92 #
93 # GCC knows to run the preprocessor on .S files before it assembles them.
94 #
95 .S.o:
96         $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -c $<
97
98 #
99 # this is a bogus target that'll produce an assembler from the
100 # C source with the right compiler options. this is so we can
101 # track down code generation or debug symbol bugs.
102 #
103 .c.s:
104         $(CC) $(CFLAGS_FOR_TARGET) -S $(INCLUDES) $(CFLAGS) $<
105
106 all: ${OUTPUTS}
107
108 #
109 # here's where we build the library for each target
110 #
111
112 libgloss.a: $(EVALOBJS)
113         ${AR} ${ARFLAGS} $@ $(EVALOBJS)
114         ${RANLIB} $@
115
116 # C Runtime Library startup code.
117 crti.o:
118         $(CC) $(srcdir)/crti.S -c -o crti.o 
119
120 crtn.o:
121         $(CC) $(srcdir)/crtn.S -c -o crtn.o 
122
123 crt1.o:
124         $(CC) $(srcdir)/crt0.S -c -o crt1.o
125
126 crt2.o:
127         $(CC) $(srcdir)/crt0.S -D_STD_MAIN -c -o crt2.o
128
129 doc:    
130
131 clean mostlyclean:
132         rm -f $(OUTPUTS) *.i *~ *.o *-test *.srec *.dis *.map *.x
133
134 distclean maintainer-clean realclean: clean
135         rm -f Makefile config.status $(OUTPUTS)
136
137 .PHONY: install info install-info clean-info
138 install:
139         for outputs in ${OUTPUTS}; do\
140          ${INSTALL_DATA} $${outputs} $(DESTDIR)/${tooldir}/lib${MULTISUBDIR}/$${outputs}; \
141         done
142
143 info:
144 install-info:
145 clean-info:
146
147 Makefile: Makefile.in config.status @host_makefile_frag_path@
148         $(SHELL) config.status
149
150 config.status: configure
151         $(SHELL) config.status --recheck
152
153 syscalls.o close.o fstat.o lseek.o open.o read.o stat.o unlink.o write.o: jsre.h