| 1 | # | 
|---|
| 2 | # | 
|---|
| 3 |  | 
|---|
| 4 | DESTDIR = | 
|---|
| 5 |  | 
|---|
| 6 | VPATH = @srcdir@ @srcdir@/.. | 
|---|
| 7 | srcdir = @srcdir@ | 
|---|
| 8 | objdir = . | 
|---|
| 9 | srcroot = $(srcdir)/../.. | 
|---|
| 10 | objroot = $(objdir)/../.. | 
|---|
| 11 |  | 
|---|
| 12 | prefix = @prefix@ | 
|---|
| 13 | exec_prefix = @exec_prefix@ | 
|---|
| 14 |  | 
|---|
| 15 | host_alias = @host_alias@ | 
|---|
| 16 | target_alias = @target_alias@ | 
|---|
| 17 |  | 
|---|
| 18 | bindir = @bindir@ | 
|---|
| 19 | libdir = @libdir@ | 
|---|
| 20 | tooldir = $(exec_prefix)/$(target_alias) | 
|---|
| 21 |  | 
|---|
| 22 | INSTALL = @INSTALL@ | 
|---|
| 23 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | 
|---|
| 24 | INSTALL_DATA = @INSTALL_DATA@ | 
|---|
| 25 |  | 
|---|
| 26 | # Multilib support variables. | 
|---|
| 27 | # TOP is used instead of MULTI{BUILD,SRC}TOP. | 
|---|
| 28 | MULTIDIRS = | 
|---|
| 29 | MULTISUBDIR = | 
|---|
| 30 |  | 
|---|
| 31 | SHELL = /bin/sh | 
|---|
| 32 |  | 
|---|
| 33 | CC = @CC@ | 
|---|
| 34 |  | 
|---|
| 35 | AS = @AS@ | 
|---|
| 36 | AR = @AR@ | 
|---|
| 37 | LD = @LD@ | 
|---|
| 38 | RANLIB = @RANLIB@ | 
|---|
| 39 |  | 
|---|
| 40 | OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \ | 
|---|
| 41 |         then echo ${objroot}/../binutils/objdump ; \ | 
|---|
| 42 |         else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi` | 
|---|
| 43 | OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \ | 
|---|
| 44 |         then echo ${objroot}/../binutils/objcopy ; \ | 
|---|
| 45 |         else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi` | 
|---|
| 46 |  | 
|---|
| 47 | # Here is all of the handlers stuff | 
|---|
| 48 | H_SCRIPTS       = | 
|---|
| 49 | H_BSP   = libh.a | 
|---|
| 50 | H_OBJS  = intable.o dvz_hndl.o flg_hndl.o iad_hndl.o svc_hndl.o und_hndl.o | 
|---|
| 51 | H_TEST  = hndl-test | 
|---|
| 52 | H_INSTALL       = install-hndl | 
|---|
| 53 |  | 
|---|
| 54 | # Here is all of the simulator stuff | 
|---|
| 55 | SIM_SCRIPTS     = sim.ld | 
|---|
| 56 | SIM_BSP = libsim.a | 
|---|
| 57 | SIM_OBJS = _exit.o close.o _getenv.o lseek.o open.o read.o \ | 
|---|
| 58 |         _rename.o sbrk.o time.o unlink.o write.o \ | 
|---|
| 59 |         stat.o putnum.o kill.o getpid.o isatty.o fstat.o | 
|---|
| 60 | SIM_TEST        = sim-test | 
|---|
| 61 | SIM_INSTALL     = install-sim | 
|---|
| 62 |  | 
|---|
| 63 | # Here is all of the CRT stuff | 
|---|
| 64 | CRT     = crti.o crtn.o crt0.o | 
|---|
| 65 | CRT_INSTALL = install-crt | 
|---|
| 66 |  | 
|---|
| 67 | # Host specific makefile fragment comes in here. | 
|---|
| 68 | @host_makefile_frag@ | 
|---|
| 69 |  | 
|---|
| 70 | # | 
|---|
| 71 | # build a test program for each target board. Just trying to get | 
|---|
| 72 | # it to link is a good test, so we ignore all the errors for now. | 
|---|
| 73 | # | 
|---|
| 74 | all: ${CRT} ${SIM_BSP} ${H_BSP} | 
|---|
| 75 |  | 
|---|
| 76 | # | 
|---|
| 77 | # here's where we build the board support packages for each target | 
|---|
| 78 | # | 
|---|
| 79 | ${H_BSP}: ${H_OBJS} | 
|---|
| 80 |         ${AR} ${ARFLAGS} ${H_BSP} ${H_OBJS} | 
|---|
| 81 |         ${RANLIB} ${H_BSP} | 
|---|
| 82 |  | 
|---|
| 83 | ${SIM_BSP}: ${SIM_OBJS} | 
|---|
| 84 |         ${AR} ${ARFLAGS} ${SIM_BSP} ${SIM_OBJS} | 
|---|
| 85 |         ${RANLIB} ${SIM_BSP} | 
|---|
| 86 |  | 
|---|
| 87 | # | 
|---|
| 88 | # here's where we build the test programs for each target | 
|---|
| 89 | # | 
|---|
| 90 | .PHONY: test | 
|---|
| 91 | test:   ${SIM_TEST} ${H_TEST}  | 
|---|
| 92 |  | 
|---|
| 93 | hndl-test:      hndl-test.x hndl-test.dis | 
|---|
| 94 |  | 
|---|
| 95 | hndl-test.x:    test.o ${H_BSP} | 
|---|
| 96 |         ${CC} ${LDFLAGS_FOR_TARGET} -L${objdir} \ | 
|---|
| 97 |         test.o \ | 
|---|
| 98 |         -o hndl-test.x ${LIBS_FOR_TARGET} -lc ${H_BSP} -Wl,-T${SIM_SCRIPTS} | 
|---|
| 99 |  | 
|---|
| 100 | hndl-test.dis:  hndl-test.x | 
|---|
| 101 |         ${OBJDUMP} -d hndl-test.x > hndl-test.dis | 
|---|
| 102 |  | 
|---|
| 103 |  | 
|---|
| 104 | sim-test:       sim-test.x sim-test.dis | 
|---|
| 105 |  | 
|---|
| 106 | sim-test.x:     test.o ${SIM_BSP} | 
|---|
| 107 |         ${CC} ${LDFLAGS_FOR_TARGET} -L${objdir} \ | 
|---|
| 108 |         test.o \ | 
|---|
| 109 |         -o sim-test.x ${LIBS_FOR_TARGET} -lc ${SIM_BSP} -Wl,-T${SIM_SCRIPTS} | 
|---|
| 110 |  | 
|---|
| 111 | sim-test.dis:   sim-test.x | 
|---|
| 112 |         ${OBJDUMP} -d sim-test.x > sim-test.dis | 
|---|
| 113 |  | 
|---|
| 114 | # | 
|---|
| 115 | # | 
|---|
| 116 | # | 
|---|
| 117 | .c.S: | 
|---|
| 118 |         ${CC} ${CFLAGS_FOR_TARGET} -c $< | 
|---|
| 119 |  | 
|---|
| 120 | clean mostlyclean: | 
|---|
| 121 |         rm -f a.out core *.i *.o *-test *.srec *.dis *.x $(SIM_BSP) $(H_BSP) | 
|---|
| 122 |  | 
|---|
| 123 | distclean maintainer-clean realclean: clean | 
|---|
| 124 |         rm -f Makefile config.status *~ | 
|---|
| 125 |  | 
|---|
| 126 | .PHONY: install info install-info clean-info | 
|---|
| 127 | install: ${CRT_INSTALL} ${SIM_INSTALL} ${H_INSTALL} | 
|---|
| 128 |  | 
|---|
| 129 | install-crt: | 
|---|
| 130 |         set -e; for x in ${CRT} ; do\ | 
|---|
| 131 |           ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; \ | 
|---|
| 132 |         done | 
|---|
| 133 |  | 
|---|
| 134 | install-sim: | 
|---|
| 135 |         for x in ${SIM_BSP} ; do\ | 
|---|
| 136 |          ${INSTALL_PROGRAM} $${x} $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; \ | 
|---|
| 137 |         done | 
|---|
| 138 |         for x in ${SIM_SCRIPTS}; do\ | 
|---|
| 139 |          ${INSTALL_DATA} ${srcdir}/$${x} $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; \ | 
|---|
| 140 |         done | 
|---|
| 141 |  | 
|---|
| 142 | install-hndl: | 
|---|
| 143 |         for x in ${H_BSP}; do\ | 
|---|
| 144 |          ${INSTALL_PROGRAM} $${x} $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; \ | 
|---|
| 145 |         done | 
|---|
| 146 |  | 
|---|
| 147 | doc: | 
|---|
| 148 | info: | 
|---|
| 149 | install-info: | 
|---|
| 150 | clean-info: | 
|---|
| 151 |  | 
|---|
| 152 | Makefile: Makefile.in config.status @host_makefile_frag_path@ | 
|---|
| 153 |         $(SHELL) config.status | 
|---|
| 154 |  | 
|---|
| 155 | config.status: configure | 
|---|
| 156 |         $(SHELL) config.status --recheck | 
|---|