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
14 ### The configure script will replace these variables.
20 transform
= @program_transform_name@
24 top_srcdir
= @top_srcdir@
27 exec_prefix = @
exec_prefix@
31 libexecdir
= @libexecdir@
32 datarootdir
= @datarootdir@
34 sysconfdir
= @sysconfdir@
35 sharedstatedir
= @sharedstatedir@
36 localstatedir
= @localstatedir@
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@
51 host_kernel
= @host_kernel@
54 target_cpu
= @target_cpu@
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
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@
77 TARGET_CPPFLAGS
= @TARGET_CPPFLAGS@
-I
$(builddir
) -I
$(builddir
)/include -I
$(srcdir)/include \
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@
93 HELP2MAN
:= LANG
=C
$(HELP2MAN
) --no-info
--source
=FSF
96 LIBCURSES
= @LIBCURSES@
99 UNIFONT_BDF
= @UNIFONT_BDF@
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_lzo
= @enable_lzo@
107 enable_grub_mkfont
= @enable_grub_mkfont@
108 freetype_cflags
= @freetype_cflags@
109 freetype_libs
= @freetype_libs@
110 enable_efiemu
= @enable_efiemu@
112 ### General variables.
114 RMKFILES
= $(addprefix conf
/,common.rmk i386-coreboot.rmk i386-efi.rmk \
115 i386-ieee1275.rmk i386-pc.rmk i386.rmk powerpc-ieee1275.rmk \
116 sparc64-ieee1275.rmk x86_64-efi.rmk
)
118 MKFILES
= $(patsubst %.rmk
,%.mk
,$(RMKFILES
))
120 PKGLIB
= $(pkglib_IMAGES
) $(pkglib_MODULES
) $(pkglib_PROGRAMS
) \
121 $(pkglib_DATA
) $(lib_DATA
) $(pkglib_BUILDDIR
)
122 PKGDATA
= $(pkgdata_DATA
) $(pkgdata_SRCDIR
)
123 PROGRAMS
= $(bin_UTILITIES
) $(sbin_UTILITIES
)
124 SCRIPTS
= $(bin_SCRIPTS
) $(sbin_SCRIPTS
) $(grub-mkconfig_SCRIPTS
)
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
))
133 # The default target.
136 ### Include an arch-specific Makefile.
137 $(addprefix $(srcdir)/,$(MKFILES
)): %.mk
: %.rmk genmk.rb
138 if
test "x$(RUBY)" = x
; then \
141 $(RUBY
) $(srcdir)/genmk.rb
< $< > $@
; \
144 include $(srcdir)/conf
/$(target_cpu
)-$(platform
).mk
148 CLEANFILES
+= $(pkglib_DATA
) $(pkgdata_DATA
)
149 pkglib_DATA
+= moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst
150 moddep.lst
: $(DEFSYMFILES
) $(UNDSYMFILES
) genmoddep.awk
151 cat
$(DEFSYMFILES
) /dev
/null \
152 |
$(AWK
) -f
$(srcdir)/genmoddep.awk
$(UNDSYMFILES
) > $@ \
153 ||
(rm -f
$@
; exit
1)
155 command.lst
: $(COMMANDFILES
)
156 cat
$^
/dev
/null |
sort > $@
159 cat
$^
/dev
/null |
sort > $@
161 partmap.lst
: $(PARTMAPFILES
)
162 cat
$^
/dev
/null |
sort > $@
164 handler.lst
: $(HANDLERFILES
)
165 cat
$^
/dev
/null |
sort > $@
167 parttool.lst
: $(PARTTOOLFILES
)
168 cat
$^
/dev
/null |
sort | uniq
> $@
170 ifeq (, $(UNIFONT_BDF
))
173 ifeq ($(enable_grub_mkfont
),yes
)
175 pkgdata_DATA
+= unicode.pf2 ascii.pf2
177 # Arrows and lines are needed to draw the menu, so we always include them
178 UNICODE_ARROWS
=0x2190-0x2193
179 UNICODE_LINES
=0x2501-0x251B
181 unicode.pf2
: $(UNIFONT_BDF
) grub-mkfont
182 $(builddir
)/grub-mkfont
-o
$@
$(UNIFONT_BDF
)
184 ascii.pf2
: $(UNIFONT_BDF
) grub-mkfont
185 $(builddir
)/grub-mkfont
-o
$@
$(UNIFONT_BDF
) -r
0x0-0x7f,$(UNICODE_ARROWS
),$(UNICODE_LINES
)
189 # Used for building modules externally
190 pkglib_BUILDDIR
+= build_env.mk
191 build_env.mk
: Makefile
193 echo
"TARGET_CC=$(TARGET_CC)" ; \
194 echo
"TARGET_CFLAGS=$(TARGET_CFLAGS)" ; \
195 echo
"TARGET_ASFLAGS=$(TARGET_ASFLAGS)" ; \
196 echo
"TARGET_CPPFLAGS=$(TARGET_CPPFLAGS) -I$(pkglibdir) -I$(includedir)" ; \
197 echo
"STRIP=$(STRIP)" ; \
198 echo
"OBJCONV=$(OBJCONV)" ; \
199 echo
"TARGET_MODULE_FORMAT=$(TARGET_MODULE_FORMAT)" ; \
200 echo
"TARGET_APPLE_CC=$(TARGET_APPLE_CC)" ; \
201 echo
"COMMON_ASFLAGS=$(COMMON_ASFLAGS)" ; \
202 echo
"COMMON_CFLAGS=$(COMMON_CFLAGS)" ; \
203 echo
"COMMON_LDFLAGS=$(COMMON_LDFLAGS)"\
205 pkglib_BUILDDIR
+= config.h grub_script.tab.h
206 pkgdata_SRCDIR
+= genmodsrc.sh genmk.rb
207 include_DATA
+= $(shell find
$(srcdir)/include -name \
*.h | sed
-e
"s,^$(srcdir)/,,g") include/grub
/cpu
209 all-local
: $(PROGRAMS
) $(PKGLIB
) $(PKGDATA
) $(SCRIPTS
) $(MKFILES
)
211 install: install-local
214 $(SHELL
) $(mkinstalldirs
) $(DESTDIR
)$(pkglibdir
)
216 for file in
$$list; do \
217 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
218 dest
="`echo $$file | sed 's,.*/,,'`"; \
219 $(INSTALL_DATA
) $$dir$$file $(DESTDIR
)$(pkglibdir
)/$$dest; \
221 $(SHELL
) $(mkinstalldirs
) $(DESTDIR
)$(includedir)
222 @list
='$(include_DATA)'; \
223 for file in
$$list; do \
224 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
225 dest
="`echo $$file | sed 's,include/,,'`"; \
226 destdir
="`echo $$dest | sed 's,[^/]*$$,,g'`"; \
227 $(SHELL
) $(mkinstalldirs
) $(DESTDIR
)$(includedir)/$$destdir; \
228 if
test -f
"$$dir$$file"; then \
229 $(INSTALL_DATA
) $$dir$$file $(DESTDIR
)$(includedir)/$$dest; \
230 elif
test -L
"$$dir$$file"; then \
231 rm -rf
$(DESTDIR
)$(includedir)/$$dest && \
232 cp
-fP
$$dir$$file $(DESTDIR
)$(includedir)/$$dest; \
235 $(SHELL
) $(mkinstalldirs
) $(DESTDIR
)$(pkgdatadir
)
236 @list
='$(PKGDATA)'; \
237 for file in
$$list; do \
238 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
239 dest
="`echo $$file | sed 's,.*/,,'`"; \
240 $(INSTALL_DATA
) $$dir$$file $(DESTDIR
)$(pkgdatadir
)/$$dest; \
242 $(SHELL
) $(mkinstalldirs
) $(DESTDIR
)$(bindir) $(DESTDIR
)$(mandir)/man1
243 @list
='$(bin_UTILITIES)'; for file in
$$list; do \
244 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
245 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
246 $(INSTALL_PROGRAM
) $$dir$$file $(DESTDIR
)$(bindir)/$$dest; \
247 $(HELP2MAN
) --section
=1 -o
$(DESTDIR
)$(mandir)/man1
/$$dest.1 $(builddir
)/$$file; \
249 $(SHELL
) $(mkinstalldirs
) $(DESTDIR
)$(sbindir
) $(DESTDIR
)$(mandir)/man8
250 @list
='$(sbin_UTILITIES)'; for file in
$$list; do \
251 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
252 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
253 $(INSTALL_PROGRAM
) $$dir$$file $(DESTDIR
)$(sbindir
)/$$dest; \
254 $(HELP2MAN
) --section
=8 -o
$(DESTDIR
)$(mandir)/man8
/$$dest.8 $(builddir
)/$$file; \
256 @list
='$(bin_SCRIPTS)'; for file in
$$list; do \
257 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
258 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
259 $(INSTALL_SCRIPT
) $$dir$$file $(DESTDIR
)$(bindir)/$$dest; \
260 $(HELP2MAN
) --section
=1 -o
$(DESTDIR
)$(mandir)/man1
/$$dest.1 $(builddir
)/$$file; \
262 @list
='$(sbin_SCRIPTS)'; for file in
$$list; do \
263 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
264 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
265 $(INSTALL_SCRIPT
) $$dir$$file $(DESTDIR
)$(sbindir
)/$$dest; \
266 $(HELP2MAN
) --section
=8 -o
$(DESTDIR
)$(mandir)/man8
/$$dest.8 $(builddir
)/$$file; \
268 $(SHELL
) $(mkinstalldirs
) $(DESTDIR
)$(sysconfdir
)/grub.d
269 @list
='$(grub-mkconfig_SCRIPTS)'; for file in
$$list; do \
270 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
271 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
272 $(INSTALL_SCRIPT
) $$dir$$file $(DESTDIR
)$(sysconfdir
)/grub.d
/$$dest; \
274 @list
='$(grub-mkconfig_DATA)'; 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_DATA
) $$dir$$file $(DESTDIR
)$(sysconfdir
)/grub.d
/$$dest; \
279 $(SHELL
) $(mkinstalldirs
) $(DESTDIR
)$(libdir)/grub
280 @list
='$(lib_DATA)'; \
281 for file in
$$list; do \
282 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
283 dest
="`echo $$file | sed 's,.*/,,'`"; \
284 $(INSTALL_DATA
) $$dir$$file $(DESTDIR
)$(libdir)/grub
/$$dest; \
288 $(MAKE
) INSTALL_PROGRAM
="$(INSTALL_STRIP_PROGRAM)" install
292 for file in
$$list; do \
293 dest
="`echo $$file | sed 's,.*/,,'`"; \
294 rm -f
$(DESTDIR
)$(pkglibdir
)/$$dest; \
296 @list
='$(PKGDATA)'; \
297 for file in
$$list; do \
298 dest
="`echo $$file | sed 's,.*/,,'`"; \
299 rm -f
$(DESTDIR
)$(pkgdatadir
)/$$dest; \
301 @list
='$(bin_UTILITIES) $(bin_SCRIPTS)'; for file in
$$list; do \
302 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
303 rm -f
$(DESTDIR
)$(bindir)/$$dest; \
305 @list
='$(sbin_UTILITIES) $(sbin_SCRIPTS)'; for file in
$$list; do \
306 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
307 rm -f
$(DESTDIR
)$(sbindir
)/$$dest; \
309 @list
='$(grub-mkconfig_SCRIPTS) $(grub-mkconfig_DATA)'; for file in
$$list; do \
310 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
311 rm -f
$(DESTDIR
)$(sysconfdir
)/grub.d
/$$dest; \
313 @list
='$(include_DATA)'; \
314 for file in
$$list; do \
315 dest
="`echo $$file | sed 's,include/,,'`"; \
316 rm -f
$(DESTDIR
)$(includedir)/$$dest; \
318 @list
='$(lib_DATA)'; \
319 for file in
$$list; do \
320 dest
="`echo $$file | sed 's,.*/,,'`"; \
321 echo
rm -f
$(DESTDIR
)$(libdir)/$$dest; \
322 rm -f
$(DESTDIR
)$(libdir)/grub
/$$dest; \
326 -test -z
"$(CLEANFILES)" ||
rm -f
$(CLEANFILES
)
329 -test -z
"$(MOSTLYCLEANFILES)" ||
rm -f
$(MOSTLYCLEANFILES
)
331 distclean: mostlyclean
332 -test -z
"$(DISTCLEANFILES)" ||
rm -f
$(DISTCLEANFILES
)
333 -rm -rf
$(srcdir)/autom4te.cache
335 maintainer-clean
: distclean
336 -test -z
"$(MAINTAINER_CLEANFILES)" ||
rm -f
$(MAINTAINER_CLEANFILES
)
342 distdir
=$(PACKAGE_TARNAME
)-$(PACKAGE_VERSION
)
344 DISTLIST
: gendistlist.sh
345 $(SHELL
) $(srcdir)/gendistlist.sh
> $(srcdir)/DISTLIST
348 -chmod
-R a
+w
$(distdir
) >/dev
/null
2>&1; rm -rf
$(distdir
)
349 $(SHELL
) $(mkinstalldirs
) $(distdir
)
350 for i in
`cat $(srcdir)/DISTLIST`; do \
351 dir=`echo "$$i" | sed 's:/[^/]*$$::'`; \
352 if
test -d
$(srcdir)/$$dir; then \
353 $(SHELL
) $(mkinstalldirs
) $(distdir
)/$$dir; \
355 cp
-p
$(srcdir)/$$i $(distdir
)/$$i || exit
1; \
357 chmod
-R a
+r
$(distdir
)
362 tar chof
- $(distdir
) | GZIP
=$(GZIP_ENV
) gzip
-c
>$(distdir
).
tar.gz
363 -chmod
-R a
+w
$(distdir
) >/dev
/null
2>&1; rm -rf
$(distdir
)
366 -chmod
-R a
+w
$(distdir
) >/dev
/null
2>&1; rm -rf
$(distdir
)
367 GZIP
=$(GZIP_ENV
) gzip
-cd
$(distdir
).
tar.gz |
tar xf
-
368 chmod
-R a-w
$(distdir
)
370 mkdir
$(distdir
)/=build
371 mkdir
$(distdir
)/=inst
373 dc_instdir
=`CDPATH=: && cd $(distdir)/=inst && pwd` \
374 && cd
$(distdir
)/=build \
375 && $(SHELL
) ..
/configure
--srcdir=..
--prefix=$$dc_instdir \
376 && $(MAKE
) all dvi check install && $(MAKE
) uninstall \
377 && (test `find $$dc_instdir -type f -print | wc -l` -le
1 \
378 ||
(echo
"Error: files left after uninstall" 1>&2; \
380 && $(MAKE
) dist && $(MAKE
) distclean \
381 && rm -f
$(distdir
).
tar.gz \
382 && (test `find . -type f -print | wc -l` -eq
0 \
383 ||
(echo
"Error: files left after distclean" 1>&2; \
385 -chmod
-R a
+w
$(distdir
) > /dev
/null
2>&1; rm -rf
$(distdir
)
386 @echo
"$(distdir).tar.gz is ready for distribution" | \
387 sed
'h;s/./=/g;p;x;p;x'
394 # Regenerate configure and Makefile automatically.
395 $(srcdir)/configure
: configure.ac aclocal.m4
396 cd
$(srcdir) && autoconf
398 $(srcdir)/config.h.in
: stamp-h.in
399 $(srcdir)/stamp-h.in
: configure.ac aclocal.m4
400 cd
$(srcdir) && autoheader
401 echo timestamp
> $(srcdir)/stamp-h.in
404 stamp-h
: config.h.in config.status
405 $(SHELL
) .
/config.status
407 Makefile
: Makefile.in config.status
408 $(SHELL
) .
/config.status
410 config.status
: configure
411 $(SHELL
) .
/config.status
--recheck
413 gensymlist.sh
: gensymlist.sh.in config.status
414 $(SHELL
) .
/config.status
416 genkernsyms.sh
: genkernsyms.sh.in config.status
417 $(SHELL
) .
/config.status
419 .PHONY
: all install install-strip
uninstall clean mostlyclean distclean
420 .PHONY
: maintainer-clean
info dvi dist check
422 # Prevent an overflow.