Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Makefile.in « cris « libgloss - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0ec0678d68b2f43923b948b6ba871cddd9f1a578 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
#
# libgloss Makefile.in for CRIS.  Copied and modified from mcore long ago.
#

DESTDIR =
VPATH = @srcdir@
srcdir = @srcdir@
objdir = .
srcroot = $(srcdir)/../..
objroot = $(objdir)/../..

prefix = @prefix@
exec_prefix = @exec_prefix@

host_alias = @host_alias@
target_alias = @target_alias@

bindir = @bindir@
libdir = @libdir@
tooldir = $(exec_prefix)/$(target_alias)

INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@

# Multilib support variables.
# TOP is used instead of MULTI{BUILD,SRC}TOP.
MULTIDIRS =
MULTISUBDIR =

SHELL =	/bin/sh

CC = @CC@

AS = @AS@
AR = @AR@
LD = @LD@
RANLIB = @RANLIB@

OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
	then echo ${objroot}/../binutils/objdump ; \
	else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \
	then echo ${objroot}/../binutils/objcopy ; \
	else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`

CFLAGS		= -g
SCRIPTS		=

OBJS = outbyte.o

# Beware: GNU make construct used (shell call).  Since GCC at the time
# of this writing requires GNU make >= 3.79.1, this should pose no
# problem.
SYSCALL_CFILES := $(shell sed -ne 's/^cat > \([^ ]*\).*/\1/p' < $(srcdir)/gensyscalls)

# Here is all of the simulator stuff.
# Actually, now it's just the GNU/Linux stuff, as that's also the
# simulator ABI.  The name of the library is different, though.
SIM_SCRIPTS	=
SIM_LDFLAGS	=
SIM_BSP		= libsyssim.a
SIM_CRT0	= $(LIN_CRT0)
SIM_OBJS	= $(LIN_OBJS)
SIM_TEST	= sim-test
SIM_INSTALL	= install-sim

# Here is all of the GNU/Linux stuff.  At present we don't build newlib
# and libgloss for cris*-linux-gnu*, but it's nice to keep that as an
# option.
LIN_PREFIX	=
LIN_LDFLAGS	=
LIN_BSP		= libsyslinux.a
LIN_CRT0	= lcrt0.o
LIN_EXTRA	= crti.o crtn.o crt1.o
LIN_OBJS	= close.o execve.o exit.o fcntl.o fork.o fstat.o getpid.o \
 gettod.o isatty.o kill.o link.o lseek.o open.o read.o \
 rename.o sbrk.o stat.o times.o unlink.o wait.o write.o ${OBJS}
LIN_SCRIPTS	=
LIN_TEST	=
LIN_INSTALL	= install-lin

# In (over)due time, here will be all stuff necessary for a development
# board.
BSP_PREFIX	=
BSP_LDFLAGS	=
BSP_BSP		= libbsp.a
BSP_CRT0	= crt0.o
BSP_OBJS	= ${OBJS} setup.o irqtable.o
BSP_SCRIPTS	=
BSP_TEST	=
BSP_INSTALL	= install-bsp

ALL_INSTALL_FILES = \
 ${SIM_CRT0} ${SIM_EXTRA} ${SIM_BSP} \
 ${LIN_CRT0} ${LIN_EXTRA} ${LIN_BSP} \
 ${BSP_CRT0} ${BSP_EXTRA} ${BSP_BSP}

ALL_INSTALL_FILES_NEWLIB_COPY = \
 $(sort ${ALL_INSTALL_FILES:%=$(objroot)/newlib/%}) $(objroot)/newlib/libnosys.a

# Host specific makefile fragment comes in here.
@host_makefile_frag@

# Need to augment the definition from host_makefile_frag above.
INCLUDES += -I$(srcdir)

all: ${ALL_INSTALL_FILES} ${ALL_INSTALL_FILES_NEWLIB_COPY} libnosys.a

#
# Here's where we build the board support packages for each target.
#
${SIM_BSP}: ${SIM_OBJS}
	${AR} ${ARFLAGS} ${SIM_BSP} ${SIM_OBJS}
	${RANLIB} ${SIM_BSP}

${BSP_BSP}: ${BSP_OBJS}
	${AR} ${ARFLAGS} ${BSP_BSP} ${BSP_OBJS}
	${RANLIB} ${BSP_BSP}

${LIN_BSP}: ${LIN_OBJS}
	${AR} ${ARFLAGS} ${LIN_BSP} ${LIN_OBJS}
	${RANLIB} ${LIN_BSP}

# We need a link to libnosys.a in this directory, since this is the
# directory used when test-compiling for configuration for other parts and
# when running the testsuite.  By using a symbolic link, it does not
# matter whether libnosys.a is built yet when the rule is executed.
libnosys.a:
	ln -s ../libnosys/libnosys.a

# Toplevel build rules for various other libraries have gcc -B options
# applied so the newlib build directory is reached, but not the target
# libgloss directory (whose name is unknown to the toplevel configury
# anyway).  Configury tests that check for a successful link therefore
# fail; they can't find crt0.o and non-libc.a+libm.a libraries.  We copy
# over all files we would install to the neighboring newlib directory.
# Only the default crt0.o and libraries are needed, but we do them all for
# completeness.  They're however installed from here, not from the newlib
# build directory.
$(objroot)/newlib/%: %
	cp -p $^ $@

# This rule, being more specific, overrides the pattern rule above.
$(objroot)/newlib/libnosys.a:
	ln -s ../libgloss/libnosys/libnosys.a $(objroot)/newlib

#
# Build a test program for each target board. Just trying to get
# it to link is a good test, so we ignore all the errors for now.
#
#
# Here's where we build the test programs for each target.
#
.PHONY: test
test:	${SIM_TEST} ${BSP_TEST}

sim-test:	sim-test.x sim-test.dis

sim-test.x:	test.o ${SIM_CRT0} ${SIM_BSP}
	${CC} ${LDFLAGS_FOR_TARGET} -L${objdir} \
	${SIM_CRT0} test.o \
	-o sim-test.x ${LIBS_FOR_TARGET} -lc ${SIM_BSP}

sim-test.dis:	sim-test.x
	${OBJDUMP} -d sim-test.x > sim-test.dis


test.o: ${srcdir}/m68k/test.c

# Debug usage.
.c.S:
	${CC} ${CFLAGS_FOR_TARGET} $(INCLUDES) $(CFLAGS) -c $<

# Caveat: for the -melinux multilib in cris-axis-aout, crt0.o is the
# same as lcrt0.o, while elsewhere (other cris-axis-aout multilib and
# cris-axis-elf) it's crt0.c compiled.
crt0.o: lcrt0.o crt0.S
	case "${MULTISUBDIR}" in \
          */elinux) \
	   cp -p $< $@; st=$$?;; \
          *) \
           case "$?" in \
            *crt0.S) \
	     $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -c -xassembler-with-cpp $(srcdir)/crt0.S;; \
            *) touch $@;; \
            esac; \
	   st=$$?;; \
	esac; exit $$st

crt1.o: lcrt0.o
	cp -p $< $@

clean mostlyclean:
	rm -f a.out core *.i *.o *-test *.srec *.dis *.x $(SIM_BSP) $(BSP_BSP) $(LIN_BSP) libnosys.a

distclean maintainer-clean realclean: clean
	rm -f Makefile config.status *~

.PHONY: install info install-info clean-info
install: ${SIM_INSTALL} ${BSP_INSTALL} ${LIN_INSTALL}

# Note that bsp and elinux objects are exclusive: do not overlap
# installed files.
install-bsp:
	case "${MULTISUBDIR}" in \
          */elinux) ;; \
	  *) set -e; \
	     for x in ${BSP_CRT0} ${BSP_BSP} ${BSP_SCRIPTS}; do \
		${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; \
	     done;; \
	esac

install-sim:
	set -e; \
	for x in ${SIM_CRT0} ${SIM_BSP} ${SIM_SCRIPTS}; do \
	  ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; \
	done

install-lin:
	case "${MULTISUBDIR}" in \
          */elinux) \
	    ${INSTALL_DATA} ${LIN_CRT0} $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/crt0.o; \
	    set -e; \
	    for x in ${LIN_BSP} ${LIN_SCRIPTS}; do \
	      ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; \
	    done;; \
          *) \
	    set -e; \
	    for x in ${LIN_BSP} ${LIN_SCRIPTS} ${LIN_EXTRA}; do \
	      ${INSTALL_DATA} $$x ${tooldir}/lib${MULTISUBDIR}/$$x; \
	    done;; \
	esac

doc:
info:
install-info:
clean-info:

Makefile: Makefile.in config.status @host_makefile_frag_path@
	$(SHELL) config.status

config.status: configure
	$(SHELL) config.status --recheck

$(SYSCALL_CFILES): syscalls.stamp

syscalls.stamp: gensyscalls
	$(SHELL) $(srcdir)/gensyscalls
	touch $@

# Dependencies that could and should be auto-generated.
close.o: close.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
execve.o: execve.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
exit.o: exit.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
fork.o: fork.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
fstat.o: fstat.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
fcntl.o: fcntl.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
getpid.o: getpid.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
gettod.o: gettod.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
isatty.o: isatty.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
kill.o: kill.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
link.o: link.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
lseek.o: lseek.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
open.o: open.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
read.o: read.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
rename.o: rename.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
sbrk.o: sbrk.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
stat.o: stat.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
times.o: times.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
unlink.o: unlink.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
wait.o: wait.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
write.o: write.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
lcrt0.o: lcrt0.c linunistd.h $(objdir)/../libnosys/config.h $(srcdir)/../libnosys/warning.h
setup.o: setup.S
irqtable.o: irqtable.S
crti.o: crti.c
crtn.o: crtn.c