1 # Copyright (c) 1995, 1996 Cygnus Support
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
16 srcroot
= $(srcdir)/..
/..
17 objroot
= $(objdir
)/..
/..
20 exec_prefix = @
exec_prefix@
22 host_alias
= @host_alias@
23 target_alias
= @target_alias@
27 tooldir
= $(exec_prefix)/$(target_alias
)
29 # Multilib support variables.
30 # TOP is used instead of MULTI{BUILD,SRC}TOP.
37 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
38 INSTALL_DATA
= @INSTALL_DATA@
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`
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
66 # here's all the Oki OP50N target stuff
68 OKI_LDFLAGS
= -L
${srcdir} -Top50n.
ld $(LDFLAGS_FOR_TARGET
) -Ttext
40000 -Map oki.map
70 OKI_OBJS
= op50nled.o op50n-io.o
73 # here's all the WinBind W89k target stuff
75 WEC_LDFLAGS
= -L
${srcdir} -Tw89k.
ld $(LDFLAGS_FOR_TARGET
) -Ttext
100000 -Map wec.map
79 # Host specific makefile fragment comes in here.
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.
87 all: ${CRT0} ${OKI_BSP} ${WEC_BSP}
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
; \
102 rm $${script}-test.x
; \
103 echo
"WARNING: $${script}-test didn't build." ; \
108 # here's where we build the board support packages for each target
110 ${OKI_BSP}: $(OBJS
) ${OKI_OBJS}
111 ${AR} ${ARFLAGS} $@
$(OBJS
) ${OKI_OBJS}
114 ${WEC_BSP}: $(OBJS
) ${WEC_OBJS}
115 ${AR} ${ARFLAGS} $@
$(OBJS
) ${WEC_OBJS}
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}
124 rm -f a.out core
*.i
*~
*.o
*-test *.srec
*.dis
*.map
*.x
126 distclean maintainer-clean
realclean: clean
127 rm -f Makefile config.cache config.log config.status
129 .PHONY
: install info install-info clean-info
131 $(INSTALL_PROGRAM
) $(CRT0
) $(tooldir
)/lib
${MULTISUBDIR}/$(CRT0
)
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
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
148 # target specific makefile fragment comes in here.
149 @target_makefile_frag@
151 Makefile
: Makefile.in config.status @host_makefile_frag_path@ @target_makefile_frag_path@
152 $(SHELL
) config.status
154 config.status
: configure
155 $(SHELL
) config.status
--recheck