3 # Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006,2007 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@
50 target_cpu
= @target_cpu@
51 target_os
= @target_os@
55 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
56 INSTALL_DATA
= @INSTALL_DATA@
57 INSTALL_SCRIPT
= @INSTALL_SCRIPT@
58 INSTALL_STRIP_PROGRAM
= @INSTALL_STRIP_PROGRAM@
60 mkinstalldirs
= $(srcdir)/mkinstalldirs
65 CPPFLAGS
= @CPPFLAGS@
-I
$(builddir
) -I
$(builddir
)/include -I
$(srcdir)/include -Wall
-W \
66 -DGRUB_LIBDIR
=\"$(pkglibdir
)\"
67 TARGET_CC
= @TARGET_CC@
68 TARGET_CFLAGS
= @TARGET_CFLAGS@
69 TARGET_CPPFLAGS
= @TARGET_CPPFLAGS@
-I
$(builddir
) -I
$(builddir
)/include -I
$(srcdir)/include \
71 TARGET_LDFLAGS
= @TARGET_LDFLAGS@
72 TARGET_IMG_LDSCRIPT
= @TARGET_IMG_LDSCRIPT@
73 TARGET_IMG_LDFLAGS
= @TARGET_IMG_LDFLAGS@
74 TARGET_OBJ2ELF
= @TARGET_OBJ2ELF@
75 MODULE_LDFLAGS
= @MODULE_LDFLAGS@
85 HELP2MAN
:= LANG
=C
$(HELP2MAN
) --no-info
--source
=FSF
88 LIBCURSES
= @LIBCURSES@
91 UNIFONT_HEX
= @UNIFONT_HEX@
94 enable_grub_emu
= @enable_grub_emu@
95 enable_grub_fstest
= @enable_grub_fstest@
96 enable_grub_pe2elf
= @enable_grub_pe2elf@
97 enable_lzo
= @enable_lzo@
99 ### General variables.
101 RMKFILES
= $(addprefix conf
/,common.rmk i386-coreboot.rmk i386-efi.rmk \
102 i386-ieee1275.rmk i386-pc.rmk i386.rmk powerpc-ieee1275.rmk \
103 sparc64-ieee1275.rmk x86_64-efi.rmk
)
105 MKFILES
= $(patsubst %.rmk
,%.mk
,$(RMKFILES
))
107 PKGLIB
= $(pkglib_IMAGES
) $(pkglib_MODULES
) $(pkglib_PROGRAMS
) \
108 $(pkglib_DATA
) $(lib_DATA
) $(pkglib_BUILDDIR
)
109 PKGDATA
= $(pkgdata_DATA
) $(pkgdata_SRCDIR
)
110 PROGRAMS
= $(bin_UTILITIES
) $(sbin_UTILITIES
)
111 SCRIPTS
= $(bin_SCRIPTS
) $(sbin_SCRIPTS
) $(grub-mkconfig_SCRIPTS
)
115 DISTCLEANFILES
= config.status config.cache config.log config.h \
116 Makefile stamp-h
include/grub
/cpu
include/grub
/machine \
117 gensymlist.sh genkernsyms.sh build_env.mk
118 MAINTAINER_CLEANFILES
= $(srcdir)/configure
$(addprefix $(srcdir)/,$(MKFILES
))
120 # The default target.
123 ### Include an arch-specific Makefile.
124 $(addprefix $(srcdir)/,$(MKFILES
)): %.mk
: %.rmk genmk.rb
125 if
test "x$(RUBY)" = x
; then \
128 $(RUBY
) $(srcdir)/genmk.rb
< $< > $@
; \
131 include $(srcdir)/conf
/$(target_cpu
)-$(platform
).mk
135 CLEANFILES
+= $(pkglib_DATA
) $(pkgdata_DATA
)
136 pkglib_DATA
+= moddep.lst command.lst fs.lst partmap.lst
137 moddep.lst
: $(DEFSYMFILES
) $(UNDSYMFILES
) genmoddep.awk
138 cat
$(DEFSYMFILES
) /dev
/null \
139 |
$(AWK
) -f
$(srcdir)/genmoddep.awk
$(UNDSYMFILES
) > $@ \
140 ||
(rm -f
$@
; exit
1)
142 command.lst
: $(COMMANDFILES
)
143 cat
$^
/dev
/null |
sort > $@
146 cat
$^
/dev
/null |
sort > $@
148 partmap.lst
: $(PARTMAPFILES
)
149 cat
$^
/dev
/null |
sort > $@
151 ifeq (, $(UNIFONT_HEX
))
153 pkgdata_DATA
+= unicode.pff ascii.pff
155 # Arrows and lines are needed to draw the menu, so we always include them
156 UNICODE_ARROWS
=0x2190-0x2193
157 UNICODE_LINES
=0x2501-0x251B
159 unicode.pff
: $(UNIFONT_HEX
)
160 ruby
$(srcdir)/util
/unifont2pff.rb
$(UNIFONT_HEX
) > $@
162 ascii.pff
: $(UNIFONT_HEX
)
163 ruby
$(srcdir)/util
/unifont2pff.rb
0x0-0x7f $(UNICODE_ARROWS
) $(UNICODE_LINES
) $(UNIFONT_HEX
) > $@
166 # Used for building modules externally
167 pkglib_BUILDDIR
+= build_env.mk
168 build_env.mk
: Makefile
170 echo
"TARGET_CC=$(TARGET_CC)" ; \
171 echo
"TARGET_CFLAGS=$(TARGET_CFLAGS)" ; \
172 echo
"TARGET_CPPFLAGS=$(TARGET_CPPFLAGS) -I$(pkglibdir)" ; \
173 echo
"STRIP=$(STRIP)" ; \
174 echo
"COMMON_ASFLAGS=$(COMMON_ASFLAGS)" ; \
175 echo
"COMMON_CFLAGS=$(COMMON_CFLAGS)" ; \
176 echo
"COMMON_LDFLAGS=$(COMMON_LDFLAGS)"\
178 pkglib_BUILDDIR
+= config.h grub_script.tab.h
179 pkgdata_SRCDIR
+= genmodsrc.sh genmk.rb
180 include_DATA
+= $(shell find
$(srcdir)/include -name \
*.h | sed
-e
"s,^$(srcdir)/,,g") include/grub
/cpu
182 all-local
: $(PROGRAMS
) $(PKGLIB
) $(PKGDATA
) $(SCRIPTS
) $(MKFILES
)
184 install: install-local
187 $(mkinstalldirs
) $(DESTDIR
)$(pkglibdir
)
189 for file in
$$list; do \
190 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
191 dest
="`echo $$file | sed 's,.*/,,'`"; \
192 $(INSTALL_DATA
) $$dir$$file $(DESTDIR
)$(pkglibdir
)/$$dest; \
194 $(mkinstalldirs
) $(DESTDIR
)$(includedir)
195 @list
='$(include_DATA)'; \
196 for file in
$$list; do \
197 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
198 dest
="`echo $$file | sed 's,include/,,'`"; \
199 destdir
="`echo $$dest | sed 's,\(^\|/\)[^/]*$$,,g'`"; \
200 $(mkinstalldirs
) $(DESTDIR
)$(includedir)/$$destdir; \
201 if
test -f
"$$dir$$file"; then \
202 $(INSTALL_DATA
) $$dir$$file $(DESTDIR
)$(includedir)/$$dest; \
203 elif
test -L
"$$dir$$file"; then \
204 cp
-d
$$dir$$file $(DESTDIR
)$(includedir)/$$dest; \
207 $(mkinstalldirs
) $(DESTDIR
)$(pkgdatadir
)
208 @list
='$(PKGDATA)'; \
209 for file in
$$list; do \
210 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
211 dest
="`echo $$file | sed 's,.*/,,'`"; \
212 $(INSTALL_DATA
) $$dir$$file $(DESTDIR
)$(pkgdatadir
)/$$dest; \
214 $(mkinstalldirs
) $(DESTDIR
)$(bindir) $(DESTDIR
)$(mandir)/man1
215 @list
='$(bin_UTILITIES)'; for file in
$$list; do \
216 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
217 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
218 $(INSTALL_PROGRAM
) $$dir$$file $(DESTDIR
)$(bindir)/$$dest; \
219 $(HELP2MAN
) --section
=1 $(builddir
)/$$file > $(DESTDIR
)$(mandir)/man1
/$$dest.1; \
221 $(mkinstalldirs
) $(DESTDIR
)$(sbindir
) $(DESTDIR
)$(mandir)/man8
222 @list
='$(sbin_UTILITIES)'; for file in
$$list; do \
223 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
224 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
225 $(INSTALL_PROGRAM
) $$dir$$file $(DESTDIR
)$(sbindir
)/$$dest; \
226 $(HELP2MAN
) --section
=8 $(builddir
)/$$file > $(DESTDIR
)$(mandir)/man8
/$$dest.8; \
228 @list
='$(bin_SCRIPTS)'; for file in
$$list; do \
229 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
230 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
231 $(INSTALL_SCRIPT
) $$dir$$file $(DESTDIR
)$(bindir)/$$dest; \
232 $(HELP2MAN
) --section
=1 $(builddir
)/$$file > $(DESTDIR
)$(mandir)/man1
/$$dest.1; \
234 @list
='$(sbin_SCRIPTS)'; for file in
$$list; do \
235 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
236 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
237 $(INSTALL_SCRIPT
) $$dir$$file $(DESTDIR
)$(sbindir
)/$$dest; \
238 $(HELP2MAN
) --section
=8 $(builddir
)/$$file > $(DESTDIR
)$(mandir)/man8
/$$dest.8; \
240 $(mkinstalldirs
) $(DESTDIR
)$(sysconfdir
)/grub.d
241 @list
='$(grub-mkconfig_SCRIPTS)'; for file in
$$list; do \
242 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
243 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
244 $(INSTALL_SCRIPT
) $$dir$$file $(DESTDIR
)$(sysconfdir
)/grub.d
/$$dest; \
246 @list
='$(grub-mkconfig_DATA)'; for file in
$$list; do \
247 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
248 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
249 $(INSTALL_DATA
) $$dir$$file $(DESTDIR
)$(sysconfdir
)/grub.d
/$$dest; \
251 $(mkinstalldirs
) $(DESTDIR
)$(libdir)/grub
252 @list
='$(lib_DATA)'; \
253 for file in
$$list; do \
254 if
test -f
"$$file"; then
dir=; else dir="$(srcdir)/"; fi
; \
255 dest
="`echo $$file | sed 's,.*/,,'`"; \
256 $(INSTALL_DATA
) $$dir$$file $(DESTDIR
)$(libdir)/grub
/$$dest; \
260 $(MAKE
) INSTALL_PROGRAM
="$(INSTALL_STRIP_PROGRAM)" install
264 for file in
$$list; do \
265 dest
="`echo $$file | sed 's,.*/,,'`"; \
266 rm -f
$(DESTDIR
)$(pkglibdir
)/$$dest; \
268 @list
='$(PKGDATA)'; \
269 for file in
$$list; do \
270 dest
="`echo $$file | sed 's,.*/,,'`"; \
271 rm -f
$(DESTDIR
)$(pkgdatadir
)/$$dest; \
273 @list
='$(bin_UTILITIES) $(bin_SCRIPTS)'; for file in
$$list; do \
274 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
275 rm -f
$(DESTDIR
)$(bindir)/$$dest; \
277 @list
='$(sbin_UTILITIES) $(sbin_SCRIPTS)'; for file in
$$list; do \
278 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
279 rm -f
$(DESTDIR
)$(sbindir
)/$$dest; \
281 @list
='$(grub-mkconfig_SCRIPTS) $(grub-mkconfig_DATA)'; for file in
$$list; do \
282 dest
="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
283 rm -f
$(DESTDIR
)$(sysconfdir
)/grub.d
/$$dest; \
287 -test -z
"$(CLEANFILES)" ||
rm -f
$(CLEANFILES
)
290 -test -z
"$(MOSTLYCLEANFILES)" ||
rm -f
$(MOSTLYCLEANFILES
)
292 distclean: mostlyclean
293 -test -z
"$(DISTCLEANFILES)" ||
rm -f
$(DISTCLEANFILES
)
294 -rm -rf
$(srcdir)/autom4te.cache
296 maintainer-clean
: distclean
297 -test -z
"$(MAINTAINER_CLEANFILES)" ||
rm -f
$(MAINTAINER_CLEANFILES
)
303 distdir
=$(PACKAGE_TARNAME
)-$(PACKAGE_VERSION
)
305 DISTLIST
: gendistlist.sh
306 sh
$(srcdir)/gendistlist.sh
> $(srcdir)/DISTLIST
309 -chmod
-R a
+w
$(distdir
) >/dev
/null
2>&1; rm -rf
$(distdir
)
310 $(mkinstalldirs
) $(distdir
)
311 for i in
`cat $(srcdir)/DISTLIST`; do \
312 dir=`echo "$$i" | sed 's:/[^/]*$$::'`; \
313 if
test -d
$(srcdir)/$$dir; then \
314 $(mkinstalldirs
) $(distdir
)/$$dir; \
316 cp
-p
$(srcdir)/$$i $(distdir
)/$$i || exit
1; \
318 chmod
-R a
+r
$(distdir
)
323 tar chof
- $(distdir
) | GZIP
=$(GZIP_ENV
) gzip
-c
>$(distdir
).
tar.gz
324 -chmod
-R a
+w
$(distdir
) >/dev
/null
2>&1; rm -rf
$(distdir
)
327 -chmod
-R a
+w
$(distdir
) >/dev
/null
2>&1; rm -rf
$(distdir
)
328 GZIP
=$(GZIP_ENV
) gzip
-cd
$(distdir
).
tar.gz |
tar xf
-
329 chmod
-R a-w
$(distdir
)
331 mkdir
$(distdir
)/=build
332 mkdir
$(distdir
)/=inst
334 dc_instdir
=`CDPATH=: && cd $(distdir)/=inst && pwd` \
335 && cd
$(distdir
)/=build \
336 && ..
/configure
--srcdir=..
--prefix=$$dc_instdir \
337 && $(MAKE
) all dvi check install && $(MAKE
) uninstall \
338 && (test `find $$dc_instdir -type f -print | wc -l` -le
1 \
339 ||
(echo
"Error: files left after uninstall" 1>&2; \
341 && $(MAKE
) dist && $(MAKE
) distclean \
342 && rm -f
$(distdir
).
tar.gz \
343 && (test `find . -type f -print | wc -l` -eq
0 \
344 ||
(echo
"Error: files left after distclean" 1>&2; \
346 -chmod
-R a
+w
$(distdir
) > /dev
/null
2>&1; rm -rf
$(distdir
)
347 @echo
"$(distdir).tar.gz is ready for distribution" | \
348 sed
'h;s/./=/g;p;x;p;x'
355 # Regenerate configure and Makefile automatically.
356 $(srcdir)/configure
: configure.ac aclocal.m4
357 cd
$(srcdir) && autoconf
359 $(srcdir)/config.h.in
: stamp-h.in
360 $(srcdir)/stamp-h.in
: configure.ac aclocal.m4
361 cd
$(srcdir) && autoheader
362 echo timestamp
> $(srcdir)/stamp-h.in
365 stamp-h
: config.h.in config.status
368 Makefile
: Makefile.in config.status
371 config.status
: configure
372 .
/config.status
--recheck
374 gensymlist.sh
: gensymlist.sh.in config.status
377 genkernsyms.sh
: genkernsyms.sh.in config.status
380 .PHONY
: all install install-strip
uninstall clean mostlyclean distclean
381 .PHONY
: maintainer-clean
info dvi dist check
383 # Prevent an overflow.