source: trunk/libs/newlib/src/libgloss/epiphany/Makefile.in @ 610

Last change on this file since 610 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 5.8 KB
Line 
1# Makefile for libgloss/epiphany
2
3# Copyright (c) 2011, 2012 Adapteva, Inc.
4# All rights reserved.
5
6# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com> for Adapteva Inc
7
8# Redistribution and use in source and binary forms, with or without
9# modification, are permitted provided that the following conditions are met:
10#  * Redistributions of source code must retain the above copyright notice,
11#    this list of conditions and the following disclaimer.
12#  * Redistributions in binary form must reproduce the above copyright
13#    notice, this list of conditions and the following disclaimer in the
14#    documentation and/or other materials provided with the distribution.
15#  * Neither the name of Adapteva nor the names of its contributors may be
16#    used to endorse or promote products derived from this software without
17#    specific prior written permission.
18
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29# POSSIBILITY OF SUCH DAMAGE.
30
31# Standard proforma copied from libnosys
32DESTDIR =
33VPATH = @srcdir@
34srcdir = @srcdir@
35objdir = .
36srcroot = $(srcdir)/../..
37objroot = $(objdir)/../..
38
39prefix = @prefix@
40exec_prefix = @exec_prefix@
41
42host_alias = @host_alias@
43target_alias = @target_alias@
44program_transform_name = @program_transform_name@
45
46bindir = @bindir@
47libdir = @libdir@
48tooldir = $(exec_prefix)/$(target_alias)
49
50# Multilib support variables.
51# TOP is used instead of MULTI{BUILD,SRC}TOP.
52MULTIDIRS =
53MULTISUBDIR =
54MULTIDO = true
55MULTICLEAN = true
56
57INSTALL = @INSTALL@
58INSTALL_PROGRAM = @INSTALL_PROGRAM@
59INSTALL_DATA = @INSTALL_DATA@
60
61SHELL = /bin/sh
62
63CC = @CC@
64
65#AS = @AS@
66AS = `if [ -f ${objroot}/../gas/as-new ] ; \
67        then echo ${objroot}/../gas/as-new ; \
68        else echo as ; fi`
69
70AR = @AR@
71
72#LD = @LD@
73LD = `if [ -f ${objroot}/../ld/ld-new ] ; \
74        then echo ${objroot}/../ld/ld-new ; \
75        else echo ld ; fi`
76
77RANLIB = @RANLIB@
78
79OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
80        then echo ${objroot}/../binutils/objdump ; \
81        else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
82OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \
83        then echo ${objroot}/../binutils/objcopy ; \
84        else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
85
86GCC_LDFLAGS = `if [ -d ${objroot}/../gcc ] ; \
87        then echo -L${objroot}/../gcc ; fi`
88
89NEWLIB_CFLAGS = `if [ -d ${objroot}/newlib ]; then echo -I${objroot}/newlib/targ-include -I${srcroot}/newlib/libc/include; fi`
90NEWLIB_LDFLAGS = `if [ -d ${objroot}/newlib ]; then echo -B${objroot}/newlib/ -L${objroot}/newlib/; fi`
91
92INCLUDES = -I. -I$(srcdir)/.. -I$(srcdir)/../../newlib/libc/machine/epiphany
93
94# Note that when building the library, ${MULTILIB} is not the way multilib
95# options are passed; they're passed in $(CFLAGS).
96CFLAGS_FOR_TARGET = ${MULTILIB} ${INCLUDES} ${NEWLIB_CFLAGS}
97LDFLAGS_FOR_TARGET = ${MULTILIB} ${NEWLIB_LDFLAGS}
98AR_FLAGS = qc
99
100.c.o:
101        $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $<
102
103.C.o:
104        $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $<
105.S.o:
106        $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -c $(CFLAGS) $<
107.s.o:
108        $(AS) $(ASFLAGS_FOR_TARGET) $(INCLUDES) $(ASFLAGS) -o $*.o $<
109
110#
111# GCC knows to run the preprocessor on .S files before it assembles them.
112#
113.S.o:
114        $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -c $<
115
116#
117# this is a bogus target that'll produce an assembler from the
118# C source with the right compiler options. this is so we can
119# track down code generation or debug symbol bugs.
120#
121.c.s:
122        $(CC) $(CFLAGS_FOR_TARGET) -S $(INCLUDES) $(CFLAGS) $<
123
124# EPIPHANY specific stuff
125
126# Object files needed for all libraries
127COMMON_OBJS = access.o  \
128              close.o    \
129              environ.o  \
130              execve.o   \
131              fork.o     \
132              fstat.o    \
133              getpid.o   \
134              gettimeofday.o \
135              _isatty.o  \
136              kill.o     \
137              link.o     \
138              lseek.o    \
139              open.o     \
140              read.o     \
141              sbrk.o     \
142              stat.o     \
143              times.o    \
144              unlink.o   \
145              wait.o     \
146              write.o    \
147              _exit.o    \
148              epiphany-syscalls.o \
149              epiphany-ivthandlers.o
150
151UNUSED_OBJS = chown.o    \
152              errno.o    \
153              gettod.o   \
154              readlink.o \
155              symlink.o
156
157# Object files specific to particular targets.
158SIMOBJS = $(COMMON_OBJS)
159
160OUTPUTS = libepiphany.a crt0.o
161
162all: $(OUTPUTS)
163
164#
165# here's where we build the library for each target
166#
167
168libepiphany.a: $(SIMOBJS)
169        ${AR} ${ARFLAGS} $@ $(SIMOBJS)
170        ${RANLIB} $@
171
172_exit.o: _exit.S
173        $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -c $<
174
175doc:
176
177clean mostlyclean:
178        rm -f $(OUTPUTS) *.i *~ *.o *-test *.srec *.dis *.map *.x
179
180distclean maintainer-clean realclean: clean
181        rm -f Makefile config.status $(OUTPUTS)
182
183.PHONY: install info install-info clean-info
184install:
185        @for outputs in ${OUTPUTS}; do\
186         mkdir -p $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \
187         $(INSTALL_PROGRAM) $${outputs} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \
188        done
189info:
190install-info:
191clean-info:
192
193Makefile: Makefile.in config.status @host_makefile_frag_path@
194        $(SHELL) config.status
195
196config.status: configure
197        $(SHELL) config.status --recheck
Note: See TracBrowser for help on using the repository browser.