3 # Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2008 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
68 CPPFLAGS
= @CPPFLAGS@
-I
$(builddir
) -I
$(builddir
)/include -I
$(srcdir)/include -Wall
-W \
69 -DGRUB_LIBDIR
=\"$(pkglibdir
)\"
70 TARGET_CC
= @TARGET_CC@
71 TARGET_CFLAGS
= @TARGET_CFLAGS@
72 TARGET_CPPFLAGS
= @TARGET_CPPFLAGS@
-I
$(builddir
) -I
$(builddir
)/include -I
$(srcdir)/include \
74 TARGET_LDFLAGS
= @TARGET_LDFLAGS@
75 TARGET_IMG_LDSCRIPT
= @TARGET_IMG_LDSCRIPT@
76 TARGET_IMG_LDFLAGS
= @TARGET_IMG_LDFLAGS@
77 TARGET_OBJ2ELF
= @TARGET_OBJ2ELF@
87 HELP2MAN
:= LANG
=C
$(HELP2MAN
) --no-info
--source
=FSF
90 LIBCURSES
= @LIBCURSES@
93 UNIFONT_BDF
= @UNIFONT_BDF@
96 enable_grub_emu
= @enable_grub_emu@
97 enable_grub_emu_usb
= @enable_grub_emu_usb@
98 enable_grub_fstest
= @enable_grub_fstest@
99 enable_grub_pe2elf
= @enable_grub_pe2elf@
100 enable_lzo
= @enable_lzo@
101 enable_grub_mkfont
= @enable_grub_mkfont@
102 freetype_cflags
= @freetype_cflags@
103 freetype_libs
= @freetype_libs@
104 enable_efiemu
= @enable_efiemu@
106 ### General variables.
108 RMKFILES
= $(addprefix conf
/,common.rmk i386-coreboot.rmk i386-efi.rmk \
109 i386-ieee1275.rmk i386-pc.rmk i386.rmk powerpc-ieee1275.rmk \
110 sparc64-ieee1275.rmk x86_64-efi.rmk
)
112 MKFILES
= $(patsubst %.rmk
,%.mk
,$(RMKFILES
))
114 PKGLIB
= $(pkglib_IMAGES
) $(pkglib_MODULES
) $(pkglib_PROGRAMS
) \
115 $(pkglib_DATA
) $(lib_DATA
) $(pkglib_BUILDDIR
)
116 PKGDATA
= $(pkgdata_DATA
) $(pkgdata_SRCDIR
)
117 PROGRAMS
= $(bin_UTILITIES
) $(sbin_UTILITIES
)
118 SCRIPTS
= $(bin_SCRIPTS
) $(sbin_SCRIPTS
) $(grub-mkconfig_SCRIPTS
)
122 DISTCLEANFILES
= config.status config.cache config.log config.h \
123 Makefile stamp-h
include/grub
/cpu
include/grub
/machine \
124 gensymlist.sh genkernsyms.sh build_env.mk
125 MAINTAINER_CLEANFILES
= $(srcdir)/configure
$(addprefix $(srcdir)/,$(MKFILES
))
127 # The default target.
130 ### Include an arch-specific Makefile.
131 $(addprefix $(srcdir)/,$(MKFILES
)): %.mk
: %.rmk genmk.rb
132 if
test "x$(RUBY)" = x
; then \
135 $(RUBY
) $(srcdir)/genmk.rb
< $< > $@
; \
138 include $(srcdir)/conf
/$(target_cpu
)-$(platform
).mk
142 CLEANFILES
+= $(pkglib_DATA
) $(pkgdata_DATA
)
143 pkglib_DATA
+= moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst
144 moddep.lst
: $(DEFSYMFILES
) $(UNDSYMFILES
) genmoddep.awk
145 cat
$(DEFSYMFILES
) /dev
/null \
146 |
$(AWK
) -f
$(srcdir)/genmoddep.awk
$(UNDSYMFILES
) > $@ \
147 ||
(rm -f
$@
; exit
1)
149 command.lst
: $(COMMANDFILES
)
150 cat
$^
/dev
/null |
sort > $@
153 cat
$^
/dev
/null |
sort > $@
155 partmap.lst
: $(PARTMAPFILES
)
156 cat
$^
/dev
/null |
sort > $@
158 handler.lst
: $(HANDLERFILES
)
159 cat
$^
/dev
/null |
sort > $@
161 parttool.lst
: $(PARTTOOLFILES
)
162 cat
$^
/dev
/null |
sort | uniq
> $@
164 ifeq (, $(UNIFONT_BDF
))
167 ifeq ($(enable_grub_mkfont
),yes
)
169 pkgdata_DATA
+= unicode.pf2 ascii.pf2
171 # Arrows and lines are needed to draw the menu, so we always include them
172 UNICODE_ARROWS
=0x2190-0x2193
173 UNICODE_LINES
=0x2501-0x251B
175 unicode.pf2
: $(UNIFONT_BDF
) grub-mkfont
176 $(builddir
)/grub-mkfont
-o
$@
$(UNIFONT_BDF
)
178 ascii.pf2
: $(UNIFONT_BDF
) grub-mkfont
179 $(builddir
)/grub-mkfont
-o
$@
$(UNIFONT_BDF
) -r
0x0-0x7f,$(UNICODE_ARROWS
),$(UNICODE_LINES
)
183 # Used for building modules externally
184 pkglib_BUILDDIR
+= build_env.mk
185 build_env.mk
: Makefile
187 echo
"TARGET_CC=$(TARGET_CC)" ; \
188 echo
"TARGET_CFLAGS=$(TARGET_CFLAGS)" ; \
189 echo
"TARGET_CPPFLAGS=$(TARGET_CPPFLAGS) -I$(pkglibdir)" ; \
190 echo
"STRIP=$(STRIP)" ; \
191 echo
"COMMON_ASFLAGS=$(COMMON_ASFLAGS)" ; \
192 echo
"COMMON_CFLAGS=$(COMMON_CFLAGS)" ; \
193 echo
"COMMON_LDFLAGS=$(COMMON_LDFLAGS)"\
195 pkglib_BUILDDIR
+= config.h grub_script.tab.h
196 pkgdata_SRCDIR
+= genmodsrc.sh genmk.rb
197 include_DATA
+= $(shell find
$(srcdir)/include -name \
*.h | sed
-e
"s,^$(srcdir)/,,g") include/grub
/cpu
199 all-local
: $(PROGRAMS
) $(PKGLIB
) $(PKGDATA
) $(SCRIPTS
) $(MKFILES
)
201 install: install-local
204 $(mkinstalldirs
) $(DESTDIR
)$(pkglibdir
)
206 for file in
$$list; do \
207 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
208 dest
="`echo $$file | sed 's,.*/,,'`"; \
209 $(INSTALL_DATA
) $$dir$$file $(DESTDIR
)$(pkglibdir
)/$$dest; \
211 $(mkinstalldirs
) $(DESTDIR
)$(includedir)
212 @list
='$(include_DATA)'; \
213 for file in
$$list; do \
214 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
215 dest
="`echo $$file | sed 's,include/,,'`"; \
216 destdir
="`echo $$dest | sed 's,\(^\|/\)[^/]*$$,,g'`"; \
217 $(mkinstalldirs
) $(DESTDIR
)$(includedir)/$$destdir; \
218 if
test -f
"$$dir$$file"; then \
219 $(INSTALL_DATA
) $$dir$$file $(DESTDIR
)$(includedir)/$$dest; \
220 elif
test -L
"$$dir$$file"; then \
221 cp
-d
$$dir$$file $(DESTDIR
)$(includedir)/$$dest; \
224 $(mkinstalldirs
) $(DESTDIR
)$(pkgdatadir
)
225 @list
='$(PKGDATA)'; \
226 for file in
$$list; do \
227 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
228 dest
="`echo $$file | sed 's,.*/,,'`"; \
229 $(INSTALL_DATA
) $$dir$$file $(DESTDIR
)$(pkgdatadir
)/$$dest; \
231 $(mkinstalldirs
) $(DESTDIR
)$(bindir) $(DESTDIR
)$(mandir)/man1
232 @list
='$(bin_UTILITIES)'; for file in
$$list; do \
233 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
234 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
235 $(INSTALL_PROGRAM
) $$dir$$file $(DESTDIR
)$(bindir)/$$dest; \
236 $(HELP2MAN
) --section
=1 -o
$(DESTDIR
)$(mandir)/man1
/$$dest.1 $(builddir
)/$$file; \
238 $(mkinstalldirs
) $(DESTDIR
)$(sbindir
) $(DESTDIR
)$(mandir)/man8
239 @list
='$(sbin_UTILITIES)'; for file in
$$list; do \
240 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
241 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
242 $(INSTALL_PROGRAM
) $$dir$$file $(DESTDIR
)$(sbindir
)/$$dest; \
243 $(HELP2MAN
) --section
=8 -o
$(DESTDIR
)$(mandir)/man8
/$$dest.8 $(builddir
)/$$file; \
245 @list
='$(bin_SCRIPTS)'; 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_SCRIPT
) $$dir$$file $(DESTDIR
)$(bindir)/$$dest; \
249 $(HELP2MAN
) --section
=1 -o
$(DESTDIR
)$(mandir)/man1
/$$dest.1 $(builddir
)/$$file; \
251 @list
='$(sbin_SCRIPTS)'; for file in
$$list; do \
252 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
253 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
254 $(INSTALL_SCRIPT
) $$dir$$file $(DESTDIR
)$(sbindir
)/$$dest; \
255 $(HELP2MAN
) --section
=8 -o
$(DESTDIR
)$(mandir)/man8
/$$dest.8 $(builddir
)/$$file; \
257 $(mkinstalldirs
) $(DESTDIR
)$(sysconfdir
)/grub.d
258 @list
='$(grub-mkconfig_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
)$(sysconfdir
)/grub.d
/$$dest; \
263 @list
='$(grub-mkconfig_DATA)'; for file in
$$list; do \
264 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
265 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
266 $(INSTALL_DATA
) $$dir$$file $(DESTDIR
)$(sysconfdir
)/grub.d
/$$dest; \
268 $(mkinstalldirs
) $(DESTDIR
)$(libdir)/grub
269 @list
='$(lib_DATA)'; \
270 for file in
$$list; do \
271 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
272 dest
="`echo $$file | sed 's,.*/,,'`"; \
273 $(INSTALL_DATA
) $$dir$$file $(DESTDIR
)$(libdir)/grub
/$$dest; \
277 $(MAKE
) INSTALL_PROGRAM
="$(INSTALL_STRIP_PROGRAM)" install
281 for file in
$$list; do \
282 dest
="`echo $$file | sed 's,.*/,,'`"; \
283 rm -f
$(DESTDIR
)$(pkglibdir
)/$$dest; \
285 @list
='$(PKGDATA)'; \
286 for file in
$$list; do \
287 dest
="`echo $$file | sed 's,.*/,,'`"; \
288 rm -f
$(DESTDIR
)$(pkgdatadir
)/$$dest; \
290 @list
='$(bin_UTILITIES) $(bin_SCRIPTS)'; for file in
$$list; do \
291 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
292 rm -f
$(DESTDIR
)$(bindir)/$$dest; \
294 @list
='$(sbin_UTILITIES) $(sbin_SCRIPTS)'; for file in
$$list; do \
295 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
296 rm -f
$(DESTDIR
)$(sbindir
)/$$dest; \
298 @list
='$(grub-mkconfig_SCRIPTS) $(grub-mkconfig_DATA)'; for file in
$$list; do \
299 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
300 rm -f
$(DESTDIR
)$(sysconfdir
)/grub.d
/$$dest; \
304 -test -z
"$(CLEANFILES)" ||
rm -f
$(CLEANFILES
)
307 -test -z
"$(MOSTLYCLEANFILES)" ||
rm -f
$(MOSTLYCLEANFILES
)
309 distclean: mostlyclean
310 -test -z
"$(DISTCLEANFILES)" ||
rm -f
$(DISTCLEANFILES
)
311 -rm -rf
$(srcdir)/autom4te.cache
313 maintainer-clean
: distclean
314 -test -z
"$(MAINTAINER_CLEANFILES)" ||
rm -f
$(MAINTAINER_CLEANFILES
)
320 distdir
=$(PACKAGE_TARNAME
)-$(PACKAGE_VERSION
)
322 DISTLIST
: gendistlist.sh
323 sh
$(srcdir)/gendistlist.sh
> $(srcdir)/DISTLIST
326 -chmod
-R a
+w
$(distdir
) >/dev
/null
2>&1; rm -rf
$(distdir
)
327 $(mkinstalldirs
) $(distdir
)
328 for i in
`cat $(srcdir)/DISTLIST`; do \
329 dir=`echo "$$i" | sed 's:/[^/]*$$::'`; \
330 if
test -d
$(srcdir)/$$dir; then \
331 $(mkinstalldirs
) $(distdir
)/$$dir; \
333 cp
-p
$(srcdir)/$$i $(distdir
)/$$i || exit
1; \
335 chmod
-R a
+r
$(distdir
)
340 tar chof
- $(distdir
) | GZIP
=$(GZIP_ENV
) gzip
-c
>$(distdir
).
tar.gz
341 -chmod
-R a
+w
$(distdir
) >/dev
/null
2>&1; rm -rf
$(distdir
)
344 -chmod
-R a
+w
$(distdir
) >/dev
/null
2>&1; rm -rf
$(distdir
)
345 GZIP
=$(GZIP_ENV
) gzip
-cd
$(distdir
).
tar.gz |
tar xf
-
346 chmod
-R a-w
$(distdir
)
348 mkdir
$(distdir
)/=build
349 mkdir
$(distdir
)/=inst
351 dc_instdir
=`CDPATH=: && cd $(distdir)/=inst && pwd` \
352 && cd
$(distdir
)/=build \
353 && ..
/configure
--srcdir=..
--prefix=$$dc_instdir \
354 && $(MAKE
) all dvi check install && $(MAKE
) uninstall \
355 && (test `find $$dc_instdir -type f -print | wc -l` -le
1 \
356 ||
(echo
"Error: files left after uninstall" 1>&2; \
358 && $(MAKE
) dist && $(MAKE
) distclean \
359 && rm -f
$(distdir
).
tar.gz \
360 && (test `find . -type f -print | wc -l` -eq
0 \
361 ||
(echo
"Error: files left after distclean" 1>&2; \
363 -chmod
-R a
+w
$(distdir
) > /dev
/null
2>&1; rm -rf
$(distdir
)
364 @echo
"$(distdir).tar.gz is ready for distribution" | \
365 sed
'h;s/./=/g;p;x;p;x'
372 # Regenerate configure and Makefile automatically.
373 $(srcdir)/configure
: configure.ac aclocal.m4
374 cd
$(srcdir) && autoconf
376 $(srcdir)/config.h.in
: stamp-h.in
377 $(srcdir)/stamp-h.in
: configure.ac aclocal.m4
378 cd
$(srcdir) && autoheader
379 echo timestamp
> $(srcdir)/stamp-h.in
382 stamp-h
: config.h.in config.status
385 Makefile
: Makefile.in config.status
388 config.status
: configure
389 .
/config.status
--recheck
391 gensymlist.sh
: gensymlist.sh.in config.status
394 genkernsyms.sh
: genkernsyms.sh.in config.status
397 .PHONY
: all install install-strip
uninstall clean mostlyclean distclean
398 .PHONY
: maintainer-clean
info dvi dist check
400 # Prevent an overflow.