diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2014-07-28 16:20:04 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-08-01 11:24:26 +0800 |
commit | c43847fe14e6b32cc58b8e8168f78e72ef94316d (patch) | |
tree | 4593c0e9d6adc4af40450a92aa4414109f9d29a4 /discover/grub2 | |
parent | 6c0dd46749cd791f3923e0d60f41d7a5e1033945 (diff) | |
download | talos-petitboot-c43847fe14e6b32cc58b8e8168f78e72ef94316d.tar.gz talos-petitboot-c43847fe14e6b32cc58b8e8168f78e72ef94316d.zip |
autotools: Use non-recursive make
With the current testing infrastructure, we don't have a strictly
hierarchical set of dependencies. This causes problems with a recursive
make, and means we have to hack around some of the dependencies.
This change generates a single, top-level makefile from all of the
Makefile.am fragments. We still need the po/ directory as a separate
SUBDIR, but all others can be converted to non-recursive.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/grub2')
-rw-r--r-- | discover/grub2/Makefile.am | 62 | ||||
-rw-r--r-- | discover/grub2/lexer.l | 2 |
2 files changed, 36 insertions, 28 deletions
diff --git a/discover/grub2/Makefile.am b/discover/grub2/Makefile.am index 2efc7f3..dda6835 100644 --- a/discover/grub2/Makefile.am +++ b/discover/grub2/Makefile.am @@ -12,39 +12,49 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir) $(DEFAULT_CPPFLAGS) +noinst_PROGRAMS += discover/grub2/grub2-parser.ro -AM_CFLAGS = $(DEFAULT_CFLAGS) \ - -DPREFIX='"$(prefix)"' \ - -DPKG_SHARE_DIR='"$(pkgdatadir)"' \ - -DPKG_SYSCONF_DIR='"$(pkgsysconfdir)"' \ - -DLOCAL_STATE_DIR='"$(localstatedir)"' +discover/grub2/grub2-parser.ro$(EXEEXT): \ + $(discover_grub2_grub2_parser_ro_OBJECTS) + $(LD) -r -o $@ $^ -AM_YFLAGS = -d +discover_grub2_grub2_parser_ro_SOURCES = \ + discover/grub2/builtins.c \ + discover/grub2/env.c \ + discover/grub2/grub2.h \ + discover/grub2/grub2.c \ + discover/grub2/lexer.l \ + discover/grub2/parser.y \ + discover/grub2/script.c -noinst_PROGRAMS = grub2-parser.ro +BUILT_SOURCES += \ + discover/grub2/parser.c \ + discover/grub2/parser.h \ + discover/grub2/lexer.h \ + discover/grub2/lexer.c -grub2-parser.ro$(EXEEXT): $(grub2_parser_ro_OBJECTS) - $(LD) -r -o $@ $^ +CLEANFILES += \ + discover/grub2/parser.c \ + discover/grub2/parser.h \ + discover/grub2/lexer.c \ + discover/grub2/lexer.h -grub2_parser_ro_SOURCES = \ - builtins.c \ - env.c \ - grub2.h \ - grub2.c \ - lexer.l \ - parser.y \ - script.c \ - parser.c +discover_grub2_grub2_parser_ro_CPPFLAGS = \ + $(AM_CPPFLAGS) \ + -I$(top_srcdir)/discover/grub2 \ + -I$(top_builddir)/discover/grub2 -BUILT_SOURCES = parser.h lexer.h lexer.c lexer.h -CLEANFILES = lexer.c lexer.h -MAINTAINERCLEANFILES = Makefile.in # ylwrap doesn't handle flex header files well; use our own rule here. -lexer.h lexer.c: lexer.l - $(LEX) $(LFLAGS) --header-file=lexer.h -o lexer.c $^ +discover/grub2/lexer.h discover/grub2/lexer.c: \ + $(top_srcdir)/discover/grub2/lexer.l + $(AM_V_LEX)$(LEXCOMPILE) --header-file=discover/grub2/lexer.h \ + -o discover/grub2/lexer.c $^ + +# We need to loosen our warnings for the generated lexer code. +discover/grub2/%lexer.o discover/grub2/lexer.o: \ + AM_CFLAGS += -Wno-unused-parameter -Wno-missing-prototypes \ + -Wno-missing-declarations -lexer.o: CFLAGS+=-Wno-unused-parameter -Wno-missing-prototypes \ - -Wno-missing-declarations +$(discover_grub2_grub2_parser_ro_OBJECTS): discover/grub2/parser.h diff --git a/discover/grub2/lexer.l b/discover/grub2/lexer.l index e1aad99..e557146 100644 --- a/discover/grub2/lexer.l +++ b/discover/grub2/lexer.l @@ -17,8 +17,6 @@ void yyerror(struct grub2_parser *parser, const char *fmt, ...); %option yylineno %option noyyalloc noyyfree noyyrealloc %option extra-type="struct grub2_parser *" -%option header-file="lexer.h" -%option outfile="lexer.c" %x sqstring %x dqstring |