]> git.sur5r.net Git - kconfig-frontends/blob - libs/parser/Makefile.am
421799d0b98b12b78d9b664a61dd39cad73cbc6a
[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 EXTRA_DIST = yconf.y.patch
20
21 # Can't use libkconfig_parser_a_CPPFLAGS, as it breaks dependencies
22 yconf.o: CPPFLAGS+=$(intl_CPPFLAGS)
23
24 .gperf.c:
25         $(GPERF) -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<
26
27 # The following rule produces a warning:
28 #   libs/parser/Makefile.am:41: user target `.l.c' defined here...
29 #       /usr/share/automake-1.11/am/lex.am: ... overrides Automake target
30 #       `.l.c' defined here
31 #
32 # This is expected, and can't be avoided (for now).
33 # That's because, when working with lex+yacc sources, the default is to
34 # build each files searately, and then link them together into the final
35 # output. But the Linux kernel's parser simply #include-s the lexer,
36 # so we can't put lconf.l into the _SOURCES (it's in EXTRA_SOURCES),
37 # and thus automake does not catch the need to call lex.
38 # Secondly, when flex is told to change the symbols' prefix (kconfig
39 # uses zconf in lieue of the original yy), then the output file is
40 # also renamed, but automake does not now that, and make would fail
41 # because it would think no file was generated.
42 .l.c:
43         $(LEXCOMPILE) -o$@ $<