| 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 | includedir = @includedir@ |
|---|
| 30 | tooldir = $(exec_prefix)/$(target_alias) |
|---|
| 31 | |
|---|
| 32 | # Multilib support variables. |
|---|
| 33 | # TOP is used instead of MULTI{BUILD,SRC}TOP. |
|---|
| 34 | MULTIDIRS = |
|---|
| 35 | MULTISUBDIR = |
|---|
| 36 | MULTIDO = true |
|---|
| 37 | MULTICLEAN = true |
|---|
| 38 | |
|---|
| 39 | INSTALL = @INSTALL@ |
|---|
| 40 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
|---|
| 41 | INSTALL_DATA = @INSTALL_DATA@ |
|---|
| 42 | |
|---|
| 43 | SHELL = /bin/sh |
|---|
| 44 | |
|---|
| 45 | CC = @CC@ |
|---|
| 46 | AS = @AS@ |
|---|
| 47 | AR = @AR@ |
|---|
| 48 | LD = @LD@ |
|---|
| 49 | RANLIB = @RANLIB@ |
|---|
| 50 | |
|---|
| 51 | OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \ |
|---|
| 52 | then echo ${objroot}/../binutils/objdump ; \ |
|---|
| 53 | else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi` |
|---|
| 54 | OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \ |
|---|
| 55 | then echo ${objroot}/../binutils/objcopy ; \ |
|---|
| 56 | else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi` |
|---|
| 57 | |
|---|
| 58 | # object files needed |
|---|
| 59 | COMMON_FILES = syscalls \ |
|---|
| 60 | or1k_uart \ |
|---|
| 61 | outbyte \ |
|---|
| 62 | caches-asm \ |
|---|
| 63 | exceptions \ |
|---|
| 64 | exceptions-asm \ |
|---|
| 65 | interrupts \ |
|---|
| 66 | interrupts-asm \ |
|---|
| 67 | mmu-asm \ |
|---|
| 68 | timer \ |
|---|
| 69 | sbrk \ |
|---|
| 70 | impure \ |
|---|
| 71 | util \ |
|---|
| 72 | sync-asm |
|---|
| 73 | |
|---|
| 74 | LIBOR1K_FILES = $(COMMON_FILES) |
|---|
| 75 | LIBOR1K_OBJS = $(addsuffix .o,$(LIBOR1K_FILES)) |
|---|
| 76 | |
|---|
| 77 | BOARDS = atlys \ |
|---|
| 78 | de0_nano \ |
|---|
| 79 | ml501 \ |
|---|
| 80 | optimsoc \ |
|---|
| 81 | or1ksim \ |
|---|
| 82 | or1ksim-uart \ |
|---|
| 83 | ordb1a3pe1500 \ |
|---|
| 84 | ordb2a \ |
|---|
| 85 | orpsocrefdesign |
|---|
| 86 | |
|---|
| 87 | BOARD_LIBS = $(addprefix libboard-,$(addsuffix .a,$(BOARDS))) |
|---|
| 88 | BOARD_OBJS = $(addprefix libboard-,$(addsuffix .o,$(BOARDS))) |
|---|
| 89 | |
|---|
| 90 | GCC_LDFLAGS = `if [ -d ${objroot}/../gcc ] ; \ |
|---|
| 91 | then echo -L${objroot}/../gcc ; fi` |
|---|
| 92 | |
|---|
| 93 | OUTPUTS = libor1k.a crt0.o ${BOARD_LIBS} |
|---|
| 94 | |
|---|
| 95 | # Host specific makefile fragment comes in here. |
|---|
| 96 | @host_makefile_frag@ |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | all: ${OUTPUTS} |
|---|
| 100 | |
|---|
| 101 | # |
|---|
| 102 | # here's where we build the library for each target |
|---|
| 103 | # |
|---|
| 104 | |
|---|
| 105 | libor1k.a: $(LIBOR1K_OBJS) |
|---|
| 106 | ${AR} ${ARFLAGS} $@ $(LIBOR1K_OBJS) |
|---|
| 107 | ${RANLIB} $@ |
|---|
| 108 | |
|---|
| 109 | libboard-%.o: boards/%.S |
|---|
| 110 | ${CC} ${CFLAGS} -o $@ -c $< |
|---|
| 111 | |
|---|
| 112 | libboard-%.o: boards/%.c |
|---|
| 113 | ${CC} ${CFLAGS} -o $@ -c $< |
|---|
| 114 | |
|---|
| 115 | libboard-%.a: libboard-%.o |
|---|
| 116 | ${AR} ${ARFLAGS} $@ $< |
|---|
| 117 | ${RANLIB} $@ |
|---|
| 118 | |
|---|
| 119 | doc: |
|---|
| 120 | |
|---|
| 121 | clean mostlyclean: |
|---|
| 122 | rm -f $(OUTPUTS) $(BOARD_LIBS) *.i *~ *.o *-test *.srec *.dis *.map *.x |
|---|
| 123 | |
|---|
| 124 | distclean maintainer-clean realclean: clean |
|---|
| 125 | rm -f Makefile config.status $(OUTPUTS) |
|---|
| 126 | |
|---|
| 127 | .PHONY: install info install-info clean-info |
|---|
| 128 | install: |
|---|
| 129 | @for outputs in ${OUTPUTS}; do\ |
|---|
| 130 | mkdir -p $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \ |
|---|
| 131 | $(INSTALL_DATA) $${outputs} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \ |
|---|
| 132 | done |
|---|
| 133 | $(INSTALL_DATA) ${srcdir}/include/or1k-support.h $(DESTDIR)$(tooldir)/include/ |
|---|
| 134 | $(INSTALL_DATA) ${srcdir}/include/or1k-sprs.h $(DESTDIR)$(tooldir)/include/ |
|---|
| 135 | $(INSTALL_DATA) ${srcdir}/include/or1k-asm.h $(DESTDIR)$(tooldir)/include/ |
|---|
| 136 | $(INSTALL_DATA) ${srcdir}/include/or1k-nop.h $(DESTDIR)$(tooldir)/include/ |
|---|
| 137 | |
|---|
| 138 | info: |
|---|
| 139 | install-info: |
|---|
| 140 | clean-info: |
|---|
| 141 | |
|---|
| 142 | Makefile: Makefile.in config.status @host_makefile_frag_path@ |
|---|
| 143 | $(SHELL) config.status |
|---|
| 144 | |
|---|
| 145 | config.status: configure |
|---|
| 146 | $(SHELL) config.status --recheck |
|---|