2009-10-28 Robert Millan <rmh.grub@aybabtu.com>
[grub2/jjazz.git] / Makefile.in
blobf99bc3c2a1f4a358794fcb8d260b4241fd6ccfc8
1 # -*- makefile -*-
3 # Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
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.
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.
14 ### The configure script will replace these variables.
16 SHELL = /bin/sh
18 @SET_MAKE@
20 transform = @program_transform_name@
22 srcdir = @srcdir@
23 builddir = @builddir@
24 top_srcdir = @top_srcdir@
25 VPATH = @srcdir@
26 prefix = @prefix@
27 exec_prefix = @exec_prefix@
29 bindir = @bindir@
30 sbindir = @sbindir@
31 libexecdir = @libexecdir@
32 datarootdir = @datarootdir@
33 datadir = @datadir@
34 sysconfdir = @sysconfdir@
35 sharedstatedir = @sharedstatedir@
36 localstatedir = @localstatedir@
37 libdir = @libdir@
38 infodir = @infodir@
39 mandir = @mandir@
40 includedir = @includedir@
41 pkgdatadir = $(datadir)/`echo @PACKAGE_TARNAME@ | sed '$(transform)'`
42 pkglibdir = $(libdir)/`echo @PACKAGE_TARNAME@/$(target_cpu)-$(platform) | sed '$(transform)'`
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@
50 host_os = @host_os@
51 host_kernel = @host_kernel@
52 host_cpu = @host_cpu@
54 target_cpu = @target_cpu@
55 platform = @platform@
57 INSTALL = @INSTALL@
58 INSTALL_PROGRAM = @INSTALL_PROGRAM@
59 INSTALL_DATA = @INSTALL_DATA@
60 INSTALL_SCRIPT = @INSTALL_SCRIPT@
61 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
62 MKDIR_P = @MKDIR_P@
64 mkinstalldirs = $(srcdir)/mkinstalldirs
66 CC = @CC@
67 CFLAGS = @CFLAGS@
68 ASFLAGS = @ASFLAGS@
69 LDFLAGS = @LDFLAGS@
70 CPPFLAGS = @CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/include -Wall -W \
71 -DGRUB_LIBDIR=\"$(pkglibdir)\"
72 TARGET_CC = @TARGET_CC@
73 TARGET_CFLAGS = @TARGET_CFLAGS@
74 TARGET_ASFLAGS = @TARGET_ASFLAGS@
75 TARGET_MODULE_FORMAT = @TARGET_MODULE_FORMAT@
76 TARGET_APPLE_CC = @TARGET_APPLE_CC@
77 OBJCONV = @OBJCONV@
78 TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/include \
79 -Wall -W
80 TARGET_LDFLAGS = @TARGET_LDFLAGS@
81 TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@
82 TARGET_IMG_LDFLAGS = @TARGET_IMG_LDFLAGS@
83 TARGET_IMG_CFLAGS = @TARGET_IMG_CFLAGS@
84 TARGET_OBJ2ELF = @TARGET_OBJ2ELF@
85 EXEEXT = @EXEEXT@
86 OBJCOPY = @OBJCOPY@
87 STRIP = @STRIP@
88 NM = @NM@
89 RUBY = @RUBY@
90 MAKEINFO = @MAKEINFO@
91 ifeq (, $(MAKEINFO))
92 MAKEINFO = true
93 endif
94 HELP2MAN = @HELP2MAN@
95 ifeq (, $(HELP2MAN))
96 HELP2MAN = true
97 else
98 HELP2MAN := LANG=C $(HELP2MAN) --no-info --source=FSF
99 endif
100 AWK = @AWK@
101 LIBCURSES = @LIBCURSES@
102 LIBUSB = @LIBUSB@
103 YACC = @YACC@
104 UNIFONT_BDF = @UNIFONT_BDF@
106 # Options.
107 enable_grub_emu = @enable_grub_emu@
108 enable_grub_emu_usb = @enable_grub_emu_usb@
109 enable_grub_fstest = @enable_grub_fstest@
110 enable_grub_pe2elf = @enable_grub_pe2elf@
111 enable_grub_mkfont = @enable_grub_mkfont@
112 freetype_cflags = @freetype_cflags@
113 freetype_libs = @freetype_libs@
114 enable_efiemu = @enable_efiemu@
116 ### General variables.
118 RMKFILES = $(wildcard conf/*.rmk)
120 MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES))
122 PKGLIB = $(pkglib_IMAGES) $(pkglib_MODULES) $(pkglib_PROGRAMS) \
123 $(pkglib_DATA) $(pkglib_BUILDDIR)
124 PKGDATA = $(pkgdata_DATA)
125 PROGRAMS = $(bin_UTILITIES) $(sbin_UTILITIES)
126 SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(grub-mkconfig_SCRIPTS) \
127 $(lib_SCRIPTS)
128 INFOS = $(info_INFOS)
130 CLEANFILES =
131 MOSTLYCLEANFILES =
132 DISTCLEANFILES = config.status config.cache config.log config.h \
133 Makefile stamp-h include/grub/cpu include/grub/machine \
134 gensymlist.sh genkernsyms.sh build_env.mk
135 MAINTAINER_CLEANFILES = $(srcdir)/configure $(addprefix $(srcdir)/,$(MKFILES)) \
136 $(srcdir)/DISTLIST $(srcdir)/config.h.in $(srcdir)/stamp-h.in $(INFOS)
138 # The default target.
139 all: all-local
141 ### Include an arch-specific Makefile.
142 $(addprefix $(srcdir)/,$(MKFILES)): %.mk: %.rmk genmk.rb
143 if test "x$(RUBY)" = x; then \
144 touch $@; \
145 else \
146 $(RUBY) $(srcdir)/genmk.rb < $< > $@; \
149 include $(srcdir)/conf/$(target_cpu)-$(platform).mk
151 # For external modules.
152 -include $(wildcard $(GRUB_CONTRIB)/*/conf/common.mk)
154 ### General targets.
156 CLEANFILES += $(pkglib_DATA) $(pkgdata_DATA)
157 pkglib_DATA += moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst
158 moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep.awk
159 cat $(DEFSYMFILES) /dev/null \
160 | $(AWK) -f $(srcdir)/genmoddep.awk $(UNDSYMFILES) > $@ \
161 || (rm -f $@; exit 1)
163 command.lst: $(COMMANDFILES)
164 cat $^ /dev/null | sort > $@
166 fs.lst: $(FSFILES)
167 cat $^ /dev/null | sort > $@
169 partmap.lst: $(PARTMAPFILES)
170 cat $^ /dev/null | sort > $@
172 handler.lst: $(HANDLERFILES)
173 cat $^ /dev/null | sort > $@
175 parttool.lst: $(PARTTOOLFILES)
176 cat $^ /dev/null | sort | uniq > $@
178 ifneq (true, $(MAKEINFO))
179 info_INFOS += docs/grub.info
180 endif
182 MOSTLYCLEANFILES += vti.tmp
183 MAINTAINER_CLEANFILES += docs/stamp-vti docs/version.texi
184 docs/version.texi: docs/stamp-vti
185 docs/stamp-vti: docs/grub.texi configure.ac
186 $(MKDIR_P) docs
187 (set `$(SHELL) $(srcdir)/docs/mdate-sh $<`; \
188 echo "@set UPDATED $$1 $$2 $$3"; \
189 echo "@set UPDATED-MONTH $$2 $$3"; \
190 echo "@set EDITION $(PACKAGE_VERSION)"; \
191 echo "@set VERSION $(PACKAGE_VERSION)") > vti.tmp
192 @cmp -s vti.tmp $(builddir)/docs/version.texi \
193 || (echo "Updating $(builddir)/docs/version.texi"; \
194 cp vti.tmp $(builddir)/docs/version.texi)
195 -@rm -f vti.tmp
196 @cp $(builddir)/docs/version.texi $@
198 # Use --force until such time as the documentation is cleaned up.
199 docs/grub.info: docs/grub.texi docs/version.texi docs/fdl.texi
200 $(MKDIR_P) docs
201 -$(MAKEINFO) -P $(builddir)/docs --no-split --force $< -o $@
203 ifeq (, $(UNIFONT_BDF))
204 else
206 ifeq ($(enable_grub_mkfont),yes)
208 pkgdata_DATA += unicode.pf2 ascii.pf2
210 # Arrows and lines are needed to draw the menu, so we always include them
211 UNICODE_ARROWS=0x2190-0x2193
212 UNICODE_LINES=0x2501-0x251B
214 unicode.pf2: $(UNIFONT_BDF) grub-mkfont
215 $(builddir)/grub-mkfont -o $@ $(UNIFONT_BDF)
217 ascii.pf2: $(UNIFONT_BDF) grub-mkfont
218 $(builddir)/grub-mkfont -o $@ $(UNIFONT_BDF) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES)
219 endif
220 endif
222 # Used for building modules externally
223 pkglib_BUILDDIR += build_env.mk
224 build_env.mk: Makefile
226 echo "TARGET_CC=$(TARGET_CC)" ; \
227 echo "TARGET_CFLAGS=$(TARGET_CFLAGS)" ; \
228 echo "TARGET_ASFLAGS=$(TARGET_ASFLAGS)" ; \
229 echo "TARGET_CPPFLAGS=$(TARGET_CPPFLAGS) -I$(pkglibdir) -I$(includedir)" ; \
230 echo "STRIP=$(STRIP)" ; \
231 echo "OBJCONV=$(OBJCONV)" ; \
232 echo "TARGET_MODULE_FORMAT=$(TARGET_MODULE_FORMAT)" ; \
233 echo "TARGET_APPLE_CC=$(TARGET_APPLE_CC)" ; \
234 echo "COMMON_ASFLAGS=$(COMMON_ASFLAGS)" ; \
235 echo "COMMON_CFLAGS=$(COMMON_CFLAGS)" ; \
236 echo "COMMON_LDFLAGS=$(COMMON_LDFLAGS)"\
237 ) > $@
238 pkglib_BUILDDIR += config.h grub_script.tab.h
240 all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(INFOS) $(MKFILES)
242 install: install-local
244 install-local: all
245 $(SHELL) $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
246 rm -f $(DESTDIR)$(pkglibdir)/*
247 @list='$(PKGLIB)'; \
248 for file in $$list; do \
249 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
250 dest="`echo $$file | sed 's,.*/,,'`"; \
251 $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkglibdir)/$$dest; \
252 done
253 $(SHELL) $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
254 @list='$(PKGDATA)'; \
255 for file in $$list; do \
256 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
257 dest="`echo $$file | sed 's,.*/,,'`"; \
258 $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkgdatadir)/$$dest; \
259 done
260 $(SHELL) $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1
261 @list='$(bin_UTILITIES)'; for file in $$list; do \
262 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
263 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
264 $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \
265 $(HELP2MAN) --section=1 -o $(DESTDIR)$(mandir)/man1/$$dest.1 $(builddir)/$$file; \
266 done
267 $(SHELL) $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8
268 @list='$(sbin_UTILITIES)'; for file in $$list; do \
269 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
270 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
271 $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \
272 $(HELP2MAN) --section=8 -o $(DESTDIR)$(mandir)/man8/$$dest.8 $(builddir)/$$file; \
273 done
274 @list='$(bin_SCRIPTS)'; for file in $$list; do \
275 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
276 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
277 $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \
278 $(HELP2MAN) --section=1 -o $(DESTDIR)$(mandir)/man1/$$dest.1 $(builddir)/$$file; \
279 done
280 @list='$(sbin_SCRIPTS)'; for file in $$list; do \
281 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
282 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
283 $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \
284 $(HELP2MAN) --section=8 -o $(DESTDIR)$(mandir)/man8/$$dest.8 $(builddir)/$$file; \
285 done
286 $(SHELL) $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/grub.d
287 @list='$(grub-mkconfig_SCRIPTS)'; for file in $$list; do \
288 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
289 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
290 $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \
291 done
292 @list='$(grub-mkconfig_DATA)'; for file in $$list; do \
293 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
294 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
295 $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \
296 done
297 $(SHELL) $(mkinstalldirs) $(DESTDIR)$(libdir)/grub
298 @list='$(lib_SCRIPTS)'; \
299 for file in $$list; do \
300 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
301 dest="`echo $$file | sed 's,.*/,,'`"; \
302 $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(libdir)/grub/$$dest; \
303 done
304 $(SHELL) $(mkinstalldirs) $(DESTDIR)$(infodir)
305 @list='$(info_INFOS)'; \
306 for file in $$list; do \
307 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
308 dest="`echo $$file | sed 's,.*/,,'`"; \
309 $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(infodir); \
310 if (install-info --version && \
311 install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
312 install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$dest" || :; \
313 fi; \
314 done
316 install-strip:
317 $(MAKE) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" install
319 uninstall:
320 @list='$(PKGLIB)'; \
321 for file in $$list; do \
322 dest="`echo $$file | sed 's,.*/,,'`"; \
323 rm -f $(DESTDIR)$(pkglibdir)/$$dest; \
324 done
325 @list='$(PKGDATA)'; \
326 for file in $$list; do \
327 dest="`echo $$file | sed 's,.*/,,'`"; \
328 rm -f $(DESTDIR)$(pkgdatadir)/$$dest; \
329 done
330 @list='$(bin_UTILITIES) $(bin_SCRIPTS)'; for file in $$list; do \
331 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
332 rm -f $(DESTDIR)$(bindir)/$$dest; \
333 rm -f $(DESTDIR)$(mandir)/man1/$$dest.1; \
334 done
335 @list='$(sbin_UTILITIES) $(sbin_SCRIPTS)'; for file in $$list; do \
336 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
337 rm -f $(DESTDIR)$(sbindir)/$$dest; \
338 rm -f $(DESTDIR)$(mandir)/man8/$$dest.8; \
339 done
340 @list='$(grub-mkconfig_SCRIPTS) $(grub-mkconfig_DATA)'; for file in $$list; do \
341 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
342 rm -f $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \
343 done
344 @list='$(lib_SCRIPTS)'; \
345 for file in $$list; do \
346 dest="`echo $$file | sed 's,.*/,,'`"; \
347 echo rm -f $(DESTDIR)$(libdir)/$$dest; \
348 rm -f $(DESTDIR)$(libdir)/grub/$$dest; \
349 done
350 @list='$(info_INFOS)'; \
351 for file in $$list; do \
352 dest="`echo $$file | sed 's,.*/,,'`"; \
353 if (install-info --version && \
354 install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
355 if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$dest"; then \
356 :; \
357 else \
358 test ! -f "$(DESTDIR)$(infodir)/$$dest" || exit 1; \
359 fi; \
360 fi; \
361 rm -f $(DESTDIR)$(infodir)/$$dest; \
362 done
364 clean: $(CLEAN_IMAGE_TARGETS) $(CLEAN_MODULE_TARGETS) $(CLEAN_UTILITY_TARGETS)
365 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
367 mostlyclean: clean $(MOSTLYCLEAN_IMAGE_TARGETS) $(MOSTLYCLEAN_MODULE_TARGETS) $(MOSTLYCLEAN_UTILITY_TARGETS)
368 -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
370 distclean: mostlyclean
371 -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
372 -rm -rf $(srcdir)/autom4te.cache
374 maintainer-clean: distclean
375 -test -z "$(MAINTAINER_CLEANFILES)" || rm -f $(MAINTAINER_CLEANFILES)
377 info:
379 dvi:
381 distdir=$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
383 DISTLIST: gendistlist.sh
384 $(SHELL) $(srcdir)/gendistlist.sh > $(srcdir)/DISTLIST
386 distdir: DISTLIST
387 -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
388 $(SHELL) $(mkinstalldirs) $(distdir)
389 for i in `cat $(srcdir)/DISTLIST`; do \
390 dir=`echo "$$i" | sed 's:/[^/]*$$::'`; \
391 if test -d $(srcdir)/$$dir; then \
392 $(SHELL) $(mkinstalldirs) $(distdir)/$$dir; \
393 fi; \
394 cp -p $(srcdir)/$$i $(distdir)/$$i || exit 1; \
395 done
396 chmod -R a+r $(distdir)
398 GZIP_ENV = --best
400 dist: distdir
401 tar chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
402 -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
404 distcheck: dist
405 -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
406 GZIP=$(GZIP_ENV) gzip -cd $(distdir).tar.gz | tar xf -
407 chmod -R a-w $(distdir)
408 chmod a+w $(distdir)
409 mkdir $(distdir)/=build
410 mkdir $(distdir)/=inst
411 chmod a-w $(distdir)
412 dc_instdir=`CDPATH=: && cd $(distdir)/=inst && pwd` \
413 && cd $(distdir)/=build \
414 && $(SHELL) ../configure --srcdir=.. --prefix=$$dc_instdir \
415 && $(MAKE) all dvi check install && $(MAKE) uninstall \
416 && (test `find $$dc_instdir -type f -print | wc -l` -le 1 \
417 || (echo "Error: files left after uninstall" 1>&2; \
418 exit 1)) \
419 && $(MAKE) dist && $(MAKE) distclean \
420 && rm -f $(distdir).tar.gz \
421 && (test `find . -type f -print | wc -l` -eq 0 \
422 || (echo "Error: files left after distclean" 1>&2; \
423 exit 1))
424 -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
425 @echo "$(distdir).tar.gz is ready for distribution" | \
426 sed 'h;s/./=/g;p;x;p;x'
428 check:
430 .SUFFIX:
431 .SUFFIX: .c .o .S .d
433 # Regenerate configure and Makefile automatically.
434 $(srcdir)/configure: configure.ac aclocal.m4
435 cd $(srcdir) && autoconf
437 $(srcdir)/config.h.in: stamp-h.in
438 $(srcdir)/stamp-h.in: configure.ac aclocal.m4
439 cd $(srcdir) && autoheader
440 echo timestamp > $(srcdir)/stamp-h.in
442 config.h: stamp-h
443 stamp-h: config.h.in config.status
444 $(SHELL) ./config.status
446 Makefile: Makefile.in config.status
447 $(SHELL) ./config.status
449 config.status: configure
450 $(SHELL) ./config.status --recheck
452 gensymlist.sh: gensymlist.sh.in config.status
453 $(SHELL) ./config.status
455 genkernsyms.sh: genkernsyms.sh.in config.status
456 $(SHELL) ./config.status
458 .PHONY: all install install-strip uninstall clean mostlyclean distclean
459 .PHONY: maintainer-clean info dvi dist check
461 # Prevent an overflow.
462 .NOEXPORT:
464 .DELETE_ON_ERROR: