]> git.proxmox.com Git - grub2.git/blob - Makefile.am
add -lutil for netbsd
[grub2.git] / Makefile.am
1 AUTOMAKE_OPTIONS = subdir-objects
2
3 DEPDIR = .deps-util
4 SUBDIRS = . grub-core po docs
5 EXTRA_DIST = autogen.sh gentpl.py Makefile.tpl modules.def geninit.sh
6
7 include $(top_srcdir)/grub-core/Makefile.vars
8
9 CFLAGS_PROGRAM = $(HOST_CFLAGS) $(CFLAGS_GNULIB)
10 LDFLAGS_PROGRAM = $(HOST_LDFLAGS) $(LDFLAGS_GNULIB) $(LIBINTL) $(LIBUTIL)
11 CPPFLAGS_PROGRAM = $(HOST_CPPFLAGS) $(CPPFLAGS_GNULIB)
12 CCASFLAGS_PROGRAM = $(HOST_CCASFLAGS) $(CCASFLAGS_GNULIB)
13
14 CFLAGS_LIBRARY = $(CFLAGS_PROGRAM)
15 CPPFLAGS_LIBRARY = $(CPPFLAGS_PROGRAM)
16 CCASFLAGS_LIBRARY = $(CCASFLAGS_PROGRAM)
17
18 AM_CFLAGS =
19 AM_LDFLAGS =
20 AM_CPPFLAGS = $(CPPFLAGS_GRUB)
21 AM_CCASFLAGS = $(CCASFLAGS_GRUB)
22
23 include $(srcdir)/modules.am
24
25 # XXX Use Automake's LEX & YACC support
26 grub_script.tab.c grub_script.tab.h: $(top_srcdir)/grub-core/script/parser.y
27 $(YACC) -d -p grub_script_yy -b grub_script $(top_srcdir)/grub-core/script/parser.y
28 CLEANFILES += grub_script.tab.c grub_script.tab.h
29
30 # For the lexer.
31 grub_script.yy.c grub_script.yy.h: $(top_srcdir)/grub-core/script/yylex.l
32 $(LEX) -o grub_script.yy.c --header-file=grub_script.yy.h $(top_srcdir)/grub-core/script/yylex.l
33 CLEANFILES += grub_script.yy.c grub_script.yy.h
34
35 # For libgrub.a
36 libgrub.pp: grub_script.tab.h grub_script.yy.h $(libgrub_a_SOURCES)
37 $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrub_a_CPPFLAGS) $(CPPFLAGS) \
38 -D'GRUB_MOD_INIT(x)=@MARKER@x@' $^ > $@ || (rm -f $@; exit 1)
39 CLEANFILES += libgrub.pp
40
41 libgrub_a_init.lst: libgrub.pp
42 cat $< | grep '@MARKER@' | sed 's/@MARKER@\(.*\)@/\1/g' | sort -u > $@ || (rm -f $@; exit 1)
43 CLEANFILES += libgrub_a_init.lst
44
45 libgrub_a_init.c: libgrub_a_init.lst $(top_srcdir)/geninit.sh
46 sh $(top_srcdir)/geninit.sh `cat $<` > $@ || (rm -f $@; exit 1)
47 CLEANFILES += libgrub_a_init.c
48
49 if COND_GRUB_MKFONT
50 if COND_HAVE_FONT_SOURCE
51 pkgdata_DATA = unicode.pf2 ascii.pf2 ascii.h
52 endif
53 endif
54
55 unicode.pf2: $(FONT_SOURCE) grub-mkfont
56 $(builddir)/grub-mkfont -o $@ $(FONT_SOURCE)
57 CLEANFILES += unicode.pf2
58
59 # Arrows and lines are needed to draw the menu, so always include them
60 UNICODE_ARROWS=0x2190-0x2193
61 UNICODE_LINES=0x2501-0x251B
62
63 ascii.pf2: $(FONT_SOURCE) grub-mkfont
64 $(builddir)/grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES)
65 CLEANFILES += ascii.pf2
66
67 ascii.bitmaps: $(FONT_SOURCE) grub-mkfont
68 $(builddir)/grub-mkfont --ascii-bitmaps -o $@ $(FONT_SOURCE)
69 CLEANFILES += ascii.bitmaps
70
71 ascii.h: ascii.bitmaps grub-bin2h
72 $(builddir)/grub-bin2h ascii_bitmaps < $< > $@
73 cp $@ $(top_builddir)/grub-core/include
74 CLEANFILES += ascii.h $(top_builddir)/grub-core/include/ascii.h
75
76 # Install config.h into platformdir
77 platform_HEADERS = config.h