]>
Commit | Line | Data |
---|---|---|
6a161fa9 | 1 | # -*- makefile -*- |
2 | # | |
2f1a3acf | 3 | # Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2010 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 | |
2f1a3acf YB |
44 | # Internationalization library. |
45 | LIBINTL = @LIBINTL@ | |
46 | ||
8c37c91f RM |
47 | XGETTEXT = @XGETTEXT@ |
48 | MSGMERGE = @MSGMERGE@ | |
49 | MSGFMT = @MSGFMT@ | |
50 | ||
3bc7896c RM |
51 | LINGUAS = $(shell for i in $(srcdir)/po/*.po ; do \ |
52 | if test -e $$i ; then echo $$i ; fi ; \ | |
53 | done | sed -e "s,.*/po/\(.*\)\.po$$,\1,") | |
ed101e81 | 54 | |
37fb845b | 55 | PACKAGE = @PACKAGE@ |
6a161fa9 | 56 | PACKAGE_NAME = @PACKAGE_NAME@ |
57 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | |
58 | PACKAGE_VERSION = @PACKAGE_VERSION@ | |
59 | PACKAGE_STRING = @PACKAGE_STRING@ | |
60 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | |
61 | ||
56978920 | 62 | host_os = @host_os@ |
9304eef1 | 63 | host_kernel = @host_kernel@ |
56978920 | 64 | host_cpu = @host_cpu@ |
65 | ||
b977bf01 | 66 | target_cpu = @target_cpu@ |
05568c2e | 67 | platform = @platform@ |
6a161fa9 | 68 | |
69 | INSTALL = @INSTALL@ | |
70 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
71 | INSTALL_DATA = @INSTALL_DATA@ | |
72 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | |
73 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | |
ff420223 | 74 | MKDIR_P = @MKDIR_P@ |
6a161fa9 | 75 | |
76 | mkinstalldirs = $(srcdir)/mkinstalldirs | |
77 | ||
2f1a3acf YB |
78 | LIBS = @LIBS@ $(LIBINTL) |
79 | ||
6a161fa9 | 80 | CC = @CC@ |
81 | CFLAGS = @CFLAGS@ | |
3506b90b | 82 | GNULIB_CFLAGS = -Wno-undef -D_GL_UNUSED="__attribute__ ((unused))" |
2b167a72 | 83 | ASFLAGS = @ASFLAGS@ |
2f1a3acf | 84 | LDFLAGS = @LDFLAGS@ $(LIBS) |
ab502ec5 | 85 | CPPFLAGS = @CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/gnulib -I$(srcdir)/include -Wall -W \ |
336262f8 | 86 | -DGRUB_LIBDIR=\"$(pkglibdir)\" -DLOCALEDIR=\"$(localedir)\" |
b977bf01 | 87 | TARGET_CC = @TARGET_CC@ |
5c2ee771 VS |
88 | TARGET_CFLAGS = -ffreestanding @TARGET_CFLAGS@ |
89 | TARGET_ASFLAGS = -nostdinc -fno-builtin @TARGET_ASFLAGS@ | |
2b167a72 | 90 | TARGET_MODULE_FORMAT = @TARGET_MODULE_FORMAT@ |
91 | TARGET_APPLE_CC = @TARGET_APPLE_CC@ | |
92 | OBJCONV = @OBJCONV@ | |
8f9a632b | 93 | TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I$(srcdir)/include -I$(builddir) -I$(builddir)/include \ |
b977bf01 | 94 | -Wall -W |
5c2ee771 | 95 | TARGET_LDFLAGS = -nostdlib @TARGET_LDFLAGS@ |
2a8a80e4 | 96 | TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@ |
5c2ee771 | 97 | TARGET_IMG_LDFLAGS = -nostdlib @TARGET_IMG_LDFLAGS@ |
2b167a72 | 98 | TARGET_IMG_CFLAGS = @TARGET_IMG_CFLAGS@ |
2a8a80e4 | 99 | TARGET_OBJ2ELF = @TARGET_OBJ2ELF@ |
2a8a80e4 | 100 | EXEEXT = @EXEEXT@ |
6a161fa9 | 101 | OBJCOPY = @OBJCOPY@ |
102 | STRIP = @STRIP@ | |
103 | NM = @NM@ | |
104 | RUBY = @RUBY@ | |
c44c90db | 105 | MAKEINFO = @MAKEINFO@ |
106 | ifeq (, $(MAKEINFO)) | |
107 | MAKEINFO = true | |
108 | endif | |
68807e5f | 109 | HELP2MAN = @HELP2MAN@ |
110 | ifeq (, $(HELP2MAN)) | |
111 | HELP2MAN = true | |
112 | else | |
113 | HELP2MAN := LANG=C $(HELP2MAN) --no-info --source=FSF | |
114 | endif | |
b977bf01 | 115 | AWK = @AWK@ |
f4917dfd | 116 | LIBCURSES = @LIBCURSES@ |
94414221 | 117 | LIBUSB = @LIBUSB@ |
927d0134 | 118 | LIBSDL = @LIBSDL@ |
459fed4b | 119 | LIBPCIACCESS = @LIBPCIACCESS@ |
144f1f98 | 120 | YACC = @YACC@ |
6c09890c | 121 | FONT_SOURCE = @FONT_SOURCE@ |
6a161fa9 | 122 | |
4fe9862e | 123 | # Options. |
d64399b5 | 124 | enable_grub_emu_usb = @enable_grub_emu_usb@ |
927d0134 | 125 | enable_grub_emu_sdl = @enable_grub_emu_sdl@ |
3affd0ec | 126 | enable_grub_emu_pci = @enable_grub_emu_pci@ |
99fadbaa | 127 | enable_grub_fstest = @enable_grub_fstest@ |
2d05bc6a | 128 | enable_grub_pe2elf = @enable_grub_pe2elf@ |
e52db1f7 | 129 | enable_grub_mkfont = @enable_grub_mkfont@ |
130 | freetype_cflags = @freetype_cflags@ | |
131 | freetype_libs = @freetype_libs@ | |
fc45fb58 | 132 | enable_efiemu = @enable_efiemu@ |
4fe9862e | 133 | |
6a161fa9 | 134 | ### General variables. |
135 | ||
0579b753 | 136 | RMKFILES = $(wildcard conf/*.rmk) |
040030b3 | 137 | |
6a161fa9 | 138 | MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES)) |
139 | ||
4931827f | 140 | PKGLIB = $(pkglib_IMAGES) $(pkglib_MODULES) $(pkglib_PROGRAMS) \ |
ca0388f0 | 141 | $(pkglib_DATA) $(pkglib_BUILDDIR) |
e40893c3 | 142 | PKGDATA = $(pkgdata_DATA) |
6a161fa9 | 143 | PROGRAMS = $(bin_UTILITIES) $(sbin_UTILITIES) |
ca0388f0 | 144 | SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(grub-mkconfig_SCRIPTS) \ |
145 | $(lib_SCRIPTS) | |
c44c90db | 146 | INFOS = $(info_INFOS) |
6a161fa9 | 147 | |
148 | CLEANFILES = | |
b39f9d20 | 149 | MOSTLYCLEANFILES = |
6a161fa9 | 150 | DISTCLEANFILES = config.status config.cache config.log config.h \ |
b4b7be98 | 151 | Makefile stamp-h stamp-h1 include/grub/cpu include/grub/machine \ |
1a0f7f45 RM |
152 | gensymlist.sh genkernsyms.sh build_env.mk \ |
153 | docs/grub.info docs/version.texi docs/stamp-vti | |
154 | ||
9a86f1ec | 155 | MAINTAINER_CLEANFILES = $(srcdir)/configure $(addprefix $(srcdir)/,$(MKFILES)) \ |
c44c90db | 156 | $(srcdir)/DISTLIST $(srcdir)/config.h.in $(srcdir)/stamp-h.in $(INFOS) |
6a161fa9 | 157 | |
158 | # The default target. | |
159 | all: all-local | |
160 | ||
161 | ### Include an arch-specific Makefile. | |
162 | $(addprefix $(srcdir)/,$(MKFILES)): %.mk: %.rmk genmk.rb | |
163 | if test "x$(RUBY)" = x; then \ | |
164 | touch $@; \ | |
165 | else \ | |
166 | $(RUBY) $(srcdir)/genmk.rb < $< > $@; \ | |
167 | fi | |
168 | ||
f84b481b RM |
169 | ifeq ($(platform), emu) |
170 | include $(srcdir)/conf/any-emu.mk | |
171 | else | |
b977bf01 | 172 | include $(srcdir)/conf/$(target_cpu)-$(platform).mk |
6fc804ff BC |
173 | # For tests. |
174 | include $(srcdir)/conf/tests.mk | |
cefabfe1 | 175 | # For external modules. |
176 | -include $(wildcard $(GRUB_CONTRIB)/*/conf/common.mk) | |
11d9778b | 177 | endif |
cefabfe1 | 178 | |
6a161fa9 | 179 | ### General targets. |
180 | ||
ed101e81 | 181 | CLEANFILES += $(pkglib_DATA) $(pkgdata_DATA) po/*.mo |
19987ffa | 182 | ifneq ($(platform), emu) |
ceb294b7 | 183 | pkglib_DATA += moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst |
19987ffa | 184 | endif |
b977bf01 | 185 | moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep.awk |
186 | cat $(DEFSYMFILES) /dev/null \ | |
187 | | $(AWK) -f $(srcdir)/genmoddep.awk $(UNDSYMFILES) > $@ \ | |
233b1628 | 188 | || (rm -f $@; exit 1) |
189 | ||
190 | command.lst: $(COMMANDFILES) | |
191 | cat $^ /dev/null | sort > $@ | |
192 | ||
193 | fs.lst: $(FSFILES) | |
194 | cat $^ /dev/null | sort > $@ | |
195 | ||
58cd3d85 | 196 | partmap.lst: $(PARTMAPFILES) |
197 | cat $^ /dev/null | sort > $@ | |
198 | ||
d05f0df3 | 199 | handler.lst: $(HANDLERFILES) |
200 | cat $^ /dev/null | sort > $@ | |
201 | ||
33c1ed4c VS |
202 | terminal.lst: $(TERMINALFILES) |
203 | cat $^ /dev/null | sort > $@ | |
204 | ||
e4343593 | 205 | parttool.lst: $(PARTTOOLFILES) |
206 | cat $^ /dev/null | sort | uniq > $@ | |
207 | ||
dc0c71d9 RM |
208 | video.lst: $(VIDEOFILES) |
209 | cat $^ /dev/null | sort | uniq > $@ | |
210 | ||
7316783f VS |
211 | crypto.lst: lib/libgcrypt-grub/cipher/crypto.lst |
212 | cp $^ $@ | |
213 | ||
83b65c4a | 214 | ifneq (true, $(MAKEINFO)) |
c44c90db | 215 | info_INFOS += docs/grub.info |
83b65c4a | 216 | endif |
c44c90db | 217 | |
218 | MOSTLYCLEANFILES += vti.tmp | |
219 | MAINTAINER_CLEANFILES += docs/stamp-vti docs/version.texi | |
220 | docs/version.texi: docs/stamp-vti | |
186e7cf2 | 221 | docs/stamp-vti: docs/grub.texi configure.ac |
ff420223 | 222 | $(MKDIR_P) docs |
c44c90db | 223 | (set `$(SHELL) $(srcdir)/docs/mdate-sh $<`; \ |
224 | echo "@set UPDATED $$1 $$2 $$3"; \ | |
225 | echo "@set UPDATED-MONTH $$2 $$3"; \ | |
226 | echo "@set EDITION $(PACKAGE_VERSION)"; \ | |
227 | echo "@set VERSION $(PACKAGE_VERSION)") > vti.tmp | |
ff420223 | 228 | @cmp -s vti.tmp $(builddir)/docs/version.texi \ |
229 | || (echo "Updating $(builddir)/docs/version.texi"; \ | |
230 | cp vti.tmp $(builddir)/docs/version.texi) | |
c44c90db | 231 | -@rm -f vti.tmp |
ff420223 | 232 | @cp $(builddir)/docs/version.texi $@ |
c44c90db | 233 | |
234 | # Use --force until such time as the documentation is cleaned up. | |
235 | docs/grub.info: docs/grub.texi docs/version.texi docs/fdl.texi | |
ff420223 | 236 | $(MKDIR_P) docs |
5947ae32 | 237 | -$(MAKEINFO) -P $(builddir)/docs --no-split --force $< -o $@ |
c44c90db | 238 | |
6c09890c | 239 | ifeq (, $(FONT_SOURCE)) |
4931827f | 240 | else |
4fa80998 | 241 | |
242 | ifeq ($(enable_grub_mkfont),yes) | |
243 | ||
b4f58b4a | 244 | pkgdata_DATA += unicode.pf2 ascii.pf2 ascii.h |
c0ee0385 | 245 | CLEANFILES += ascii.bitmaps |
12ccdb75 | 246 | |
247 | # Arrows and lines are needed to draw the menu, so we always include them | |
248 | UNICODE_ARROWS=0x2190-0x2193 | |
249 | UNICODE_LINES=0x2501-0x251B | |
250 | ||
6c09890c FZ |
251 | unicode.pf2: $(FONT_SOURCE) grub-mkfont |
252 | $(builddir)/grub-mkfont -o $@ $(FONT_SOURCE) | |
1e901a75 | 253 | |
6c09890c FZ |
254 | ascii.pf2: $(FONT_SOURCE) grub-mkfont |
255 | $(builddir)/grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES) | |
26ba5c22 | 256 | |
b4f58b4a | 257 | ascii.bitmaps: $(FONT_SOURCE) grub-mkfont |
26ba5c22 | 258 | $(builddir)/grub-mkfont --ascii-bitmaps -o $@ $(FONT_SOURCE) |
259 | ||
b4f58b4a RM |
260 | ascii.h: ascii.bitmaps grub-bin2h |
261 | $(builddir)/grub-bin2h ascii_bitmaps < $< > $@ | |
bd719e5a | 262 | |
263 | TARGET_CFLAGS += -DUSE_ASCII_FAILBACK=1 | |
4fa80998 | 264 | endif |
4931827f | 265 | endif |
266 | ||
37c86336 | 267 | # Used for building modules externally |
268 | pkglib_BUILDDIR += build_env.mk | |
269 | build_env.mk: Makefile | |
270 | (\ | |
271 | echo "TARGET_CC=$(TARGET_CC)" ; \ | |
272 | echo "TARGET_CFLAGS=$(TARGET_CFLAGS)" ; \ | |
2b167a72 | 273 | echo "TARGET_ASFLAGS=$(TARGET_ASFLAGS)" ; \ |
274 | echo "TARGET_CPPFLAGS=$(TARGET_CPPFLAGS) -I$(pkglibdir) -I$(includedir)" ; \ | |
37c86336 | 275 | echo "STRIP=$(STRIP)" ; \ |
2b167a72 | 276 | echo "OBJCONV=$(OBJCONV)" ; \ |
277 | echo "TARGET_MODULE_FORMAT=$(TARGET_MODULE_FORMAT)" ; \ | |
278 | echo "TARGET_APPLE_CC=$(TARGET_APPLE_CC)" ; \ | |
37c86336 | 279 | echo "COMMON_ASFLAGS=$(COMMON_ASFLAGS)" ; \ |
280 | echo "COMMON_CFLAGS=$(COMMON_CFLAGS)" ; \ | |
281 | echo "COMMON_LDFLAGS=$(COMMON_LDFLAGS)"\ | |
282 | ) > $@ | |
283 | pkglib_BUILDDIR += config.h grub_script.tab.h | |
37c86336 | 284 | |
19987ffa | 285 | all-local: $(PROGRAMS) $(GRUB_EMU) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(INFOS) $(MKFILES) $(foreach lang, $(LINGUAS), po/$(lang).mo) |
6a161fa9 | 286 | |
287 | install: install-local | |
288 | ||
289 | install-local: all | |
c1cb63ba | 290 | $(SHELL) $(mkinstalldirs) $(DESTDIR)$(pkglibdir) |
7a9094e5 | 291 | rm -f $(DESTDIR)$(pkglibdir)/* |
4931827f | 292 | @list='$(PKGLIB)'; \ |
7b1f4b57 | 293 | for file in $$list; do \ |
da65cb36 | 294 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ |
6a161fa9 | 295 | dest="`echo $$file | sed 's,.*/,,'`"; \ |
05568c2e | 296 | $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkglibdir)/$$dest; \ |
6a161fa9 | 297 | done |
c1cb63ba | 298 | $(SHELL) $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) |
4931827f | 299 | @list='$(PKGDATA)'; \ |
300 | for file in $$list; do \ | |
301 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ | |
302 | dest="`echo $$file | sed 's,.*/,,'`"; \ | |
303 | $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkgdatadir)/$$dest; \ | |
304 | done | |
c1cb63ba | 305 | $(SHELL) $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 |
19987ffa | 306 | @list='$(bin_UTILITIES) $(GRUB_EMU)'; for file in $$list; do \ |
da65cb36 | 307 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ |
1d543c3e | 308 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ |
6a161fa9 | 309 | $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \ |
4006f85c | 310 | $(HELP2MAN) --section=1 -o $(DESTDIR)$(mandir)/man1/$$dest.1 $(builddir)/$$file; \ |
6a161fa9 | 311 | done |
c1cb63ba | 312 | $(SHELL) $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8 |
1cc73a62 | 313 | @list='$(sbin_UTILITIES)'; for file in $$list; do \ |
da65cb36 | 314 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ |
1d543c3e | 315 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ |
1cc73a62 | 316 | $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \ |
4006f85c | 317 | $(HELP2MAN) --section=8 -o $(DESTDIR)$(mandir)/man8/$$dest.8 $(builddir)/$$file; \ |
1cc73a62 | 318 | done |
7ee367e4 | 319 | @list='$(bin_SCRIPTS)'; for file in $$list; do \ |
320 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ | |
321 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ | |
322 | $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \ | |
4006f85c | 323 | $(HELP2MAN) --section=1 -o $(DESTDIR)$(mandir)/man1/$$dest.1 $(builddir)/$$file; \ |
7ee367e4 | 324 | done |
075a1650 | 325 | @list='$(sbin_SCRIPTS)'; for file in $$list; do \ |
da65cb36 | 326 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ |
1d543c3e | 327 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ |
075a1650 | 328 | $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \ |
4006f85c | 329 | $(HELP2MAN) --section=8 -o $(DESTDIR)$(mandir)/man8/$$dest.8 $(builddir)/$$file; \ |
075a1650 | 330 | done |
c1cb63ba | 331 | $(SHELL) $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/grub.d |
18ade780 | 332 | @list='$(grub-mkconfig_SCRIPTS)'; for file in $$list; do \ |
da65cb36 | 333 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ |
ebd97f6e | 334 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ |
335 | $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \ | |
336 | done | |
18ade780 | 337 | @list='$(grub-mkconfig_DATA)'; for file in $$list; do \ |
da65cb36 | 338 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ |
ebd97f6e | 339 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ |
340 | $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \ | |
341 | done | |
c1cb63ba | 342 | $(SHELL) $(mkinstalldirs) $(DESTDIR)$(libdir)/grub |
ca0388f0 | 343 | @list='$(lib_SCRIPTS)'; \ |
42c71976 | 344 | for file in $$list; do \ |
345 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ | |
346 | dest="`echo $$file | sed 's,.*/,,'`"; \ | |
347 | $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(libdir)/grub/$$dest; \ | |
348 | done | |
8e2532fd FZ |
349 | @langs='$(LINGUAS)'; \ |
350 | for lang in $$langs; do \ | |
bee48093 FZ |
351 | $(SHELL) $(mkinstalldirs) $(DESTDIR)/$(datadir)/locale/$$lang/LC_MESSAGES; \ |
352 | file="po/$$lang.mo"; \ | |
353 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ | |
354 | $(INSTALL_DATA) $$dir$$file $(DESTDIR)/$(datadir)/locale/$$lang/LC_MESSAGES/$(PACKAGE).mo; \ | |
8e2532fd | 355 | done |
c44c90db | 356 | $(SHELL) $(mkinstalldirs) $(DESTDIR)$(infodir) |
357 | @list='$(info_INFOS)'; \ | |
358 | for file in $$list; do \ | |
359 | if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ | |
360 | dest="`echo $$file | sed 's,.*/,,'`"; \ | |
361 | $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(infodir); \ | |
362 | if (install-info --version && \ | |
363 | install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ | |
364 | install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$dest" || :; \ | |
365 | fi; \ | |
366 | done | |
6a161fa9 | 367 | |
368 | install-strip: | |
369 | $(MAKE) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" install | |
370 | ||
371 | uninstall: | |
4931827f | 372 | @list='$(PKGLIB)'; \ |
0058f771 | 373 | for file in $$list; do \ |
6a161fa9 | 374 | dest="`echo $$file | sed 's,.*/,,'`"; \ |
05568c2e | 375 | rm -f $(DESTDIR)$(pkglibdir)/$$dest; \ |
6a161fa9 | 376 | done |
4931827f | 377 | @list='$(PKGDATA)'; \ |
378 | for file in $$list; do \ | |
379 | dest="`echo $$file | sed 's,.*/,,'`"; \ | |
380 | rm -f $(DESTDIR)$(pkgdatadir)/$$dest; \ | |
381 | done | |
19987ffa | 382 | @list='$(bin_UTILITIES) $(bin_SCRIPTS) $(GRUB_EMU)'; for file in $$list; do \ |
1d543c3e | 383 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ |
6a161fa9 | 384 | rm -f $(DESTDIR)$(bindir)/$$dest; \ |
0658e928 | 385 | rm -f $(DESTDIR)$(mandir)/man1/$$dest.1; \ |
6a161fa9 | 386 | done |
075a1650 | 387 | @list='$(sbin_UTILITIES) $(sbin_SCRIPTS)'; for file in $$list; do \ |
1d543c3e | 388 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ |
1cc73a62 | 389 | rm -f $(DESTDIR)$(sbindir)/$$dest; \ |
0658e928 | 390 | rm -f $(DESTDIR)$(mandir)/man8/$$dest.8; \ |
1cc73a62 | 391 | done |
18ade780 | 392 | @list='$(grub-mkconfig_SCRIPTS) $(grub-mkconfig_DATA)'; for file in $$list; do \ |
7076340d | 393 | dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ |
394 | rm -f $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \ | |
395 | done | |
ca0388f0 | 396 | @list='$(lib_SCRIPTS)'; \ |
af361263 | 397 | for file in $$list; do \ |
398 | dest="`echo $$file | sed 's,.*/,,'`"; \ | |
af361263 | 399 | rm -f $(DESTDIR)$(libdir)/grub/$$dest; \ |
400 | done | |
c44c90db | 401 | @list='$(info_INFOS)'; \ |
402 | for file in $$list; do \ | |
403 | dest="`echo $$file | sed 's,.*/,,'`"; \ | |
404 | if (install-info --version && \ | |
405 | install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ | |
406 | if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$dest"; then \ | |
407 | :; \ | |
408 | else \ | |
409 | test ! -f "$(DESTDIR)$(infodir)/$$dest" || exit 1; \ | |
410 | fi; \ | |
411 | fi; \ | |
412 | rm -f $(DESTDIR)$(infodir)/$$dest; \ | |
413 | done | |
6a161fa9 | 414 | |
e8f5d6e9 | 415 | clean: $(CLEAN_IMAGE_TARGETS) $(CLEAN_MODULE_TARGETS) $(CLEAN_UTILITY_TARGETS) |
6a161fa9 | 416 | -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) |
417 | ||
e8f5d6e9 | 418 | mostlyclean: clean $(MOSTLYCLEAN_IMAGE_TARGETS) $(MOSTLYCLEAN_MODULE_TARGETS) $(MOSTLYCLEAN_UTILITY_TARGETS) |
6a161fa9 | 419 | -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) |
420 | ||
421 | distclean: mostlyclean | |
422 | -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) | |
423 | -rm -rf $(srcdir)/autom4te.cache | |
424 | ||
425 | maintainer-clean: distclean | |
426 | -test -z "$(MAINTAINER_CLEANFILES)" || rm -f $(MAINTAINER_CLEANFILES) | |
427 | ||
428 | info: | |
429 | ||
430 | dvi: | |
431 | ||
432 | distdir=$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) | |
433 | ||
0058f771 | 434 | DISTLIST: gendistlist.sh |
c1cb63ba | 435 | $(SHELL) $(srcdir)/gendistlist.sh > $(srcdir)/DISTLIST |
0058f771 | 436 | |
437 | distdir: DISTLIST | |
6a161fa9 | 438 | -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) |
c1cb63ba | 439 | $(SHELL) $(mkinstalldirs) $(distdir) |
0058f771 | 440 | for i in `cat $(srcdir)/DISTLIST`; do \ |
6a161fa9 | 441 | dir=`echo "$$i" | sed 's:/[^/]*$$::'`; \ |
442 | if test -d $(srcdir)/$$dir; then \ | |
c1cb63ba | 443 | $(SHELL) $(mkinstalldirs) $(distdir)/$$dir; \ |
6a161fa9 | 444 | fi; \ |
445 | cp -p $(srcdir)/$$i $(distdir)/$$i || exit 1; \ | |
446 | done | |
447 | chmod -R a+r $(distdir) | |
448 | ||
449 | GZIP_ENV = --best | |
450 | ||
451 | dist: distdir | |
452 | tar chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz | |
453 | -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) | |
454 | ||
455 | distcheck: dist | |
456 | -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) | |
457 | GZIP=$(GZIP_ENV) gzip -cd $(distdir).tar.gz | tar xf - | |
458 | chmod -R a-w $(distdir) | |
459 | chmod a+w $(distdir) | |
460 | mkdir $(distdir)/=build | |
461 | mkdir $(distdir)/=inst | |
462 | chmod a-w $(distdir) | |
463 | dc_instdir=`CDPATH=: && cd $(distdir)/=inst && pwd` \ | |
464 | && cd $(distdir)/=build \ | |
c1cb63ba | 465 | && $(SHELL) ../configure --srcdir=.. --prefix=$$dc_instdir \ |
7076340d | 466 | && $(MAKE) all dvi check install && $(MAKE) uninstall \ |
6a161fa9 | 467 | && (test `find $$dc_instdir -type f -print | wc -l` -le 1 \ |
468 | || (echo "Error: files left after uninstall" 1>&2; \ | |
469 | exit 1)) \ | |
7076340d | 470 | && $(MAKE) dist && $(MAKE) distclean \ |
6a161fa9 | 471 | && rm -f $(distdir).tar.gz \ |
472 | && (test `find . -type f -print | wc -l` -eq 0 \ | |
473 | || (echo "Error: files left after distclean" 1>&2; \ | |
474 | exit 1)) | |
475 | -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) | |
476 | @echo "$(distdir).tar.gz is ready for distribution" | \ | |
477 | sed 'h;s/./=/g;p;x;p;x' | |
478 | ||
c5431d40 BC |
479 | check: all $(UNIT_TESTS) $(FUNCTIONAL_TESTS) $(SCRIPTED_TESTS) |
480 | @list="$(UNIT_TESTS)"; \ | |
ec1444e6 | 481 | set -e; \ |
169b1cd2 BC |
482 | for file in $$list; do \ |
483 | $(builddir)/$$file; \ | |
484 | done | |
c5431d40 | 485 | @list="$(FUNCTIONAL_TESTS)"; \ |
ec1444e6 | 486 | set -e; \ |
c5431d40 BC |
487 | for file in $$list; do \ |
488 | mod=`basename $$file .mod`; \ | |
489 | echo "insmod functional_test; insmod $$mod; functional_test" \ | |
490 | | $(builddir)/grub-shell; \ | |
491 | done | |
492 | @list="$(SCRIPTED_TESTS)"; \ | |
ec1444e6 | 493 | set -e; \ |
6fc804ff | 494 | for file in $$list; do \ |
ec1444e6 | 495 | $(builddir)/$$file; \ |
6fc804ff | 496 | done |
6a161fa9 | 497 | |
498 | .SUFFIX: | |
499 | .SUFFIX: .c .o .S .d | |
500 | ||
501 | # Regenerate configure and Makefile automatically. | |
af1c0c85 RM |
502 | $(srcdir)/aclocal.m4: configure.ac acinclude.m4 |
503 | cd $(srcdir) && aclocal | |
504 | ||
6a161fa9 | 505 | $(srcdir)/configure: configure.ac aclocal.m4 |
506 | cd $(srcdir) && autoconf | |
507 | ||
508 | $(srcdir)/config.h.in: stamp-h.in | |
509 | $(srcdir)/stamp-h.in: configure.ac aclocal.m4 | |
510 | cd $(srcdir) && autoheader | |
511 | echo timestamp > $(srcdir)/stamp-h.in | |
512 | ||
513 | config.h: stamp-h | |
514 | stamp-h: config.h.in config.status | |
c1cb63ba | 515 | $(SHELL) ./config.status |
6a161fa9 | 516 | |
517 | Makefile: Makefile.in config.status | |
c1cb63ba | 518 | $(SHELL) ./config.status |
6a161fa9 | 519 | |
520 | config.status: configure | |
c1cb63ba | 521 | $(SHELL) ./config.status --recheck |
6a161fa9 | 522 | |
7b455f4d | 523 | gensymlist.sh: gensymlist.sh.in config.status |
c1cb63ba | 524 | $(SHELL) ./config.status |
7b455f4d | 525 | |
526 | genkernsyms.sh: genkernsyms.sh.in config.status | |
c1cb63ba | 527 | $(SHELL) ./config.status |
7b455f4d | 528 | |
1164b270 | 529 | $(srcdir)/po/$(PACKAGE).pot: po/POTFILES po/POTFILES-shell |
941903f2 | 530 | cd $(srcdir) && $(XGETTEXT) -ctranslate --from-code=utf-8 -o $@ -f $< --keyword=_ --keyword=N_ |
531 | cd $(srcdir) && $(XGETTEXT) -ctranslate --from-code=utf-8 -o $@ -f po/POTFILES-shell -j --language=Shell | |
ed101e81 | 532 | |
ef34cbd4 | 533 | $(foreach lang, $(LINGUAS), $(srcdir)/po/$(lang).po): po/$(PACKAGE).pot |
1164b270 | 534 | $(MSGMERGE) -U $@ $^ |
ed101e81 RM |
535 | |
536 | po/%.mo: po/%.po | |
537 | $(MKDIR_P) $$(dirname $@) | |
8c37c91f | 538 | $(MSGFMT) -c --statistics -o $@ $^ |
ed101e81 | 539 | |
6a161fa9 | 540 | .PHONY: all install install-strip uninstall clean mostlyclean distclean |
541 | .PHONY: maintainer-clean info dvi dist check | |
542 | ||
543 | # Prevent an overflow. | |
544 | .NOEXPORT: | |
233b1628 | 545 | |
546 | .DELETE_ON_ERROR: |