1 | # Copyright (c) 1999, 2001, 2003 Red Hat Inc |
---|
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 | # Makefile for libgloss/mep. We only support the simulator at the |
---|
14 | # moment. |
---|
15 | |
---|
16 | VPATH = @srcdir@ @srcdir@/.. |
---|
17 | srcdir = @srcdir@ |
---|
18 | objdir = . |
---|
19 | srcroot = $(srcdir)/../.. |
---|
20 | objroot = $(objdir)/../.. |
---|
21 | |
---|
22 | prefix = @prefix@ |
---|
23 | exec_prefix = @exec_prefix@ |
---|
24 | |
---|
25 | host_alias = @host_alias@ |
---|
26 | target_alias = @target_alias@ |
---|
27 | |
---|
28 | bindir = @bindir@ |
---|
29 | libdir = @libdir@ |
---|
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 | |
---|
47 | AS = @AS@ |
---|
48 | AR = @AR@ |
---|
49 | LD = @LD@ |
---|
50 | RANLIB = @RANLIB@ |
---|
51 | AR_FLAGS = rc |
---|
52 | |
---|
53 | OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \ |
---|
54 | then echo ${objroot}/../binutils/objdump ; \ |
---|
55 | else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi` |
---|
56 | OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \ |
---|
57 | then echo ${objroot}/../binutils/objcopy ; \ |
---|
58 | else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi` |
---|
59 | |
---|
60 | SCRIPTS = min.ld default.ld |
---|
61 | CRT = crt0.o sdram-crt0.o sim-crt0.o simnovec-crt0.o simsdram-crt0.o crtn.o sim-crtn.o |
---|
62 | SIM_BSP = libsim.a |
---|
63 | LIBNOSYS = ../libnosys/libnosys.a |
---|
64 | SIM_OBJS = \ |
---|
65 | isatty.o \ |
---|
66 | sbrk.o \ |
---|
67 | syscalls.o \ |
---|
68 | mep-gmon.o \ |
---|
69 | mep-bb.o \ |
---|
70 | handlers.o \ |
---|
71 | h_reset.o \ |
---|
72 | read.o \ |
---|
73 | write.o |
---|
74 | |
---|
75 | #### Host specific Makefile fragment comes in here. |
---|
76 | @host_makefile_frag@ |
---|
77 | |
---|
78 | |
---|
79 | # Override .S.o rule to pass assembler debugging flags |
---|
80 | .S.o: |
---|
81 | $(CC) -Wa,-gdwarf2 -Wa,-I$(srcdir) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -c $< |
---|
82 | |
---|
83 | all: $(CRT) $(SIM_BSP) |
---|
84 | |
---|
85 | $(SIM_BSP): $(SIM_OBJS) |
---|
86 | $(AR) $(ARFLAGS) $@ $? |
---|
87 | $(RANLIB) $@ |
---|
88 | $(AR) $(ARFLAGS) $(LIBNOSYS) handlers.o h_reset.o |
---|
89 | $(RANLIB) $(LIBNOSYS) |
---|
90 | |
---|
91 | syscalls.o: $(srcdir)/syscalls.S |
---|
92 | sbrk.o: $(srcdir)/sbrk.c |
---|
93 | crt0.o: $(srcdir)/crt0.S $(srcdir)/sim-crt0.S |
---|
94 | sdram-crt0.o: $(srcdir)/sdram-crt0.S $(srcdir)/sim-crt0.S |
---|
95 | sim-crt0.o: $(srcdir)/sim-crt0.S |
---|
96 | simsdram-crt0.o: $(srcdir)/simsdram-crt0.S $(srcdir)/sim-crt0.S |
---|
97 | simnovec-crt0.o: $(srcdir)/simnovec-crt0.S $(srcdir)/sim-crt0.S |
---|
98 | crtn.o: $(srcdir)/crtn.S $(srcdir)/sim-crtn.S |
---|
99 | |
---|
100 | install: $(CRT) $(SIM_BSP) |
---|
101 | for c in $(CRT) $(SIM_BSP); do \ |
---|
102 | $(INSTALL_DATA) $$c $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$$c ;\ |
---|
103 | done |
---|
104 | if test -z "$(MULTISUBDIR)"; then \ |
---|
105 | for c in $(SCRIPTS); do \ |
---|
106 | $(INSTALL_DATA) $(srcdir)/$$c $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$$c ;\ |
---|
107 | done; \ |
---|
108 | $(INSTALL_DATA) $(srcdir)/gmap_default.ld $(DESTDIR)$(tooldir)/lib/gmap_default.tmpl; \ |
---|
109 | else true; fi |
---|
110 | |
---|
111 | clean mostlyclean: |
---|
112 | rm -f *.o *.a |
---|
113 | |
---|
114 | distclean maintainer-clean realclean: clean |
---|
115 | rm -f Makefile config.cache config.log config.status |
---|
116 | |
---|
117 | .PHONY: info dvi doc install-info clean-info |
---|
118 | info doc dvi: |
---|
119 | install-info: |
---|
120 | clean-info: |
---|
121 | |
---|
122 | Makefile: Makefile.in config.status @host_makefile_frag_path@ |
---|
123 | $(SHELL) config.status |
---|
124 | |
---|
125 | config.status: configure |
---|
126 | $(SHELL) config.status --recheck |
---|