source: trunk/libs/newlib/src/libgloss/mips/Makefile.in @ 609

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

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

File size: 7.7 KB
RevLine 
[444]1# Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 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
13DESTDIR =
14VPATH = @srcdir@
15srcdir = @srcdir@
16objdir = .
17srcroot = $(srcdir)/../..
18objroot = $(objdir)/../..
19
20prefix = @prefix@
21exec_prefix = @exec_prefix@
22
23host_alias = @host_alias@
24target_alias = @target_alias@
25program_transform_name = @program_transform_name@
26
27bindir = @bindir@
28libdir = @libdir@
29tooldir = $(exec_prefix)/$(target_alias)
30
31# Multilib support variables.
32# TOP is used instead of MULTI{BUILD,SRC}TOP.
33MULTIDIRS =
34MULTISUBDIR =
35MULTIDO = true
36MULTICLEAN = true
37
38INSTALL = @INSTALL@
39INSTALL_PROGRAM = @INSTALL_PROGRAM@
40INSTALL_DATA = @INSTALL_DATA@
41
42SHELL = /bin/sh
43
44CC = @CC@
45
46#AS = @AS@
47AS = `if [ -f ${objroot}/../gas/as.new ] ; \
48        then echo ${objroot}/../gas/as.new ; \
49        else echo as ; fi`
50
51AR = @AR@
52
53#LD = @LD@
54LD = `if [ -f ${objroot}/../ld/ld.new ] ; \
55        then echo ${objroot}/../ld/ld.new ; \
56        else echo ld ; fi`
57
58RANLIB = @RANLIB@
59
60OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
61        then echo ${objroot}/../binutils/objdump ; \
62        else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
63OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \
64        then echo ${objroot}/../binutils/objcopy ; \
65        else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
66
67CRT0 = @crt0@
68PCRT0 = @pcrt0@
69GENOBJS = syscalls.o fstat.o getpid.o isatty.o kill.o \
70        lseek.o print.o putnum.o stat.o unlink.o
71GENOBJS2 = open.o close.o read.o write.o
72IDTOBJS = idtmon.o @part_specific_obj@ ${GENOBJS}
73PMONOBJS = pmon.o @part_specific_obj@ ${GENOBJS}
74LSIOBJS = lsipmon.o @part_specific_obj@ ${GENOBJS}
75DVEOBJS = dvemon.o @part_specific_obj@ ${GENOBJS} ${GENOBJS2}
76JMR3904OBJS = jmr3904-io.o @part_specific_obj@ ${GENOBJS} ${GENOBJS2}
77CFEOBJS = cfe.o cfe_api.o cfe_mem.o @part_specific_obj@ ${GENOBJS} ${GENOBJS2}
78CYGMONOBJS = open.o close.o cygmon.o @part_specific_obj@ ${GENOBJS}
79
80# Nullmon cannot support read and write, but the test cases pull them in via libs
81NULLMONOBJS = nullmon.o @part_specific_obj@ ${GENOBJS}
82
83CFLAGS = -g
84
85GCC_LDFLAGS = `if [ -d ${objroot}/../gcc ] ; \
86        then echo -L${objroot}/../gcc ; fi`
87
88SCRIPTS = @script_list@
89BSP = @bsp_list@
90
91PART_SPECIFIC_DEFINES = @part_specific_defines@
92
93# Host specific makefile fragment comes in here.
94@host_makefile_frag@
95
96#
97# build a test program for each target board. Just trying to get
98# it to link is a good test, so we ignore all the errors for now.
99#
100
101all: ${CRT0} ${PCRT0} test.o ${BSP}
102
103#
104# here's where we build the board support packages for each target
105#
106mipsidt.o: $(IDTOBJS)
107        ${LD} -r $(IDTOBJS) -o $@
108
109mipspmon.o: $(PMONOBJS)
110        ${LD} -r $(PMONOBJS) -o $@
111
112mipslsi.o: $(PMONOBJS)
113        ${LD} -r $(LSIOBJS) -o $@
114
115libidt.a: $(IDTOBJS)
116        ${AR} ${ARFLAGS} $@ $(IDTOBJS)
117        ${RANLIB} $@
118
119libpmon.a: $(PMONOBJS)
120        ${AR} ${ARFLAGS} $@ $(PMONOBJS)
121        ${RANLIB} $@
122
123liblsi.a: $(LSIOBJS)
124        ${AR} ${ARFLAGS} $@ $(LSIOBJS)
125        ${RANLIB} $@
126
127libdve.a: $(DVEOBJS)
128        ${AR} ${ARFLAGS} $@ $(DVEOBJS)
129        ${RANLIB} $@
130
131libjmr3904.a: $(JMR3904OBJS)
132        ${AR} ${ARFLAGS} $@ $(JMR3904OBJS)
133        ${RANLIB} $@
134
135libcygmon.a: $(CYGMONOBJS)
136        ${AR} ${ARFLAGS} $@ $(CYGMONOBJS)
137        ${RANLIB} $@
138
139libcfe.a: $(CFEOBJS)
140        ${AR} ${ARFLAGS} $@ $(CFEOBJS)
141        ${RANLIB} $@
142
143# nullmon.a , This is what you want if you want crt0 but NO mon services
144# Supports GDB sim testing, board bringups, ICE operation.
145libnullmon.a: $(NULLMONOBJS)
146        ${AR} ${ARFLAGS} $@ $(NULLMONOBJS)
147        ${RANLIB} $@
148
149
150# compile a fully linked binary. The -Wl,-T*.ld is for the linker
151# script. By using -Wl, the linker script is put on the proper place
152# in the comand line for ld, and all the symbols will get fully
153# resolved.
154
155test: $(OBJS) ${BSP} pmon-test idt-test cfe-test
156        @echo Done...
157
158dtor.o:  $(srcdir)/dtor.C
159        $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -o $@ -c $<
160dtor.x: dtor.o ${CRT0} ${srcdir}/pmon.ld Makefile libpmon.a
161        ${CC} $(CFLAGS_FOR_TARGET) -L${srcdir} -L${objdir} \
162        dtor.o -o $@ $(NEWLIB_LDFLAGS) -N -Wl,-Tpmon.ld
163
164pmon-test.x: test.o ${CRT0} Makefile libpmon.a
165        ${CC} $(CFLAGS_FOR_TARGET) -L${srcdir} -L${objdir} \
166        test.o -o $@ $(NEWLIB_LDFLAGS) -Wl,-Tpmon.ld
167pmon-test.srec: pmon-test.x
168        $(OBJCOPY) -O srec pmon-test.x $@
169pmon-test.dis: pmon-test.x
170        @rm -fr pmon-test.dis
171        $(OBJDUMP) -d pmon-test.x > $@
172pmon-test: pmon-test.srec pmon-test.dis
173
174idt-test.x: test.o ${CRT0} Makefile libidt.a
175        ${CC} $(CFLAGS_FOR_TARGET) -L${srcdir} -L${objdir} \
176        test.o -o $@ $(NEWLIB_LDFLAGS) -Wl,-Tidt.ld
177idt-test.srec: idt-test.x
178        $(OBJCOPY) -O srec idt-test.x $@
179idt-test.dis: idt-test.x
180        @rm -fr idt-test.dis
181        $(OBJDUMP) -d idt-test.x > $@
182idt-test: idt-test.srec idt-test.dis
183
184cfe-test.x: test.o ${CRT0} Makefile libcfe.a
185        ${CC} $(CFLAGS_FOR_TARGET) -L${srcdir} -L${objdir} \
186        test.o -o $@ $(NEWLIB_LDFLAGS) -Wl,-Tcfe.ld
187cfe-test.srec: cfe-test.x
188        $(OBJCOPY) -O srec cfe-test.x $@
189cfe-test.dis: cfe-test.x
190        @rm -fr cfe-test.dis
191        $(OBJDUMP) -d cfe-test.x > $@
192cfe-test: cfe-test.srec cfe-test.dis
193
194doc:   
195
196clean mostlyclean:
197        rm -f a.out core *.i *~ *.o *-test *.srec *.dis *.map *.x
198
199distclean maintainer-clean realclean: clean
200        rm -f Makefile config.status a.out
201
202.PHONY: install info install-info clean-info
203install:
204        mkdir -p $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}
205        @for file in $(CRT0) $(PCRT0) $(BSP); do \
206          $(INSTALL_DATA) $${file} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$${file}; \
207        done
208        @for script in ${SCRIPTS}; do\
209          $(INSTALL_DATA) ${srcdir}/$${script}.ld $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$${script}.ld; \
210        done
211
212info:
213install-info:
214clean-info:
215
216test.o: ${srcdir}/test.c
217
218# these are for the BSPs
219crt0.o: ${srcdir}/crt0.S
220pcrt0.o: ${srcdir}/crt0.S
221        $(CC) -c $(CFLAGS_FOR_TARGET) $(CFLAGS) -DGCRT0 ${srcdir}/crt0.S -o ${PCRT0}
222crt0_cfe.o: ${srcdir}/crt0_cfe.S
223crt0_cygmon.o: ${srcdir}/crt0_cygmon.S
224idtmon.o: ${srcdir}/idtmon.S
225pmon.o: ${srcdir}/pmon.S
226        $(CC) -c $(CFLAGS_FOR_TARGET) $(CFLAGS) $(PART_SPECIFIC_DEFINES) ${srcdir}/pmon.S -o pmon.o
227vr4300.o: ${srcdir}/vr4300.S
228        $(CC) -c $(CFLAGS_FOR_TARGET) $(CFLAGS) ${srcdir}/vr4300.S
229vr5xxx.o: ${srcdir}/vr5xxx.S
230        $(CC) -c $(CFLAGS_FOR_TARGET) $(CFLAGS) ${srcdir}/vr5xxx.S
231lsipmon.o: $(srcdir)/lsipmon.S $(srcdir)/pmon.S
232jmr3904-io.o: ${srcdir}/jmr3904-io.c
233        $(CC) -c $(CFLAGS_FOR_TARGET) $(CFLAGS) ${srcdir}/jmr3904-io.c -o $@
234cfe.o: ${srcdir}/cfe.c ${srcdir}/cfe_api.h
235        $(CC) -c $(CFLAGS_FOR_TARGET) $(CFLAGS) ${srcdir}/cfe.c -o $@
236cfe_api.o: ${srcdir}/cfe_api.c ${srcdir}/cfe_api.h ${srcdir}/cfe_api_int.h
237        $(CC) -c $(CFLAGS_FOR_TARGET) $(CFLAGS) ${srcdir}/cfe_api.c -o $@
238cfe_mem.o: ${srcdir}/cfe_mem.c ${srcdir}/cfe_api.h
239        $(CC) -c $(CFLAGS_FOR_TARGET) $(CFLAGS) ${srcdir}/cfe_mem.c -o $@
240
241# cma101 can not be compiled mips16, if a mips16 version is needed then
242# it will have to be built, then this rule can be scrapped, allowing
243# the implicit rule to run.
244cma101.o: ${srcdir}/cma101.c
245        $(CC) -c $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) $(CFLAGS) -mno-mips16 ${srcdir}/cma101.c
246
247# cygmon can not be compiled as mips16 since it uses the syscall instruction
248cygmon.o: ${srcdir}/cygmon.c
249        $(CC) -c $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) $(CFLAGS) -mno-mips16 ${srcdir}/cygmon.c
250
251syscalls.o: ${srcdir}/syscalls.c
252
253# target specific makefile fragment comes in here.
254@target_makefile_frag@
255
256Makefile: Makefile.in config.status @host_makefile_frag_path@ @target_makefile_frag_path@
257        $(SHELL) config.status
258
259config.status: configure
260        $(SHELL) config.status --recheck
Note: See TracBrowser for help on using the repository browser.