[444] | 1 | # |
---|
| 2 | # |
---|
| 3 | |
---|
| 4 | DESTDIR = |
---|
| 5 | VPATH = @srcdir@ @srcdir@/.. |
---|
| 6 | srcdir = @srcdir@ |
---|
| 7 | objdir = . |
---|
| 8 | srcroot = $(srcdir)/../.. |
---|
| 9 | objroot = $(objdir)/../.. |
---|
| 10 | top_srcdir = @top_srcdir@ |
---|
| 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 | mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs |
---|
| 34 | |
---|
| 35 | CC = @CC@ |
---|
| 36 | |
---|
| 37 | AS = @AS@ |
---|
| 38 | AR = @AR@ |
---|
| 39 | LD = @LD@ |
---|
| 40 | RANLIB = @RANLIB@ |
---|
| 41 | |
---|
| 42 | OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \ |
---|
| 43 | then echo ${objroot}/../binutils/objdump ; \ |
---|
| 44 | else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi` |
---|
| 45 | OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \ |
---|
| 46 | then echo ${objroot}/../binutils/objcopy ; \ |
---|
| 47 | else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi` |
---|
| 48 | |
---|
| 49 | OBJS = |
---|
| 50 | CFLAGS = |
---|
| 51 | SCRIPTS = |
---|
| 52 | |
---|
| 53 | # Here is all of the simulator stuff |
---|
| 54 | SIM_SCRIPTS = |
---|
| 55 | SIM_LDFLAGS = |
---|
| 56 | SIM_BSP = libsim.a |
---|
| 57 | SIM_CRT0 = crt0.o |
---|
| 58 | SIM_OBJS = syscalls.o clear_cache_range.o |
---|
| 59 | SIM_TEST = sim-test |
---|
| 60 | SIM_INSTALL = install-sim |
---|
| 61 | |
---|
| 62 | # Here is all of the development board stuff |
---|
| 63 | BOARD_SCRIPTS = bfin-common-sc.ld bfin-common-mc.ld bfin-common-mc0.ld \ |
---|
| 64 | bf504.ld bf506.ld \ |
---|
| 65 | bf512.ld bf514.ld bf516.ld bf518.ld \ |
---|
| 66 | bf522.ld bf523.ld bf524.ld bf525.ld bf526.ld bf527.ld \ |
---|
| 67 | bf531.ld bf532.ld bf533.ld \ |
---|
| 68 | bf534.ld bf536.ld bf537.ld \ |
---|
| 69 | bf538.ld bf539.ld \ |
---|
| 70 | bf542.ld bf544.ld bf547.ld bf548.ld bf549.ld \ |
---|
| 71 | bf561.ld bf561a.ld bf561b.ld bf561m.ld \ |
---|
| 72 | bf606.ld bf606c0.ld bf606c1.ld bf606m.ld \ |
---|
| 73 | bf607.ld bf607c0.ld bf607c1.ld bf607m.ld \ |
---|
| 74 | bf608.ld bf608c0.ld bf608c1.ld bf608m.ld \ |
---|
| 75 | bf609.ld bf609c0.ld bf609c1.ld bf609m.ld \ |
---|
| 76 | bf592.ld |
---|
| 77 | BOARD_LDFLAGS = |
---|
| 78 | BOARD_BSP = libbfinbsp.a |
---|
| 79 | BOARD_CRT0S = basiccrt.o basiccrts.o |
---|
| 80 | BOARD_CRT0S += basiccrt561.o basiccrt561s.o basiccrt561b.o |
---|
| 81 | # BOARD_CRT0S += basiccrt60x.o basiccrt60xs.o basiccrt60xc1.o |
---|
| 82 | BOARD_OBJS = clear_cache_range.o _exit.o |
---|
| 83 | BOARD_TEST = |
---|
| 84 | BOARD_INSTALL = install-board |
---|
| 85 | |
---|
| 86 | # Host specific makefile fragment comes in here. |
---|
| 87 | @host_makefile_frag@ |
---|
| 88 | |
---|
| 89 | INCLUDES += -I$(srcdir)/include |
---|
| 90 | # |
---|
| 91 | # build a test program for each target board. Just trying to get |
---|
| 92 | # it to link is a good test, so we ignore all the errors for now. |
---|
| 93 | # |
---|
| 94 | all: ${SIM_CRT0} ${SIM_BSP} ${BOARD_CRT0S} ${BOARD_BSP} |
---|
| 95 | |
---|
| 96 | # |
---|
| 97 | # here's where we build the board support packages for each target |
---|
| 98 | # |
---|
| 99 | ${BOARD_BSP}: ${OBJS} ${BOARD_OBJS} |
---|
| 100 | ${AR} ${ARFLAGS} $@ $^ |
---|
| 101 | ${RANLIB} $@ |
---|
| 102 | |
---|
| 103 | ${SIM_BSP}: ${OBJS} ${SIM_OBJS} |
---|
| 104 | ${AR} ${ARFLAGS} ${SIM_BSP} ${SIM_OBJS} ${OBJS} |
---|
| 105 | ${RANLIB} ${SIM_BSP} |
---|
| 106 | |
---|
| 107 | # |
---|
| 108 | # |
---|
| 109 | # |
---|
| 110 | crt0.o: crt0.S |
---|
| 111 | |
---|
| 112 | basiccrt.o: basiccrt.S |
---|
| 113 | ifeq (,$(findstring mcpu=,$(CFLAGS))) |
---|
| 114 | $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf532-any -o $@ -c $< |
---|
| 115 | else |
---|
| 116 | $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -o $@ -c $< |
---|
| 117 | endif |
---|
| 118 | |
---|
| 119 | basiccrts.o: basiccrt.S |
---|
| 120 | ifeq (,$(findstring mcpu=,$(CFLAGS))) |
---|
| 121 | $(CC) -D__BFIN_SDRAM $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf532-any -o $@ -c $< |
---|
| 122 | else |
---|
| 123 | $(CC) -D__BFIN_SDRAM $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -o $@ -c $< |
---|
| 124 | endif |
---|
| 125 | |
---|
| 126 | basiccrt561.o: basiccrt.S |
---|
| 127 | ifneq (,$(findstring mcpu=bf532-none,$(CFLAGS))) |
---|
| 128 | $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf561-none -o $@ -c $< |
---|
| 129 | else |
---|
| 130 | $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf561-any -o $@ -c $< |
---|
| 131 | endif |
---|
| 132 | |
---|
| 133 | basiccrt561s.o: basiccrt.S |
---|
| 134 | ifneq (,$(findstring mcpu=bf532-none,$(CFLAGS))) |
---|
| 135 | $(CC) -D__BFIN_SDRAM $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf561-none -o $@ -c $< |
---|
| 136 | else |
---|
| 137 | $(CC) -D__BFIN_SDRAM $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf561-any -o $@ -c $< |
---|
| 138 | endif |
---|
| 139 | |
---|
| 140 | basiccrt561b.o: basiccrt.S |
---|
| 141 | ifneq (,$(findstring mcpu=bf532-none,$(CFLAGS))) |
---|
| 142 | $(CC) -D__ADSPBF561_COREB__ $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf561-none -o $@ -c $< |
---|
| 143 | else |
---|
| 144 | $(CC) -D__ADSPBF561_COREB__ $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf561-any -o $@ -c $< |
---|
| 145 | endif |
---|
| 146 | |
---|
| 147 | basiccrt60x.o: basiccrt.S |
---|
| 148 | ifneq (,$(findstring mcpu=bf532-none,$(CFLAGS))) |
---|
| 149 | $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf608-none -o $@ -c $< |
---|
| 150 | else |
---|
| 151 | $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf608-any -o $@ -c $< |
---|
| 152 | endif |
---|
| 153 | |
---|
| 154 | basiccrt60xs.o: basiccrt.S |
---|
| 155 | ifneq (,$(findstring mcpu=bf532-none,$(CFLAGS))) |
---|
| 156 | $(CC) -D__BFIN_SDRAM $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf608-none -o $@ -c $< |
---|
| 157 | else |
---|
| 158 | $(CC) -D__BFIN_SDRAM $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf608-any -o $@ -c $< |
---|
| 159 | endif |
---|
| 160 | |
---|
| 161 | basiccrt60xc1.o: basiccrt.S |
---|
| 162 | ifneq (,$(findstring mcpu=bf532-none,$(CFLAGS))) |
---|
| 163 | $(CC) -D__ADSPBF60x_CORE1__ $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf608-none -o $@ -c $< |
---|
| 164 | else |
---|
| 165 | $(CC) -D__ADSPBF60x_CORE1__ $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf608-any -o $@ -c $< |
---|
| 166 | endif |
---|
| 167 | |
---|
| 168 | clean mostlyclean: |
---|
| 169 | rm -f a.out core *.i *.o ${SIM_BSP} ${BOARD_BSP} |
---|
| 170 | |
---|
| 171 | distclean maintainer-clean realclean: clean |
---|
| 172 | rm -f Makefile config.status *~ |
---|
| 173 | |
---|
| 174 | .PHONY: install info install-info clean-info |
---|
| 175 | install: ${SIM_INSTALL} ${BOARD_INSTALL} |
---|
| 176 | |
---|
| 177 | install-sim: |
---|
| 178 | for x in ${SIM_CRT0} ${SIM_BSP} ${SIM_SCRIPTS}; do \ |
---|
| 179 | ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x || exit $$?; \ |
---|
| 180 | done |
---|
| 181 | |
---|
| 182 | install-board: |
---|
| 183 | for x in ${BOARD_CRT0S} ${BOARD_BSP}; do \ |
---|
| 184 | ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x || exit $$?; \ |
---|
| 185 | done |
---|
| 186 | -if [ -z "${MULTISUBDIR}" ]; then \ |
---|
| 187 | for x in ${BOARD_SCRIPTS}; do \ |
---|
| 188 | ${INSTALL_DATA} ${srcdir}/$$x $(DESTDIR)${tooldir}/lib/$$x; \ |
---|
| 189 | done; \ |
---|
| 190 | ${mkinstalldirs} ${DESTDIR}${tooldir}/include; \ |
---|
| 191 | for i in ${srcdir}/include/*.h; do \ |
---|
| 192 | ${INSTALL_DATA} $$i ${DESTDIR}${tooldir}/include/`basename $$i`; \ |
---|
| 193 | done; \ |
---|
| 194 | ${mkinstalldirs} ${DESTDIR}${tooldir}/include/sys; \ |
---|
| 195 | for i in ${srcdir}/include/sys/*.h; do \ |
---|
| 196 | ${INSTALL_DATA} $$i ${DESTDIR}${tooldir}/include/sys/`basename $$i`; \ |
---|
| 197 | done; \ |
---|
| 198 | else true; fi |
---|
| 199 | |
---|
| 200 | doc: |
---|
| 201 | info: |
---|
| 202 | install-info: |
---|
| 203 | clean-info: |
---|
| 204 | |
---|
| 205 | Makefile: Makefile.in config.status @host_makefile_frag_path@ |
---|
| 206 | $(SHELL) config.status |
---|
| 207 | |
---|
| 208 | config.status: configure |
---|
| 209 | $(SHELL) config.status --recheck |
---|