[444] | 1 | # Copyright (c) 1998 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 | DESTDIR = |
---|
| 14 | VPATH = @srcdir@ |
---|
| 15 | srcdir = @srcdir@ |
---|
| 16 | objdir = . |
---|
| 17 | srcroot = $(srcdir)/../.. |
---|
| 18 | objroot = $(objdir)/../.. |
---|
| 19 | |
---|
| 20 | prefix = @prefix@ |
---|
| 21 | exec_prefix = @exec_prefix@ |
---|
| 22 | |
---|
| 23 | host_alias = @host_alias@ |
---|
| 24 | target_alias = @target_alias@ |
---|
| 25 | program_transform_name = @program_transform_name@ |
---|
| 26 | |
---|
| 27 | bindir = @bindir@ |
---|
| 28 | libdir = @libdir@ |
---|
| 29 | tooldir = $(exec_prefix)/$(target_alias) |
---|
| 30 | |
---|
| 31 | # Multilib support variables. |
---|
| 32 | # TOP is used instead of MULTI{BUILD,SRC}TOP. |
---|
| 33 | MULTIDIRS = |
---|
| 34 | MULTISUBDIR = |
---|
| 35 | MULTIDO = true |
---|
| 36 | MULTICLEAN = true |
---|
| 37 | |
---|
| 38 | INSTALL = @INSTALL@ |
---|
| 39 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
---|
| 40 | INSTALL_DATA = @INSTALL_DATA@ |
---|
| 41 | |
---|
| 42 | SHELL = /bin/sh |
---|
| 43 | |
---|
| 44 | CC = @CC@ |
---|
| 45 | |
---|
| 46 | AS = @AS@ |
---|
| 47 | |
---|
| 48 | AR = @AR@ |
---|
| 49 | |
---|
| 50 | LD = @LD@ |
---|
| 51 | |
---|
| 52 | RANLIB = @RANLIB@ |
---|
| 53 | |
---|
| 54 | OBJDUMP = `t='$(program_transform_name)'; echo objdump | sed -e $$t` |
---|
| 55 | OBJCOPY = `t='$(program_transform_name)'; echo objcopy | sed -e $$t` |
---|
| 56 | |
---|
| 57 | # Generic object files common to some targets. |
---|
| 58 | # These are LIBGLOSS stubs and minimal functionality in SBRK, READ and WRITE. |
---|
| 59 | OBJS = close.o fstat.o getpid.o isatty.o kill.o lseek.o open.o \ |
---|
| 60 | print.o putnum.o read.o stat.o unlink.o write.o |
---|
| 61 | |
---|
| 62 | # Object files specific to particular targets. |
---|
| 63 | SERIALOBJS = ${OBJS} _exit.o gettod.o sbrk.o serial-inbyte.o serial-outbyte.o |
---|
| 64 | |
---|
| 65 | # These go with the hosted file I/O libraries with a version of syscalls. |
---|
| 66 | HOSTEDOBJS = getpid.o kill.o io-gdb.o io-stubs.o sbrk.o |
---|
| 67 | |
---|
| 68 | SCRIPTS = |
---|
| 69 | BSP = crt0.o libserial.a libsim.a libdebug.a |
---|
| 70 | |
---|
| 71 | # Host specific makefile fragment comes in here. |
---|
| 72 | @host_makefile_frag@ |
---|
| 73 | |
---|
| 74 | all: ${BSP} |
---|
| 75 | |
---|
| 76 | # |
---|
| 77 | # here's where we build the board support packages for each target |
---|
| 78 | # |
---|
| 79 | |
---|
| 80 | libserial.a: $(SERIALOBJS) |
---|
| 81 | $(AR) $(ARFLAGS) $@ $^ |
---|
| 82 | $(RANLIB) $@ |
---|
| 83 | |
---|
| 84 | libsim.a: ${HOSTEDOBJS} sim-syscalls.o |
---|
| 85 | ${AR} ${ARFLAGS} $@ $^ |
---|
| 86 | ${RANLIB} $@ |
---|
| 87 | |
---|
| 88 | libdebug.a: ${HOSTEDOBJS} debug-syscalls.o |
---|
| 89 | ${AR} ${ARFLAGS} $@ $^ |
---|
| 90 | ${RANLIB} $@ |
---|
| 91 | |
---|
| 92 | sim-syscalls.o: syscalls.c syscall.h io.h |
---|
| 93 | ${CC} ${CFLAGS_FOR_TARGET} ${CFLAGS} -DTARGET_SIM -c -o $@ $< |
---|
| 94 | |
---|
| 95 | debug-syscalls.o: syscalls.c syscall.h io.h |
---|
| 96 | ${CC} ${CFLAGS_FOR_TARGET} ${CFLAGS} -c -o $@ $< |
---|
| 97 | |
---|
| 98 | $(OBJS): %.o: ../%.c |
---|
| 99 | ${CC} ${CFLAGS_FOR_TARGET} ${CFLAGS} -c -o $@ $< |
---|
| 100 | |
---|
| 101 | doc: |
---|
| 102 | |
---|
| 103 | clean mostlyclean: |
---|
| 104 | rm -f a.out core *.i *~ *.o *-test *.srec *.dis *.map *.x |
---|
| 105 | |
---|
| 106 | distclean maintainer-clean realclean: clean |
---|
| 107 | rm -f Makefile config.status a.out |
---|
| 108 | |
---|
| 109 | .PHONY: install info install-info clean-info |
---|
| 110 | install: |
---|
| 111 | @for bsp in ${BSP}; do\ |
---|
| 112 | $(INSTALL_DATA) $${bsp} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \ |
---|
| 113 | done |
---|
| 114 | @for script in ${SCRIPTS}; do\ |
---|
| 115 | $(INSTALL_DATA) $(srcdir)/$${script}.ld $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$${script}.ld; \ |
---|
| 116 | done |
---|
| 117 | |
---|
| 118 | info: |
---|
| 119 | install-info: |
---|
| 120 | clean-info: |
---|
| 121 | |
---|
| 122 | # target specific makefile fragment comes in here. |
---|
| 123 | @target_makefile_frag@ |
---|
| 124 | |
---|
| 125 | Makefile: Makefile.in config.status @host_makefile_frag_path@ @target_makefile_frag_path@ |
---|
| 126 | $(SHELL) config.status |
---|
| 127 | |
---|
| 128 | config.status: configure |
---|
| 129 | $(SHELL) config.status --recheck |
---|