1 | # Copyright (c) 1995, 1996, 1997 Cygnus Support |
---|
2 | # Copyright (c) 1999, 2000, 2001, 2002 Stephane Carrez |
---|
3 | # |
---|
4 | # The authors hereby grant permission to use, copy, modify, distribute, |
---|
5 | # and license this software and its documentation for any purpose, provided |
---|
6 | # that existing copyright notices are retained in all copies and that this |
---|
7 | # notice is included verbatim in any distributions. No written agreement, |
---|
8 | # license, or royalty fee is required for any of the authorized uses. |
---|
9 | # Modifications to this software may be copyrighted by their authors |
---|
10 | # and need not follow the licensing terms described here, provided that |
---|
11 | # the new terms are clearly indicated on the first page of each file where |
---|
12 | # they apply. |
---|
13 | # |
---|
14 | # This currently works with Motorola's 68HC11 based target boards. |
---|
15 | # (should work with 68HC12 but not tested yet) |
---|
16 | |
---|
17 | DESTDIR = |
---|
18 | srcdir = @srcdir@ |
---|
19 | objdir = . |
---|
20 | srcroot = $(srcdir)/../.. |
---|
21 | objroot = $(objdir)/../.. |
---|
22 | |
---|
23 | VPATH = $(srcdir) $(srcdir)/.. |
---|
24 | |
---|
25 | prefix = @prefix@ |
---|
26 | exec_prefix = @exec_prefix@ |
---|
27 | |
---|
28 | host_alias = @host_alias@ |
---|
29 | target_alias = @target_alias@ |
---|
30 | program_transform_name = @program_transform_name@ |
---|
31 | |
---|
32 | bindir = @bindir@ |
---|
33 | libdir = @libdir@ |
---|
34 | tooldir = $(exec_prefix)/$(target_alias) |
---|
35 | |
---|
36 | # Multilib support variables. |
---|
37 | # TOP is used instead of MULTI{BUILD,SRC}TOP. |
---|
38 | MULTIDIRS = |
---|
39 | MULTISUBDIR = |
---|
40 | MULTIDO = true |
---|
41 | MULTICLEAN = true |
---|
42 | |
---|
43 | INSTALL = @INSTALL@ |
---|
44 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
---|
45 | INSTALL_DATA = @INSTALL_DATA@ |
---|
46 | |
---|
47 | SHELL = /bin/sh |
---|
48 | |
---|
49 | CC = @CC@ |
---|
50 | |
---|
51 | AS = @AS@ |
---|
52 | AR = @AR@ |
---|
53 | LD = @LD@ |
---|
54 | RANLIB = @RANLIB@ |
---|
55 | AR_FLAGS = qv |
---|
56 | |
---|
57 | OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \ |
---|
58 | then echo ${objroot}/../binutils/objdump ; \ |
---|
59 | else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi` |
---|
60 | OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \ |
---|
61 | then echo ${objroot}/../binutils/objcopy ; \ |
---|
62 | else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi` |
---|
63 | |
---|
64 | SCRIPTS = sim-valid |
---|
65 | |
---|
66 | OBJS = syscalls.o close.o fstat.o getpid.o isatty.o kill.o \ |
---|
67 | lseek.o open.o print.o stat.o \ |
---|
68 | unlink.o sci-inout.o |
---|
69 | |
---|
70 | CFLAGS = |
---|
71 | |
---|
72 | CRT0 = crt0.o |
---|
73 | |
---|
74 | # |
---|
75 | # here's all the generic target stuff |
---|
76 | # |
---|
77 | GEN_LDFLAGS= -L${srcdir} |
---|
78 | BSP= libbcc.a |
---|
79 | |
---|
80 | # Host specific makefile fragment comes in here. |
---|
81 | @host_makefile_frag@ |
---|
82 | |
---|
83 | # |
---|
84 | # build a test program for each target board. Just trying to get |
---|
85 | # it to link is a good test, so we ignore all the errors for now. |
---|
86 | # |
---|
87 | all: ${CRT0} ${BSP} |
---|
88 | |
---|
89 | # |
---|
90 | # here's where we build the board support packages for each target |
---|
91 | # |
---|
92 | ${BSP}: $(OBJS) |
---|
93 | ${AR} ${ARFLAGS} $@ $(OBJS) |
---|
94 | ${RANLIB} $@ |
---|
95 | |
---|
96 | |
---|
97 | syscalls.o: $(srcdir)/syscalls.c |
---|
98 | $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< |
---|
99 | |
---|
100 | close.o: $(srcdir)/../close.c |
---|
101 | $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< |
---|
102 | |
---|
103 | fstat.o: $(srcdir)/../fstat.c |
---|
104 | $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< |
---|
105 | |
---|
106 | getpid.o: $(srcdir)/../getpid.c |
---|
107 | $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< |
---|
108 | |
---|
109 | isatty.o: $(srcdir)/../isatty.c |
---|
110 | $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< |
---|
111 | |
---|
112 | kill.o: $(srcdir)/../kill.c |
---|
113 | $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< |
---|
114 | |
---|
115 | lseek.o: $(srcdir)/../lseek.c |
---|
116 | $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< |
---|
117 | |
---|
118 | open.o: $(srcdir)/../open.c |
---|
119 | $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< |
---|
120 | |
---|
121 | print.o: $(srcdir)/../print.c |
---|
122 | $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< |
---|
123 | |
---|
124 | putnum.o: $(srcdir)/../putnum.c |
---|
125 | $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< |
---|
126 | |
---|
127 | stat.o: $(srcdir)/../stat.c |
---|
128 | $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< |
---|
129 | |
---|
130 | unlink.o: $(srcdir)/../unlink.c |
---|
131 | $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< |
---|
132 | |
---|
133 | |
---|
134 | .PHONY: install info dvi doc install-info clean-info |
---|
135 | |
---|
136 | clean mostlyclean: |
---|
137 | rm -f a.out core *.[oais] *-test *.srec *.dis *.x syscall.h |
---|
138 | |
---|
139 | distclean maintainer-clean realclean: clean |
---|
140 | rm -f Makefile config.status *~ |
---|
141 | |
---|
142 | .PHONY: install info install-info clean-info |
---|
143 | install: install-scripts |
---|
144 | $(INSTALL_PROGRAM) $(CRT0) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(CRT0) |
---|
145 | @for bsp in ${BSP}; do\ |
---|
146 | $(INSTALL_PROGRAM) $${bsp} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \ |
---|
147 | done |
---|
148 | |
---|
149 | # Install the linker script in the correct place. |
---|
150 | install-scripts: |
---|
151 | if [ -f ${objroot}/../binutils/objdump ] ; then \ |
---|
152 | objdump="${objroot}/../binutils/objdump"; \ |
---|
153 | else \ |
---|
154 | t='$(program_transform_name)'; \ |
---|
155 | objdump=`echo objdump | sed -e $$t`; \ |
---|
156 | fi ; \ |
---|
157 | name=`$$objdump -f $(CRT0) | sed '/^$$/d'`; \ |
---|
158 | case $$name in \ |
---|
159 | *elf32-m68hc11*) \ |
---|
160 | $(INSTALL_DATA) ${srcdir}/sim-valid-m68hc11.ld $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/sim-valid.ld \ |
---|
161 | ;; \ |
---|
162 | *elf32-m68hc12*) \ |
---|
163 | $(INSTALL_DATA) ${srcdir}/sim-valid-m68hc12.ld $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/sim-valid.ld \ |
---|
164 | ;; \ |
---|
165 | esac |
---|
166 | |
---|
167 | doc: |
---|
168 | info: |
---|
169 | install-info: |
---|
170 | clean-info: |
---|
171 | |
---|
172 | Makefile: Makefile.in config.status @host_makefile_frag_path@ |
---|
173 | $(SHELL) config.status |
---|
174 | |
---|
175 | config.status: configure |
---|
176 | $(SHELL) config.status --recheck |
---|