]> git.sur5r.net Git - kconfig-frontends/blob - libs/parser/Makefile.am
123982a960b56b0cf9033ce8281c2f8f99b3f461
[kconfig-frontends] / libs / parser / Makefile.am
1 SUFFIXES = .gperf
2
3 lib_LTLIBRARIES = libkconfig-parser.la
4 libkconfig_parser_la_SOURCES = yconf.y
5 dist_EXTRA_libkconfig_parser_la_SOURCES = \
6     hconf.gperf lconf.l                   \
7     confdata.c menu.c symbol.c util.c     \
8     expr.c expr.h lkc.h lkc_proto.h
9 libkconfig_parser_la_CPPFLAGS = -DROOTMENU="\"$(root_menu)\""   \
10                                 -DCONFIG_=\"$(config_prefix)\"
11 libkconfig_parser_la_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS)
12 libkconfig_parser_la_LDFLAGS = -release $(KCONFIGPARSER_LIB_VERSION)
13
14 kconfig_includedir = $(includedir)/kconfig
15 kconfig_include_HEADERS = lkc.h expr.h lkc_proto.h
16
17 BUILT_SOURCES = hconf.c lconf.c
18 CLEANFILES = hconf.c lconf.c yconf.c
19
20 # Can't use libkconfig_parser_a_CPPFLAGS, as it breaks dependencies
21 yconf.o: CPPFLAGS+=$(GETTEXT)
22
23 .gperf.c:
24         $(GPERF) -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<
25
26 # The following rule produces a warning:
27 #   libs/parser/Makefile.am:41: user target `.l.c' defined here...
28 #       /usr/share/automake-1.11/am/lex.am: ... overrides Automake target
29 #       `.l.c' defined here
30 #
31 # This is expected, and can't be avoided (for now).
32 # That's because, when working with lex+yacc sources, the default is to
33 # build each files searately, and then link them together into the final
34 # output. But the Linux kernel's parser simply #include-s the lexer,
35 # so we can't put lconf.l into the _SOURCES (it's in EXTRA_SOURCES),
36 # and thus automake does not catch the need to call lex.
37 # Secondly, when flex is told to change the symbols' prefix (kconfig
38 # uses zconf in lieue of the original yy), then the output file is
39 # also renamed, but automake does not now that, and make would fail
40 # because it would think no file was generated.
41 .l.c:
42         $(LEXCOMPILE) -o$@ $<