|
| 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 = 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 | +NSIM_INSTALL = install-nsim |
| 59 | +NSIM_SCRIPTS = nsim.specs |
| 60 | + |
| 61 | +CFLAGS = -g |
| 62 | + |
| 63 | +# Host specific makefile fragment comes in here. |
| 64 | +@host_makefile_frag@ |
| 65 | + |
| 66 | +all: $(CRT0) $(NSIM_BSP) |
| 67 | + |
| 68 | +$(NSIM_BSP): $(NSIM_OBJS) |
| 69 | + $(AR) $(ARFLAGS) $@ $? |
| 70 | + $(RANLIB) $@ |
| 71 | + |
| 72 | +libcfunc.o: libcfunc.c |
| 73 | +nsim-syscalls.o: nsim-syscalls.c |
| 74 | +sbrk.o: sbrk.c |
| 75 | + |
| 76 | +# |
| 77 | +$(CRT0): crt0.S |
| 78 | + |
| 79 | +clean mostlyclean: |
| 80 | + rm -f *.o *.a |
| 81 | + |
| 82 | +distclean maintainer-clean realclean: clean |
| 83 | + rm -f Makefile config.status config.log config.cache *~ |
| 84 | + |
| 85 | +.PHONY: install info install-info clean-info doc dvi |
| 86 | +install: $(CRT0_INSTALL) $(NSIM_INSTALL) |
| 87 | + |
| 88 | +# multilibdir may not exist yet - libgcc for ARC depends on libc, hence |
| 89 | +# newlib/libgloss is built before libgcc. And in parallel build libgloss maybe |
| 90 | +# built and installed before newlib, therefore libgloss has to create target |
| 91 | +# directory. |
| 92 | + |
| 93 | +$(CRT0_INSTALL): |
| 94 | + $(mkinstalldirs) $(DESTDIR)${tooldir}/lib${MULTISUBDIR} |
| 95 | + ${INSTALL_DATA} ${CRT0} $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$(CRT0) |
| 96 | + |
| 97 | +$(NSIM_INSTALL): |
| 98 | + $(mkinstalldirs) $(DESTDIR)${tooldir}/lib${MULTISUBDIR} |
| 99 | + $(INSTALL_DATA) $(NSIM_BSP) $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$(NSIM_BSP) |
| 100 | + for x in $(NSIM_SCRIPTS); do \ |
| 101 | + $(INSTALL_DATA) $(srcdir)/$$x $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$$x; done |
| 102 | + |
| 103 | +doc: |
| 104 | +info: |
| 105 | +dvi: |
| 106 | +install-info: |
| 107 | +clean-info: |
| 108 | + |
| 109 | +Makefile: Makefile.in config.status @host_makefile_frag_path@ |
| 110 | + $(SHELL) config.status |
| 111 | + |
| 112 | +config.status: configure |
| 113 | + $(SHELL) config.status --recheck |
0 commit comments