1 |
39 |
lampret |
# Copyright (c) 1995, 1996 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 |
|
|
|
25 |
|
|
bindir = @bindir@
|
26 |
|
|
libdir = @libdir@
|
27 |
|
|
tooldir = $(exec_prefix)/$(target_alias)
|
28 |
|
|
|
29 |
|
|
# Multilib support variables.
|
30 |
|
|
# TOP is used instead of MULTI{BUILD,SRC}TOP.
|
31 |
|
|
MULTIDIRS =
|
32 |
|
|
MULTISUBDIR =
|
33 |
|
|
MULTIDO = true
|
34 |
|
|
MULTICLEAN = true
|
35 |
|
|
|
36 |
|
|
INSTALL = @INSTALL@
|
37 |
|
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
38 |
|
|
INSTALL_DATA = @INSTALL_DATA@
|
39 |
|
|
|
40 |
|
|
SHELL = /bin/sh
|
41 |
|
|
|
42 |
|
|
CC = @CC@
|
43 |
|
|
|
44 |
|
|
AS = @AS@
|
45 |
|
|
AR = @AR@
|
46 |
|
|
LD = @LD@
|
47 |
|
|
RANLIB = @RANLIB@
|
48 |
|
|
|
49 |
|
|
OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
|
50 |
|
|
then echo ${objroot}/../binutils/objdump ; \
|
51 |
|
|
else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
|
52 |
|
|
OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \
|
53 |
|
|
then echo ${objroot}/../binutils/objcopy ; \
|
54 |
|
|
else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
|
55 |
|
|
|
56 |
|
|
SCRIPTS = w89k op50n
|
57 |
|
|
CRT0 = crt0.o
|
58 |
|
|
OBJS = close.o fstat.o getpid.o isatty.o kill.o \
|
59 |
|
|
lseek.o open.o print.o putnum.o read.o sbrk.o stat.o \
|
60 |
|
|
unlink.o write.o hp-milli.o
|
61 |
|
|
|
62 |
|
|
CFLAGS = -g
|
63 |
|
|
# ARFLAGS = rv
|
64 |
|
|
|
65 |
|
|
#
|
66 |
|
|
# here's all the Oki OP50N target stuff
|
67 |
|
|
#
|
68 |
|
|
OKI_LDFLAGS= -L${srcdir} -Top50n.ld $(LDFLAGS_FOR_TARGET) -Ttext 40000 -Map oki.map
|
69 |
|
|
OKI_BSP= libop50n.a
|
70 |
|
|
OKI_OBJS= op50nled.o op50n-io.o
|
71 |
|
|
|
72 |
|
|
#
|
73 |
|
|
# here's all the WinBind W89k target stuff
|
74 |
|
|
#
|
75 |
|
|
WEC_LDFLAGS= -L${srcdir} -Tw89k.ld $(LDFLAGS_FOR_TARGET) -Ttext 100000 -Map wec.map
|
76 |
|
|
WEC_BSP= libw89k.a
|
77 |
|
|
WEC_OBJS= w89k-io.o
|
78 |
|
|
|
79 |
|
|
# Host specific makefile fragment comes in here.
|
80 |
|
|
@host_makefile_frag@
|
81 |
|
|
|
82 |
|
|
#
|
83 |
|
|
# build a test program for each target board. Just trying to get
|
84 |
|
|
# it to link is a good test, so we ignore all the errors for now.
|
85 |
|
|
#
|
86 |
|
|
|
87 |
|
|
all: ${CRT0} ${OKI_BSP} ${WEC_BSP}
|
88 |
|
|
|
89 |
|
|
test: ${CRT0} test.o ${OKI_BSP} ${WEC_BSP}
|
90 |
|
|
@for script in ${SCRIPTS}; do \
|
91 |
|
|
echo Building $@ for $${script}... ; \
|
92 |
|
|
${CC} $(CFLAGS_FOR_TARGET) $(INCLUDES) -L${objdir} \
|
93 |
|
|
-m$${script} test.o -L. \
|
94 |
|
|
-o $${script}-test.x $(LIBS_FOR_TARGET) ; \
|
95 |
|
|
if [ -s $${script}-test.x ] ; then \
|
96 |
|
|
echo "Making an srecord for $${script}-test.x..." ; \
|
97 |
|
|
${OBJCOPY} -O srec $${script}-test.x $${script}-test.srec ; \
|
98 |
|
|
echo "Making an disassembly file for $${script}-test.x..." ; \
|
99 |
|
|
rm -f $${script}-test.dis ; \
|
100 |
|
|
${OBJDUMP} -d $${script}-test.x > $${script}-test.dis ; \
|
101 |
|
|
else \
|
102 |
|
|
rm $${script}-test.x ; \
|
103 |
|
|
echo "WARNING: $${script}-test didn't build." ; \
|
104 |
|
|
fi ; \
|
105 |
|
|
done
|
106 |
|
|
|
107 |
|
|
#
|
108 |
|
|
# here's where we build the board support packages for each target
|
109 |
|
|
#
|
110 |
|
|
${OKI_BSP}: $(OBJS) ${OKI_OBJS}
|
111 |
|
|
${AR} ${ARFLAGS} $@ $(OBJS) ${OKI_OBJS}
|
112 |
|
|
${RANLIB} $@
|
113 |
|
|
|
114 |
|
|
${WEC_BSP}: $(OBJS) ${WEC_OBJS}
|
115 |
|
|
${AR} ${ARFLAGS} $@ $(OBJS) ${WEC_OBJS}
|
116 |
|
|
${RANLIB} $@
|
117 |
|
|
|
118 |
|
|
op50n-test.x: test.o ${srcdir}/test.c ${OKI_BSP} ${WEC_BSP}
|
119 |
|
|
w89k-test.x: test.o ${srcdir}/test.c ${OKI_BSP} ${WEC_BSP}
|
120 |
|
|
|
121 |
|
|
doc:
|
122 |
|
|
|
123 |
|
|
clean mostlyclean:
|
124 |
|
|
rm -f a.out core *.i *~ *.o *-test *.srec *.dis *.map *.x
|
125 |
|
|
|
126 |
|
|
distclean maintainer-clean realclean: clean
|
127 |
|
|
rm -f Makefile config.cache config.log config.status
|
128 |
|
|
|
129 |
|
|
.PHONY: install info install-info clean-info
|
130 |
|
|
install:
|
131 |
|
|
$(INSTALL_PROGRAM) $(CRT0) $(tooldir)/lib${MULTISUBDIR}/$(CRT0)
|
132 |
|
|
# install Oki stuff
|
133 |
|
|
$(INSTALL_PROGRAM) $(OKI_BSP) $(tooldir)/lib${MULTISUBDIR}/$(OKI_BSP)
|
134 |
|
|
$(INSTALL_DATA) ${srcdir}/op50n.ld $(tooldir)/lib${MULTISUBDIR}/op50n.ld
|
135 |
|
|
# install WinBond stuff
|
136 |
|
|
$(INSTALL_PROGRAM) $(WEC_BSP) $(tooldir)/lib${MULTISUBDIR}/$(WEC_BSP)
|
137 |
|
|
$(INSTALL_DATA) ${srcdir}/w89k.ld $(tooldir)/lib${MULTISUBDIR}/w89k.ld
|
138 |
|
|
|
139 |
|
|
info:
|
140 |
|
|
install-info:
|
141 |
|
|
clean-info:
|
142 |
|
|
|
143 |
|
|
test.o: ${srcdir}/test.c
|
144 |
|
|
${CRT0}:${srcdir}/crt0.S
|
145 |
|
|
op50n-io.o: ${srcdir}/op50n-io.S
|
146 |
|
|
op50nled.o: ${srcdir}/op50nled.c
|
147 |
|
|
|
148 |
|
|
# target specific makefile fragment comes in here.
|
149 |
|
|
@target_makefile_frag@
|
150 |
|
|
|
151 |
|
|
Makefile: Makefile.in config.status @host_makefile_frag_path@ @target_makefile_frag_path@
|
152 |
|
|
$(SHELL) config.status
|
153 |
|
|
|
154 |
|
|
config.status: configure
|
155 |
|
|
$(SHELL) config.status --recheck
|