]>
Commit | Line | Data |
---|---|---|
6a161fa9 | 1 | # -*- makefile -*- |
2 | # | |
3f6a10ef | 3 | # Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006,2007 Free Software Foundation, Inc. |
6a161fa9 | 4 | # |
5 | # This Makefile.in is free software; the author | |
6 | # gives unlimited permission to copy and/or distribute it, | |
7 | # with or without modifications, as long as this notice is preserved. | |
8 | # | |
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
11 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
12 | # PARTICULAR PURPOSE. | |
13 | ||
14 | ### The configure script will replace these variables. | |
15 | ||
16 | SHELL = /bin/sh | |
17 | ||
18 | @SET_MAKE@ | |
19 | ||
1d543c3e | 20 | transform = @program_transform_name@ |
21 | ||
6a161fa9 | 22 | srcdir = @srcdir@ |
68807e5f | 23 | builddir = @builddir@ |
6a161fa9 | 24 | top_srcdir = @top_srcdir@ |
25 | VPATH = @srcdir@ | |
26 | prefix = @prefix@ | |
27 | exec_prefix = @exec_prefix@ | |
28 | ||
29 | bindir = @bindir@ | |
30 | sbindir = @sbindir@ | |
31 | libexecdir = @libexecdir@ | |
3f6a10ef | 32 | datarootdir = @datarootdir@ |
6a161fa9 | 33 | datadir = @datadir@ |
34 | sysconfdir = @sysconfdir@ | |
35 | sharedstatedir = @sharedstatedir@ | |
36 | localstatedir = @localstatedir@ | |
37 | libdir = @libdir@ | |
38 | infodir = @infodir@ | |
39 | mandir = @mandir@ | |
40 | includedir = @includedir@ | |
1d543c3e | 41 | pkgdatadir = $(datadir)/`echo @PACKAGE_TARNAME@ | sed '$(transform)'` |
42 | pkglibdir = $(libdir)/`echo @PACKAGE_TARNAME@/$(target_cpu)-$(platform) | sed '$(transform)'` | |
6a161fa9 | 43 | |
44 | PACKAGE_NAME = @PACKAGE_NAME@ | |
45 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | |
46 | PACKAGE_VERSION = @PACKAGE_VERSION@ | |
47 | PACKAGE_STRING = @PACKAGE_STRING@ | |
48 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | |
49 | ||
b977bf01 | 50 | target_cpu = @target_cpu@ |
05568c2e | 51 | platform = @platform@ |
6a161fa9 | 52 | |
53 | INSTALL = @INSTALL@ | |
54 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
55 | INSTALL_DATA = @INSTALL_DATA@ | |
56 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | |
57 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | |
58 | ||
59 | mkinstalldirs = $(srcdir)/mkinstalldirs | |
60 | ||
61 | CC = @CC@ | |
62 | CFLAGS = @CFLAGS@ | |
ff04ec24 | 63 | LDFLAGS = @LDFLAGS@ |
b977bf01 | 64 | CPPFLAGS = @CPPFLAGS@ -I. -Iinclude -I$(srcdir)/include -Wall -W \ |
65 | -DGRUB_LIBDIR=\"$(pkglibdir)\" | |
66 | TARGET_CC = @TARGET_CC@ | |
67 | TARGET_CFLAGS = @TARGET_CFLAGS@ | |
68 | TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I. -Iinclude -I$(srcdir)/include \ | |
69 | -Wall -W | |
70 | TARGET_LDFLAGS = @TARGET_LDFLAGS@ | |
2a8a80e4 | 71 | TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@ |
72 | TARGET_IMG_LDFLAGS = @TARGET_IMG_LDFLAGS@ | |
73 | TARGET_OBJ2ELF = @TARGET_OBJ2ELF@ | |
cb71ba20 | 74 | MODULE_LDFLAGS = @MODULE_LDFLAGS@ |
2a8a80e4 | 75 | EXEEXT = @EXEEXT@ |
6a161fa9 | 76 | OBJCOPY = @OBJCOPY@ |
77 | STRIP = @STRIP@ | |
78 | NM = @NM@ | |
79 | RUBY = @RUBY@ | |
68807e5f | 80 | HELP2MAN = @HELP2MAN@ |
81 | ifeq (, $(HELP2MAN)) | |
82 | HELP2MAN = true | |
83 | else | |
84 | HELP2MAN := LANG=C $(HELP2MAN) --no-info --source=FSF | |
85 | endif | |
b977bf01 | 86 | AWK = @AWK@ |
f4917dfd | 87 | LIBCURSES = @LIBCURSES@ |
4ac9bd04 | 88 | LIBLZO = @LIBLZO@ |
144f1f98 | 89 | YACC = @YACC@ |
4931827f | 90 | UNIFONT_HEX = @UNIFONT_HEX@ |
6a161fa9 | 91 | |
4fe9862e | 92 | # Options. |
93 | enable_grub_emu = @enable_grub_emu@ | |
99fadbaa | 94 | enable_grub_fstest = @enable_grub_fstest@ |
aa24b516 | 95 | enable_lzo = @enable_lzo@ |
4fe9862e | 96 | |
6a161fa9 | 97 | ### General variables. |
98 | ||
233b1628 | 99 | RMKFILES = $(addprefix conf/,common.rmk i386-pc.rmk powerpc-ieee1275.rmk \ |
546f966a | 100 | sparc64-ieee1275.rmk i386-efi.rmk i386-ieee1275.rmk i386-coreboot.rmk) |
6a161fa9 | 101 | MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES)) |
102 | ||
4931827f | 103 | PKGLIB = $(pkglib_IMAGES) $(pkglib_MODULES) $(pkglib_PROGRAMS) \ |
104 | $(pkglib_DATA) $(lib_DATA) | |
105 | PKGDATA = $(pkgdata_DATA) | |
6a161fa9 | 106 | PROGRAMS = $(bin_UTILITIES) $(sbin_UTILITIES) |
7ee367e4 | 107 | SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(update-grub_SCRIPTS) |
6a161fa9 | 108 | |
109 | CLEANFILES = | |
110 | MOSTLYCLEANFILES = | |
111 | DISTCLEANFILES = config.status config.cache config.log config.h \ | |
7b455f4d | 112 | Makefile stamp-h include/grub/cpu include/grub/machine \ |
113 | gensymlist.sh genkernsyms.sh | |
6a161fa9 | 114 | MAINTAINER_CLEANFILES = $(srcdir)/configure $(addprefix $(srcdir)/,$(MKFILES)) |
115 | ||
116 | # The default target. | |
117 | all: all-local | |
118 | ||
119 | ### Include an arch-specific Makefile. | |
120 | $(addprefix $(srcdir)/,$(MKFILES)): %.mk: %.rmk genmk.rb | |
121 | if test "x$(RUBY)" = x; then \ | |
122 | touch $@; \ | |
123 | else \ | |
124 | $(RUBY) $(srcdir)/genmk.rb < $< > $@; \ | |
125 | fi | |
126 | ||
b977bf01 | 127 | include $(srcdir)/conf/$(target_cpu)-$(platform).mk |
6a161fa9 | 128 | |
129 | ### General targets. | |
130 | ||
4931827f | 131 | CLEANFILES += $(pkglib_DATA) $(pkgdata_DATA) |
58cd3d85 | 132 | pkglib_DATA += moddep.lst command.lst fs.lst partmap.lst |
b977bf01 | 133 | moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep.awk |
134 | cat $(DEFSYMFILES) /dev/null \ | |
135 | | $(AWK) -f $(srcdir)/genmoddep.awk $(UNDSYMFILES) > $@ \ | |
233b1628 | 136 | || (rm -f $@; exit 1) |
137 | ||
138 | command.lst: $(COMMANDFILES) | |
139 | cat $^ /dev/null | sort > $@ | |
140 | ||
141 | fs.lst: $(FSFILES) | |
142 | cat $^ /dev/null | sort > $@ | |
143 | ||
58cd3d85 | 144 | partmap.lst: $(PARTMAPFILES) |
145 | cat $^ /dev/null | sort > $@ | |
146 | ||
4931827f | 147 | ifeq (, $(UNIFONT_HEX)) |
148 | else | |
149 | pkgdata_DATA += unicode.pff ascii.pff | |
12ccdb75 | 150 | |
151 | # Arrows and lines are needed to draw the menu, so we always include them | |
152 | UNICODE_ARROWS=0x2190-0x2193 | |
153 | UNICODE_LINES=0x2501-0x251B | |
154 | ||
4931827f | 155 | unicode.pff: $(UNIFONT_HEX) |
156 | ruby $(srcdir)/util/unifont2pff.rb $(UNIFONT_HEX) > $@ | |
157 | ||
158 | ascii.pff: $(UNIFONT_HEX) | |
12ccdb75 | 159 | ruby $(srcdir)/util/unifont2pff.rb 0x0-0x7f $(UNICODE_ARROWS) $(UNICODE_LINES) $(UNIFONT_HEX) > $@ |
4931827f | 160 | endif |
161 | ||
162 | all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(MKFILES) | |
6a161fa9 | 163 | |
164 | install: install-local | |
165 | ||
166 | install-local: all | |
05568c2e | 167 | $(mkinstalldirs) $(DESTDIR)$(pkglibdir) |
4931827f | 168 | @list='$(PKGLIB)'; \ |
7b1f4b57 | 169 | for file in $$list; do \ |
da65cb36 | 170 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ |
6a161fa9 | 171 | dest="`echo $$file | sed 's,.*/,,'`"; \ |
05568c2e | 172 | $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkglibdir)/$$dest; \ |
6a161fa9 | 173 | done |
4931827f | 174 | $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) |
175 | @list='$(PKGDATA)'; \ | |
176 | for file in $$list; do \ | |
177 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ | |
178 | dest="`echo $$file | sed 's,.*/,,'`"; \ | |
179 | $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkgdatadir)/$$dest; \ | |
180 | done | |
68807e5f | 181 | $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 |
6a161fa9 | 182 | @list='$(bin_UTILITIES)'; for file in $$list; do \ |
da65cb36 | 183 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ |
1d543c3e | 184 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ |
6a161fa9 | 185 | $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \ |
68807e5f | 186 | $(HELP2MAN) --section=1 $(builddir)/$$file > $(DESTDIR)$(mandir)/man1/$$dest.1; \ |
6a161fa9 | 187 | done |
68807e5f | 188 | $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8 |
1cc73a62 | 189 | @list='$(sbin_UTILITIES)'; for file in $$list; do \ |
da65cb36 | 190 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ |
1d543c3e | 191 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ |
1cc73a62 | 192 | $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \ |
68807e5f | 193 | $(HELP2MAN) --section=8 $(builddir)/$$file > $(DESTDIR)$(mandir)/man8/$$dest.8; \ |
1cc73a62 | 194 | done |
7ee367e4 | 195 | @list='$(bin_SCRIPTS)'; for file in $$list; do \ |
196 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ | |
197 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ | |
198 | $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \ | |
68807e5f | 199 | $(HELP2MAN) --section=1 $(builddir)/$$file > $(DESTDIR)$(mandir)/man1/$$dest.1; \ |
7ee367e4 | 200 | done |
075a1650 | 201 | @list='$(sbin_SCRIPTS)'; for file in $$list; do \ |
da65cb36 | 202 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ |
1d543c3e | 203 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ |
075a1650 | 204 | $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \ |
68807e5f | 205 | $(HELP2MAN) --section=8 $(builddir)/$$file > $(DESTDIR)$(mandir)/man8/$$dest.8; \ |
075a1650 | 206 | done |
ebd97f6e | 207 | $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/grub.d |
208 | @list='$(update-grub_SCRIPTS)'; for file in $$list; do \ | |
da65cb36 | 209 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ |
ebd97f6e | 210 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ |
211 | $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \ | |
212 | done | |
213 | @list='$(update-grub_DATA)'; for file in $$list; do \ | |
da65cb36 | 214 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ |
ebd97f6e | 215 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ |
216 | $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \ | |
217 | done | |
42c71976 | 218 | $(mkinstalldirs) $(DESTDIR)$(libdir)/grub |
219 | @list='$(lib_DATA)'; \ | |
220 | for file in $$list; do \ | |
221 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ | |
222 | dest="`echo $$file | sed 's,.*/,,'`"; \ | |
223 | $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(libdir)/grub/$$dest; \ | |
224 | done | |
6a161fa9 | 225 | |
226 | install-strip: | |
227 | $(MAKE) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" install | |
228 | ||
229 | uninstall: | |
4931827f | 230 | @list='$(PKGLIB)'; \ |
0058f771 | 231 | for file in $$list; do \ |
6a161fa9 | 232 | dest="`echo $$file | sed 's,.*/,,'`"; \ |
05568c2e | 233 | rm -f $(DESTDIR)$(pkglibdir)/$$dest; \ |
6a161fa9 | 234 | done |
4931827f | 235 | @list='$(PKGDATA)'; \ |
236 | for file in $$list; do \ | |
237 | dest="`echo $$file | sed 's,.*/,,'`"; \ | |
238 | rm -f $(DESTDIR)$(pkgdatadir)/$$dest; \ | |
239 | done | |
7ee367e4 | 240 | @list='$(bin_UTILITIES) $(bin_SCRIPTS)'; for file in $$list; do \ |
1d543c3e | 241 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ |
6a161fa9 | 242 | rm -f $(DESTDIR)$(bindir)/$$dest; \ |
243 | done | |
075a1650 | 244 | @list='$(sbin_UTILITIES) $(sbin_SCRIPTS)'; for file in $$list; do \ |
1d543c3e | 245 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ |
1cc73a62 | 246 | rm -f $(DESTDIR)$(sbindir)/$$dest; \ |
247 | done | |
7076340d | 248 | @list='$(update-grub_SCRIPTS) $(update-grub_DATA)'; for file in $$list; do \ |
249 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ | |
250 | rm -f $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \ | |
251 | done | |
6a161fa9 | 252 | |
253 | clean: | |
254 | -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) | |
255 | ||
256 | mostlyclean: clean | |
257 | -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) | |
258 | ||
259 | distclean: mostlyclean | |
260 | -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) | |
261 | -rm -rf $(srcdir)/autom4te.cache | |
262 | ||
263 | maintainer-clean: distclean | |
264 | -test -z "$(MAINTAINER_CLEANFILES)" || rm -f $(MAINTAINER_CLEANFILES) | |
265 | ||
266 | info: | |
267 | ||
268 | dvi: | |
269 | ||
270 | distdir=$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) | |
271 | ||
0058f771 | 272 | DISTLIST: gendistlist.sh |
273 | sh $(srcdir)/gendistlist.sh > $(srcdir)/DISTLIST | |
274 | ||
275 | distdir: DISTLIST | |
6a161fa9 | 276 | -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) |
277 | $(mkinstalldirs) $(distdir) | |
0058f771 | 278 | for i in `cat $(srcdir)/DISTLIST`; do \ |
6a161fa9 | 279 | dir=`echo "$$i" | sed 's:/[^/]*$$::'`; \ |
280 | if test -d $(srcdir)/$$dir; then \ | |
281 | $(mkinstalldirs) $(distdir)/$$dir; \ | |
282 | fi; \ | |
283 | cp -p $(srcdir)/$$i $(distdir)/$$i || exit 1; \ | |
284 | done | |
285 | chmod -R a+r $(distdir) | |
286 | ||
287 | GZIP_ENV = --best | |
288 | ||
289 | dist: distdir | |
290 | tar chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz | |
291 | -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) | |
292 | ||
293 | distcheck: dist | |
294 | -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) | |
295 | GZIP=$(GZIP_ENV) gzip -cd $(distdir).tar.gz | tar xf - | |
296 | chmod -R a-w $(distdir) | |
297 | chmod a+w $(distdir) | |
298 | mkdir $(distdir)/=build | |
299 | mkdir $(distdir)/=inst | |
300 | chmod a-w $(distdir) | |
301 | dc_instdir=`CDPATH=: && cd $(distdir)/=inst && pwd` \ | |
302 | && cd $(distdir)/=build \ | |
303 | && ../configure --srcdir=.. --prefix=$$dc_instdir \ | |
7076340d | 304 | && $(MAKE) all dvi check install && $(MAKE) uninstall \ |
6a161fa9 | 305 | && (test `find $$dc_instdir -type f -print | wc -l` -le 1 \ |
306 | || (echo "Error: files left after uninstall" 1>&2; \ | |
307 | exit 1)) \ | |
7076340d | 308 | && $(MAKE) dist && $(MAKE) distclean \ |
6a161fa9 | 309 | && rm -f $(distdir).tar.gz \ |
310 | && (test `find . -type f -print | wc -l` -eq 0 \ | |
311 | || (echo "Error: files left after distclean" 1>&2; \ | |
312 | exit 1)) | |
313 | -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) | |
314 | @echo "$(distdir).tar.gz is ready for distribution" | \ | |
315 | sed 'h;s/./=/g;p;x;p;x' | |
316 | ||
317 | check: | |
318 | ||
319 | .SUFFIX: | |
320 | .SUFFIX: .c .o .S .d | |
321 | ||
322 | # Regenerate configure and Makefile automatically. | |
323 | $(srcdir)/configure: configure.ac aclocal.m4 | |
324 | cd $(srcdir) && autoconf | |
325 | ||
326 | $(srcdir)/config.h.in: stamp-h.in | |
327 | $(srcdir)/stamp-h.in: configure.ac aclocal.m4 | |
328 | cd $(srcdir) && autoheader | |
329 | echo timestamp > $(srcdir)/stamp-h.in | |
330 | ||
331 | config.h: stamp-h | |
332 | stamp-h: config.h.in config.status | |
333 | ./config.status | |
334 | ||
335 | Makefile: Makefile.in config.status | |
336 | ./config.status | |
337 | ||
338 | config.status: configure | |
339 | ./config.status --recheck | |
340 | ||
7b455f4d | 341 | gensymlist.sh: gensymlist.sh.in config.status |
342 | ./config.status | |
343 | ||
344 | genkernsyms.sh: genkernsyms.sh.in config.status | |
345 | ./config.status | |
346 | ||
6a161fa9 | 347 | .PHONY: all install install-strip uninstall clean mostlyclean distclean |
348 | .PHONY: maintainer-clean info dvi dist check | |
349 | ||
350 | # Prevent an overflow. | |
351 | .NOEXPORT: | |
233b1628 | 352 | |
353 | .DELETE_ON_ERROR: |