| 1 | # | 
|---|
| 2 | # | 
|---|
| 3 | DESTDIR = | 
|---|
| 4 | VPATH = @srcdir@ @srcdir@/.. | 
|---|
| 5 | srcdir = @srcdir@ | 
|---|
| 6 | objdir = . | 
|---|
| 7 | srcroot = $(srcdir)/../.. | 
|---|
| 8 | objroot = $(objdir)/../.. | 
|---|
| 9 | mkinstalldirs = $(SHELL) $(srcroot)/mkinstalldirs | 
|---|
| 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 | objtype = @objtype@ | 
|---|
| 22 |  | 
|---|
| 23 | INSTALL = @INSTALL@ | 
|---|
| 24 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | 
|---|
| 25 | INSTALL_DATA = @INSTALL_DATA@ | 
|---|
| 26 |  | 
|---|
| 27 | # Multilib support variables. | 
|---|
| 28 | # TOP is used instead of MULTI{BUILD,SRC}TOP. | 
|---|
| 29 | MULTIDIRS = | 
|---|
| 30 | MULTISUBDIR = | 
|---|
| 31 | MULTIDO = true | 
|---|
| 32 | MULTICLEAN = true | 
|---|
| 33 |  | 
|---|
| 34 | SHELL = /bin/sh | 
|---|
| 35 |  | 
|---|
| 36 | CC = @CC@ | 
|---|
| 37 |  | 
|---|
| 38 | AS = @AS@ | 
|---|
| 39 | AR = @AR@ | 
|---|
| 40 | LD = @LD@ | 
|---|
| 41 | RANLIB = @RANLIB@ | 
|---|
| 42 |  | 
|---|
| 43 | OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \ | 
|---|
| 44 |         then echo ${objroot}/../binutils/objdump ; \ | 
|---|
| 45 |         else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi` | 
|---|
| 46 | OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \ | 
|---|
| 47 |         then echo ${objroot}/../binutils/objcopy ; \ | 
|---|
| 48 |         else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi` | 
|---|
| 49 |  | 
|---|
| 50 | CRT0            = gcrt0.o crt0.o | 
|---|
| 51 | CRT0_INSTALL    = install-crt0 | 
|---|
| 52 |  | 
|---|
| 53 | NSIM_BSP = libnsim.a | 
|---|
| 54 | NSIM_OBJS = \ | 
|---|
| 55 |         libcfunc.o \ | 
|---|
| 56 |         nsim-syscalls.o \ | 
|---|
| 57 |         sbrk.o \ | 
|---|
| 58 |         mcount.o | 
|---|
| 59 | NSIM_INSTALL = install-nsim | 
|---|
| 60 | NSIM_SCRIPTS = nsim.specs | 
|---|
| 61 |  | 
|---|
| 62 | NANO_SCRIPTS = nano.specs | 
|---|
| 63 | NANO_INSTALL = install-nano | 
|---|
| 64 |  | 
|---|
| 65 | CFLAGS          = -g | 
|---|
| 66 |  | 
|---|
| 67 | # Host specific makefile fragment comes in here. | 
|---|
| 68 | @host_makefile_frag@ | 
|---|
| 69 |  | 
|---|
| 70 | all: $(CRT0) $(NSIM_BSP) | 
|---|
| 71 |  | 
|---|
| 72 | $(NSIM_BSP): $(NSIM_OBJS) | 
|---|
| 73 |         $(AR) $(ARFLAGS) $@ $? | 
|---|
| 74 |         $(RANLIB) $@ | 
|---|
| 75 |  | 
|---|
| 76 | libcfunc.o: libcfunc.c | 
|---|
| 77 | nsim-syscalls.o: nsim-syscalls.c | 
|---|
| 78 | sbrk.o: sbrk.c | 
|---|
| 79 | mcount.o: mcount.c | 
|---|
| 80 | gcrt0.o: gcrt0.S crt0.S | 
|---|
| 81 | crt0.o: crt0.S | 
|---|
| 82 |  | 
|---|
| 83 | clean mostlyclean: | 
|---|
| 84 |         rm -f *.o *.a | 
|---|
| 85 |  | 
|---|
| 86 | distclean maintainer-clean realclean: clean | 
|---|
| 87 |         rm -f Makefile config.status config.log config.cache *~ | 
|---|
| 88 |  | 
|---|
| 89 | .PHONY: install info install-info clean-info doc dvi | 
|---|
| 90 | install: $(CRT0_INSTALL) $(NSIM_INSTALL) $(NANO_INSTALL) | 
|---|
| 91 |  | 
|---|
| 92 | # multilibdir may not exist yet - libgcc for ARC depends on libc, hence | 
|---|
| 93 | # newlib/libgloss is built before libgcc. And in parallel build libgloss maybe | 
|---|
| 94 | # built and installed before newlib, therefore libgloss has to create target | 
|---|
| 95 | # directory. | 
|---|
| 96 |  | 
|---|
| 97 | $(CRT0_INSTALL): | 
|---|
| 98 |         $(mkinstalldirs) $(DESTDIR)${tooldir}/lib${MULTISUBDIR} | 
|---|
| 99 |         for c in $(CRT0); do \ | 
|---|
| 100 |           b=`basename $$c`; \ | 
|---|
| 101 |           ${INSTALL_DATA} $$c $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$b ;\ | 
|---|
| 102 |         done | 
|---|
| 103 |  | 
|---|
| 104 | $(NSIM_INSTALL): | 
|---|
| 105 |         $(mkinstalldirs) $(DESTDIR)${tooldir}/lib${MULTISUBDIR} | 
|---|
| 106 |         $(INSTALL_DATA) $(NSIM_BSP) $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$(NSIM_BSP) | 
|---|
| 107 |         for x in $(NSIM_SCRIPTS); do \ | 
|---|
| 108 |             $(INSTALL_DATA) $(srcdir)/$$x $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$$x; done | 
|---|
| 109 |  | 
|---|
| 110 | $(NANO_INSTALL): | 
|---|
| 111 |         $(mkinstalldirs) $(DESTDIR)${tooldir}/lib${MULTISUBDIR} | 
|---|
| 112 |         for x in $(NANO_SCRIPTS); do \ | 
|---|
| 113 |                 $(INSTALL_DATA) $(srcdir)/$$x $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$$x; done | 
|---|
| 114 |  | 
|---|
| 115 | doc: | 
|---|
| 116 | info: | 
|---|
| 117 | dvi: | 
|---|
| 118 | install-info: | 
|---|
| 119 | clean-info: | 
|---|
| 120 |  | 
|---|
| 121 | Makefile: Makefile.in config.status @host_makefile_frag_path@ | 
|---|
| 122 |         $(SHELL) config.status | 
|---|
| 123 |  | 
|---|
| 124 | config.status: configure | 
|---|
| 125 |         $(SHELL) config.status --recheck | 
|---|