2009-09-12 Robert Millan <rmh.grub@aybabtu.com>
[grub2/jjazz.git] / Makefile.in
blobff84afb7b21db5392a705b4e8203bc87758b2ed8
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@
63 mkinstalldirs = $(srcdir)/mkinstalldirs
65 CC = @CC@
66 CFLAGS = @CFLAGS@
67 ASFLAGS = @ASFLAGS@
68 LDFLAGS = @LDFLAGS@
69 CPPFLAGS = @CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/include -Wall -W \
70 -DGRUB_LIBDIR=\"$(pkglibdir)\"
71 TARGET_CC = @TARGET_CC@
72 TARGET_CFLAGS = @TARGET_CFLAGS@
73 TARGET_ASFLAGS = @TARGET_ASFLAGS@
74 TARGET_MODULE_FORMAT = @TARGET_MODULE_FORMAT@
75 TARGET_APPLE_CC = @TARGET_APPLE_CC@
76 OBJCONV = @OBJCONV@
77 TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/include \
78 -Wall -W
79 TARGET_LDFLAGS = @TARGET_LDFLAGS@
80 TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@
81 TARGET_IMG_LDFLAGS = @TARGET_IMG_LDFLAGS@
82 TARGET_IMG_CFLAGS = @TARGET_IMG_CFLAGS@
83 TARGET_OBJ2ELF = @TARGET_OBJ2ELF@
84 EXEEXT = @EXEEXT@
85 OBJCOPY = @OBJCOPY@
86 STRIP = @STRIP@
87 NM = @NM@
88 RUBY = @RUBY@
89 HELP2MAN = @HELP2MAN@
90 ifeq (, $(HELP2MAN))
91 HELP2MAN = true
92 else
93 HELP2MAN := LANG=C $(HELP2MAN) --no-info --source=FSF
94 endif
95 AWK = @AWK@
96 LIBCURSES = @LIBCURSES@
97 LIBUSB = @LIBUSB@
98 YACC = @YACC@
99 UNIFONT_BDF = @UNIFONT_BDF@
101 # Options.
102 enable_grub_emu = @enable_grub_emu@
103 enable_grub_emu_usb = @enable_grub_emu_usb@
104 enable_grub_fstest = @enable_grub_fstest@
105 enable_grub_pe2elf = @enable_grub_pe2elf@
106 enable_grub_mkfont = @enable_grub_mkfont@
107 freetype_cflags = @freetype_cflags@
108 freetype_libs = @freetype_libs@
109 enable_efiemu = @enable_efiemu@
111 ### General variables.
113 RMKFILES = $(addprefix conf/,common.rmk i386-coreboot.rmk i386-efi.rmk \
114 i386-qemu.rmk i386-ieee1275.rmk i386-pc.rmk i386.rmk powerpc-ieee1275.rmk \
115 sparc64-ieee1275.rmk x86_64-efi.rmk)
117 MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES))
119 PKGLIB = $(pkglib_IMAGES) $(pkglib_MODULES) $(pkglib_PROGRAMS) \
120 $(pkglib_DATA) $(pkglib_BUILDDIR)
121 PKGDATA = $(pkgdata_DATA)
122 PROGRAMS = $(bin_UTILITIES) $(sbin_UTILITIES)
123 SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(grub-mkconfig_SCRIPTS) \
124 $(lib_SCRIPTS)
126 CLEANFILES =
127 MOSTLYCLEANFILES =
128 DISTCLEANFILES = config.status config.cache config.log config.h \
129 Makefile stamp-h include/grub/cpu include/grub/machine \
130 gensymlist.sh genkernsyms.sh build_env.mk
131 MAINTAINER_CLEANFILES = $(srcdir)/configure $(addprefix $(srcdir)/,$(MKFILES)) \
132 $(srcdir)/DISTLIST $(srcdir)/config.h.in $(srcdir)/stamp-h.in
134 # The default target.
135 all: all-local
137 ### Include an arch-specific Makefile.
138 $(addprefix $(srcdir)/,$(MKFILES)): %.mk: %.rmk genmk.rb
139 if test "x$(RUBY)" = x; then \
140 touch $@; \
141 else \
142 $(RUBY) $(srcdir)/genmk.rb < $< > $@; \
145 include $(srcdir)/conf/$(target_cpu)-$(platform).mk
147 ### General targets.
149 CLEANFILES += $(pkglib_DATA) $(pkgdata_DATA)
150 pkglib_DATA += moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst
151 moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep.awk
152 cat $(DEFSYMFILES) /dev/null \
153 | $(AWK) -f $(srcdir)/genmoddep.awk $(UNDSYMFILES) > $@ \
154 || (rm -f $@; exit 1)
156 command.lst: $(COMMANDFILES)
157 cat $^ /dev/null | sort > $@
159 fs.lst: $(FSFILES)
160 cat $^ /dev/null | sort > $@
162 partmap.lst: $(PARTMAPFILES)
163 cat $^ /dev/null | sort > $@
165 handler.lst: $(HANDLERFILES)
166 cat $^ /dev/null | sort > $@
168 parttool.lst: $(PARTTOOLFILES)
169 cat $^ /dev/null | sort | uniq > $@
171 ifeq (, $(UNIFONT_BDF))
172 else
174 ifeq ($(enable_grub_mkfont),yes)
176 pkgdata_DATA += unicode.pf2 ascii.pf2
178 # Arrows and lines are needed to draw the menu, so we always include them
179 UNICODE_ARROWS=0x2190-0x2193
180 UNICODE_LINES=0x2501-0x251B
182 unicode.pf2: $(UNIFONT_BDF) grub-mkfont
183 $(builddir)/grub-mkfont -o $@ $(UNIFONT_BDF)
185 ascii.pf2: $(UNIFONT_BDF) grub-mkfont
186 $(builddir)/grub-mkfont -o $@ $(UNIFONT_BDF) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES)
187 endif
188 endif
190 # Used for building modules externally
191 pkglib_BUILDDIR += build_env.mk
192 build_env.mk: Makefile
194 echo "TARGET_CC=$(TARGET_CC)" ; \
195 echo "TARGET_CFLAGS=$(TARGET_CFLAGS)" ; \
196 echo "TARGET_ASFLAGS=$(TARGET_ASFLAGS)" ; \
197 echo "TARGET_CPPFLAGS=$(TARGET_CPPFLAGS) -I$(pkglibdir) -I$(includedir)" ; \
198 echo "STRIP=$(STRIP)" ; \
199 echo "OBJCONV=$(OBJCONV)" ; \
200 echo "TARGET_MODULE_FORMAT=$(TARGET_MODULE_FORMAT)" ; \
201 echo "TARGET_APPLE_CC=$(TARGET_APPLE_CC)" ; \
202 echo "COMMON_ASFLAGS=$(COMMON_ASFLAGS)" ; \
203 echo "COMMON_CFLAGS=$(COMMON_CFLAGS)" ; \
204 echo "COMMON_LDFLAGS=$(COMMON_LDFLAGS)"\
205 ) > $@
206 pkglib_BUILDDIR += config.h grub_script.tab.h
207 include_DATA += $(shell find $(srcdir)/include -name \*.h | sed -e "s,^$(srcdir)/,,g") \
208 include/grub/cpu include/grub/machine
210 all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(MKFILES)
212 install: install-local
214 install-local: all
215 $(SHELL) $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
216 rm -f $(DESTDIR)$(pkglibdir)/*
217 @list='$(PKGLIB)'; \
218 for file in $$list; do \
219 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
220 dest="`echo $$file | sed 's,.*/,,'`"; \
221 $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkglibdir)/$$dest; \
222 done
223 $(SHELL) $(mkinstalldirs) $(DESTDIR)$(includedir)
224 @list='$(include_DATA)'; \
225 for file in $$list; do \
226 if test -e "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
227 dest="`echo $$file | sed 's,include/,,'`"; \
228 destdir="`echo $$dest | sed 's,[^/]*$$,,g'`"; \
229 $(SHELL) $(mkinstalldirs) $(DESTDIR)$(includedir)/$$destdir; \
230 if test -f "$$dir$$file"; then \
231 $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(includedir)/$$dest; \
232 elif test -L "$$dir$$file"; then \
233 rm -rf $(DESTDIR)$(includedir)/$$dest && \
234 cp -fR $$dir$$file $(DESTDIR)$(includedir)/$$dest; \
235 fi; \
236 done
237 $(SHELL) $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
238 @list='$(PKGDATA)'; \
239 for file in $$list; do \
240 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
241 dest="`echo $$file | sed 's,.*/,,'`"; \
242 $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkgdatadir)/$$dest; \
243 done
244 $(SHELL) $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1
245 @list='$(bin_UTILITIES)'; for file in $$list; do \
246 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
247 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
248 $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \
249 $(HELP2MAN) --section=1 -o $(DESTDIR)$(mandir)/man1/$$dest.1 $(builddir)/$$file; \
250 done
251 $(SHELL) $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8
252 @list='$(sbin_UTILITIES)'; for file in $$list; do \
253 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
254 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
255 $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \
256 $(HELP2MAN) --section=8 -o $(DESTDIR)$(mandir)/man8/$$dest.8 $(builddir)/$$file; \
257 done
258 @list='$(bin_SCRIPTS)'; for file in $$list; do \
259 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
260 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
261 $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \
262 $(HELP2MAN) --section=1 -o $(DESTDIR)$(mandir)/man1/$$dest.1 $(builddir)/$$file; \
263 done
264 @list='$(sbin_SCRIPTS)'; for file in $$list; do \
265 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
266 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
267 $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \
268 $(HELP2MAN) --section=8 -o $(DESTDIR)$(mandir)/man8/$$dest.8 $(builddir)/$$file; \
269 done
270 $(SHELL) $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/grub.d
271 @list='$(grub-mkconfig_SCRIPTS)'; for file in $$list; do \
272 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
273 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
274 $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \
275 done
276 @list='$(grub-mkconfig_DATA)'; for file in $$list; do \
277 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
278 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
279 $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \
280 done
281 $(SHELL) $(mkinstalldirs) $(DESTDIR)$(libdir)/grub
282 @list='$(lib_SCRIPTS)'; \
283 for file in $$list; do \
284 if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
285 dest="`echo $$file | sed 's,.*/,,'`"; \
286 $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(libdir)/grub/$$dest; \
287 done
289 install-strip:
290 $(MAKE) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" install
292 uninstall:
293 @list='$(PKGLIB)'; \
294 for file in $$list; do \
295 dest="`echo $$file | sed 's,.*/,,'`"; \
296 rm -f $(DESTDIR)$(pkglibdir)/$$dest; \
297 done
298 @list='$(PKGDATA)'; \
299 for file in $$list; do \
300 dest="`echo $$file | sed 's,.*/,,'`"; \
301 rm -f $(DESTDIR)$(pkgdatadir)/$$dest; \
302 done
303 @list='$(bin_UTILITIES) $(bin_SCRIPTS)'; for file in $$list; do \
304 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
305 rm -f $(DESTDIR)$(bindir)/$$dest; \
306 rm -f $(DESTDIR)$(mandir)/man1/$$dest.1; \
307 done
308 @list='$(sbin_UTILITIES) $(sbin_SCRIPTS)'; for file in $$list; do \
309 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
310 rm -f $(DESTDIR)$(sbindir)/$$dest; \
311 rm -f $(DESTDIR)$(mandir)/man8/$$dest.8; \
312 done
313 @list='$(grub-mkconfig_SCRIPTS) $(grub-mkconfig_DATA)'; for file in $$list; do \
314 dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
315 rm -f $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \
316 done
317 @list='$(include_DATA)'; \
318 for file in $$list; do \
319 dest="`echo $$file | sed 's,include/,,'`"; \
320 rm -f $(DESTDIR)$(includedir)/$$dest; \
321 done
322 @list='$(lib_SCRIPTS)'; \
323 for file in $$list; do \
324 dest="`echo $$file | sed 's,.*/,,'`"; \
325 echo rm -f $(DESTDIR)$(libdir)/$$dest; \
326 rm -f $(DESTDIR)$(libdir)/grub/$$dest; \
327 done
329 clean: $(CLEAN_IMAGE_TARGETS) $(CLEAN_MODULE_TARGETS) $(CLEAN_UTILITY_TARGETS)
330 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
332 mostlyclean: clean $(MOSTLYCLEAN_IMAGE_TARGETS) $(MOSTLYCLEAN_MODULE_TARGETS) $(MOSTLYCLEAN_UTILITY_TARGETS)
333 -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
335 distclean: mostlyclean
336 -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
337 -rm -rf $(srcdir)/autom4te.cache
339 maintainer-clean: distclean
340 -test -z "$(MAINTAINER_CLEANFILES)" || rm -f $(MAINTAINER_CLEANFILES)
342 info:
344 dvi:
346 distdir=$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
348 DISTLIST: gendistlist.sh
349 $(SHELL) $(srcdir)/gendistlist.sh > $(srcdir)/DISTLIST
351 distdir: DISTLIST
352 -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
353 $(SHELL) $(mkinstalldirs) $(distdir)
354 for i in `cat $(srcdir)/DISTLIST`; do \
355 dir=`echo "$$i" | sed 's:/[^/]*$$::'`; \
356 if test -d $(srcdir)/$$dir; then \
357 $(SHELL) $(mkinstalldirs) $(distdir)/$$dir; \
358 fi; \
359 cp -p $(srcdir)/$$i $(distdir)/$$i || exit 1; \
360 done
361 chmod -R a+r $(distdir)
363 GZIP_ENV = --best
365 dist: distdir
366 tar chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
367 -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
369 distcheck: dist
370 -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
371 GZIP=$(GZIP_ENV) gzip -cd $(distdir).tar.gz | tar xf -
372 chmod -R a-w $(distdir)
373 chmod a+w $(distdir)
374 mkdir $(distdir)/=build
375 mkdir $(distdir)/=inst
376 chmod a-w $(distdir)
377 dc_instdir=`CDPATH=: && cd $(distdir)/=inst && pwd` \
378 && cd $(distdir)/=build \
379 && $(SHELL) ../configure --srcdir=.. --prefix=$$dc_instdir \
380 && $(MAKE) all dvi check install && $(MAKE) uninstall \
381 && (test `find $$dc_instdir -type f -print | wc -l` -le 1 \
382 || (echo "Error: files left after uninstall" 1>&2; \
383 exit 1)) \
384 && $(MAKE) dist && $(MAKE) distclean \
385 && rm -f $(distdir).tar.gz \
386 && (test `find . -type f -print | wc -l` -eq 0 \
387 || (echo "Error: files left after distclean" 1>&2; \
388 exit 1))
389 -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
390 @echo "$(distdir).tar.gz is ready for distribution" | \
391 sed 'h;s/./=/g;p;x;p;x'
393 check:
395 .SUFFIX:
396 .SUFFIX: .c .o .S .d
398 # Regenerate configure and Makefile automatically.
399 $(srcdir)/configure: configure.ac aclocal.m4
400 cd $(srcdir) && autoconf
402 $(srcdir)/config.h.in: stamp-h.in
403 $(srcdir)/stamp-h.in: configure.ac aclocal.m4
404 cd $(srcdir) && autoheader
405 echo timestamp > $(srcdir)/stamp-h.in
407 config.h: stamp-h
408 stamp-h: config.h.in config.status
409 $(SHELL) ./config.status
411 Makefile: Makefile.in config.status
412 $(SHELL) ./config.status
414 config.status: configure
415 $(SHELL) ./config.status --recheck
417 gensymlist.sh: gensymlist.sh.in config.status
418 $(SHELL) ./config.status
420 genkernsyms.sh: genkernsyms.sh.in config.status
421 $(SHELL) ./config.status
423 .PHONY: all install install-strip uninstall clean mostlyclean distclean
424 .PHONY: maintainer-clean info dvi dist check
426 # Prevent an overflow.
427 .NOEXPORT:
429 .DELETE_ON_ERROR: