[444] | 1 | # |
---|
| 2 | # |
---|
| 3 | |
---|
| 4 | DESTDIR = |
---|
| 5 | VPATH = @srcdir@ @srcdir@/.. |
---|
| 6 | srcdir = @srcdir@ |
---|
| 7 | objdir = . |
---|
| 8 | srcroot = $(srcdir)/../.. |
---|
| 9 | objroot = $(objdir)/../.. |
---|
| 10 | |
---|
| 11 | prefix = @prefix@ |
---|
| 12 | exec_prefix = @exec_prefix@ |
---|
| 13 | |
---|
| 14 | host_alias = @host_alias@ |
---|
| 15 | target_alias = @target_alias@ |
---|
| 16 | |
---|
| 17 | bindir = @bindir@ |
---|
| 18 | libdir = @libdir@ |
---|
| 19 | tooldir = $(exec_prefix)/$(target_alias) |
---|
| 20 | |
---|
| 21 | INSTALL = @INSTALL@ |
---|
| 22 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
---|
| 23 | INSTALL_DATA = @INSTALL_DATA@ |
---|
| 24 | |
---|
| 25 | # Multilib support variables. |
---|
| 26 | # TOP is used instead of MULTI{BUILD,SRC}TOP. |
---|
| 27 | MULTIDIRS = |
---|
| 28 | MULTISUBDIR = |
---|
| 29 | |
---|
| 30 | SHELL = /bin/sh |
---|
| 31 | |
---|
| 32 | CC = @CC@ |
---|
| 33 | |
---|
| 34 | AS = @AS@ |
---|
| 35 | AR = @AR@ |
---|
| 36 | LD = @LD@ |
---|
| 37 | RANLIB = @RANLIB@ |
---|
| 38 | |
---|
| 39 | OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \ |
---|
| 40 | then echo ${objroot}/../binutils/objdump ; \ |
---|
| 41 | else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi` |
---|
| 42 | OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \ |
---|
| 43 | then echo ${objroot}/../binutils/objcopy ; \ |
---|
| 44 | else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi` |
---|
| 45 | |
---|
| 46 | CFLAGS = -g |
---|
| 47 | SCRIPTS = |
---|
| 48 | |
---|
| 49 | # Here is all of the simulator stuff |
---|
| 50 | SIM_SCRIPTS = |
---|
| 51 | SIM_LDFLAGS = |
---|
| 52 | SIM_BSP = libsim.a |
---|
| 53 | SIM_CRT0 = crt0.o |
---|
| 54 | SIM_OBJS = sbrk.o putnum.o getpid.o kill.o syscalls.o |
---|
| 55 | SIM_TEST = sim-test |
---|
| 56 | SIM_INSTALL = install-sim |
---|
| 57 | |
---|
| 58 | # Host specific makefile fragment comes in here. |
---|
| 59 | @host_makefile_frag@ |
---|
| 60 | |
---|
| 61 | # |
---|
| 62 | # build a test program for each target board. Just trying to get |
---|
| 63 | # it to link is a good test, so we ignore all the errors for now. |
---|
| 64 | # |
---|
| 65 | all: ${SIM_CRT0} ${SIM_BSP} |
---|
| 66 | |
---|
| 67 | # |
---|
| 68 | # here's where we build the board support packages for each target |
---|
| 69 | # |
---|
| 70 | ${SIM_BSP}: ${OBJS} ${SIM_OBJS} |
---|
| 71 | ${AR} ${ARFLAGS} ${SIM_BSP} ${SIM_OBJS} ${OBJS} |
---|
| 72 | ${RANLIB} ${SIM_BSP} |
---|
| 73 | |
---|
| 74 | |
---|
| 75 | # |
---|
| 76 | # here's where we build the test programs for each target |
---|
| 77 | # |
---|
| 78 | .PHONY: test |
---|
| 79 | test: ${SIM_TEST} |
---|
| 80 | |
---|
| 81 | sim-test: sim-test.x sim-test.dis |
---|
| 82 | |
---|
| 83 | sim-test.x: test.o ${SIM_CRT0} ${SIM_BSP} |
---|
| 84 | ${CC} ${LDFLAGS_FOR_TARGET} -L${objdir} \ |
---|
| 85 | ${SIM_CRT0} test.o \ |
---|
| 86 | -o sim-test.x ${LIBS_FOR_TARGET} -lc ${SIM_BSP} |
---|
| 87 | |
---|
| 88 | sim-test.dis: sim-test.x |
---|
| 89 | ${OBJDUMP} -d sim-test.x > sim-test.dis |
---|
| 90 | |
---|
| 91 | |
---|
| 92 | # |
---|
| 93 | # |
---|
| 94 | # |
---|
| 95 | .c.S: |
---|
| 96 | ${CC} ${CFLAGS_FOR_TARGET} -c $< |
---|
| 97 | |
---|
| 98 | clean mostlyclean: |
---|
| 99 | rm -f a.out core *.i *.o *-test *.srec *.dis *.x $(SIM_BSP) |
---|
| 100 | |
---|
| 101 | distclean maintainer-clean realclean: clean |
---|
| 102 | rm -f Makefile config.status *~ |
---|
| 103 | |
---|
| 104 | .PHONY: install info install-info clean-info |
---|
| 105 | install: ${SIM_INSTALL} |
---|
| 106 | |
---|
| 107 | install-sim: |
---|
| 108 | set -e;\ |
---|
| 109 | for x in ${SIM_CRT0} ${SIM_BSP}; do\ |
---|
| 110 | ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x;\ |
---|
| 111 | done |
---|
| 112 | for x in ${SIM_SCRIPTS}; do\ |
---|
| 113 | ${INSTALL_DATA} ${srcdir}/$${x} $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; \ |
---|
| 114 | done |
---|
| 115 | |
---|
| 116 | |
---|
| 117 | doc: |
---|
| 118 | info: |
---|
| 119 | install-info: |
---|
| 120 | clean-info: |
---|
| 121 | |
---|
| 122 | Makefile: Makefile.in config.status @host_makefile_frag_path@ |
---|
| 123 | $(SHELL) config.status |
---|
| 124 | |
---|
| 125 | config.status: configure |
---|
| 126 | $(SHELL) config.status --recheck |
---|