]> git.sur5r.net Git - kconfig-frontends/blob - Makefile.am
Makefile: ensure parser directory exists
[kconfig-frontends] / Makefile.am
1 ACLOCAL_AMFLAGS = -I scripts/.autostuff/m4
2 MAKEFLAGS = $(SILENT_MAKEFLAGS_$(V))
3 SILENT_MAKEFLAGS_ = $(SILENT_MAKEFLAGS_$(AM_DEFAULT_VERBOSITY))
4 SILENT_MAKEFLAGS_0 = --no-print-directory -s
5 SILENT_MAKEFLAGS_1 =
6
7 EXTRA_DIST = .version
8
9 bin_PROGRAMS =
10 bin_SCRIPTS =
11 dist_bin_SCRIPTS =
12
13 lib_LTLIBRARIES =
14 noinst_LIBRARIES =
15
16 CLEANFILES =
17 DISTCLEANFILES =
18 MAINTAINERCLEANFILES =
19 BUILT_SOURCES =
20
21 #===============================================================================
22 # Docs
23 dist_doc_DATA = \
24         docs/kconfig-language.txt \
25         docs/kconfig.txt
26
27 #===============================================================================
28 # Libraries
29
30 SUFFIXES = .gperf
31
32 lib_LTLIBRARIES += libs/parser/libkconfig-parser.la
33 libs_parser_libkconfig_parser_la_SOURCES = libs/parser/yconf.y
34 dist_EXTRA_libs_parser_libkconfig_parser_la_SOURCES = \
35         libs/parser/hconf.gperf \
36         libs/parser/lconf.l \
37         libs/parser/confdata.c \
38         libs/parser/menu.c \
39         libs/parser/symbol.c \
40         libs/parser/util.c \
41         libs/parser/expr.c \
42         libs/parser/expr.h \
43         libs/parser/lkc.h \
44         libs/parser/lkc_proto.h
45 libs_parser_libkconfig_parser_la_CPPFLAGS = \
46         -DROOTMENU="\"$(root_menu)\"" \
47         -DCONFIG_=\"$(config_prefix)\" \
48         -DGPERF_LEN_TYPE="$(GPERF_LEN_TYPE)" \
49         $(intl_CPPFLAGS) \
50         -I$(top_srcdir)/libs/parser \
51         -I$(top_builddir)/libs/parser
52 libs_parser_libkconfig_parser_la_CFLAGS = \
53         $(AM_CFLAGS) \
54         $(kf_CFLAGS)
55 libs_parser_libkconfig_parser_la_LDFLAGS = \
56         -release $(KCONFIGPARSER_LIB_VERSION) \
57         -no-undefined
58 libs_parser_libkconfig_parser_la_LIBADD = $(intl_LIBS)
59
60 libs_parser_kconfig_includedir = $(includedir)/kconfig
61 libs_parser_kconfig_include_HEADERS = \
62         libs/parser/list.h \
63         libs/parser/lkc.h \
64         libs/parser/expr.h \
65         libs/parser/lkc_proto.h
66
67 AM_V_GPERF = $(AM_V_GPERF_$(V))
68 AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
69 AM_V_GPERF_0 = @echo "  GPERF   " $@;
70 AM_V_GPERF_1 =
71
72 # In theory, the destination directory already exists, because there is at
73 # least the .pc file created by configure, but better safe than sorry, so
74 # we create the directory now.
75 .gperf.c:
76         $(MKDIR_P) $(@D)
77         $(AM_V_GPERF)$(GPERF) -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<
78
79 # The following rule may produce a warning with some versions of automake:
80 #   Makefile.am:85: user target `.l.c' defined here...
81 #   /usr/share/automake-1.11/am/lex.am: ... overrides Automake target
82 #   `.l.c' defined here
83 #
84 # This is expected, and can't be avoided (for now).
85 # That's because, when working with lex+yacc sources, the default is to
86 # build each files searately, and then link them together into the final
87 # output. But the Linux kernel's parser simply #include-s the lexer,
88 # so we can't put lconf.l into the _SOURCES (it's in EXTRA_SOURCES),
89 # and thus automake does not catch the need to call lex.
90 # Secondly, when flex is told to change the symbols' prefix (kconfig
91 # uses zconf in lieue of the original yy), then the output file is
92 # also renamed, but automake does not now that, and make would fail
93 # because it would think no file was generated.
94 #
95 # In theory, the destination directory already exists, because there is at
96 # least the .pc file created by configure, but better safe than sorry, so
97 # we create the directory now.
98 .l.c:
99         $(MKDIR_P) $(@D)
100         $(AM_V_LEX)$(LEXCOMPILE) -o$@ $<
101
102 # yconf.c not listed, because it is the real _SOURCES, but others are
103 # in _EXTRA_SOURCES (above), so must be listed:
104 BUILT_SOURCES += \
105         libs/parser/hconf.c \
106         libs/parser/lconf.c
107 # Still, .c files generated from .y files are not cleaned by default,
108 # so yconf.c must be explicitly listed:
109 MAINTAINERCLEANFILES += \
110         libs/parser/hconf.c \
111         libs/parser/lconf.c \
112         libs/parser/yconf.c
113 EXTRA_DIST += \
114         libs/parser/hconf.c \
115         libs/parser/hconf.gperf.patch \
116         libs/parser/yconf.y.patch
117
118 # libs/parser/kconfig-parser.pc generated by AC_CONFIG_FILES in configure.ac
119 pkgconfigdir = $(libdir)/pkgconfig
120 pkgconfig_DATA = libs/parser/kconfig-parser.pc
121 DISTCLEANFILES += libs/parser/kconfig-parser.pc
122 EXTRA_DIST += libs/parser/kconfig-parser.pc.in
123
124 #--------------------------
125 # lxdialog lib (for mconf)
126 if COND_lxdialog
127
128 noinst_LIBRARIES += libs/lxdialog/libkconfig-lxdialog.a
129
130 libs_lxdialog_libkconfig_lxdialog_a_SOURCES = \
131         libs/lxdialog/checklist.c \
132         libs/lxdialog/dialog.h \
133         libs/lxdialog/inputbox.c \
134         libs/lxdialog/menubox.c \
135         libs/lxdialog/textbox.c \
136         libs/lxdialog/util.c \
137         libs/lxdialog/yesno.c
138 libs_lxdialog_libkconfig_lxdialog_a_CPPFLAGS = \
139         $(AM_CPPFLAGS) \
140         $(ncurses_mconf_CPPFLAGS) \
141         $(intl_CPPFLAGS)
142 libs_lxdialog_liblxdialog_a_CFLAGS = \
143         $(AM_CFLAGS) \
144         $(kf_CFLAGS)
145
146 endif # COND_lxdialog
147
148 #--------------------------
149 # kconfig meta frontend
150 if COND_images
151
152 noinst_LIBRARIES += libs/images/libkconfig-images.a
153
154 libs_images_libkconfig_images_a_SOURCES = libs/images/images.c_orig
155 nodist_libs_images_libkconfig_images_a_SOURCES = libs/images/images.c
156
157 libs/images/images.c: libs/images/images.c_orig
158         $(AM_V_GEN)$(SED) -e 's/^static //' $< >$@
159
160 libs/images/images.h: libs/images/images.c_orig
161         $(AM_V_GEN)$(SED) -e '/^static \(const char \*xpm_\(.\{1,\}\)\[\]\) = {/!d; s//extern \1;/' \
162                 $< >$@
163
164 BUILT_SOURCES += \
165         libs/images/images.c \
166         libs/images/images.h
167 CLEANFILES += \
168         libs/images/images.c \
169         libs/images/images.h
170
171 endif # COND_images
172
173 #===============================================================================
174 # Frontends
175
176 #--------------------------
177 # kconfig meta frontend
178 if COND_kconfig
179
180 bin_SCRIPTS += frontends/kconfig
181
182 frontends/kconfig: frontends/kconfig.in
183         $(MKDIR_P) $(@D)
184         $(AM_V_GEN)$(SED) -e 's/@KCFG_LIST@/$(kcfg_list)/g' \
185                 $< >$@
186         @chmod +x $@
187
188 EXTRA_DIST += frontends/kconfig.in
189
190 endif # COND_kconfig
191
192 #--------------------------
193 # conf frontend
194 if COND_conf
195
196 bin_PROGRAMS += frontends/conf/kconfig-conf
197
198 frontends_conf_kconfig_conf_SOURCES = frontends/conf/conf.c
199 frontends_conf_kconfig_conf_CPPFLAGS = \
200         $(AM_CPPFLAGS) \
201         $(intl_CPPFLAGS) \
202         -I$(top_srcdir)/libs/parser
203 frontends_conf_kconfig_conf_CFLAGS = \
204         $(AM_CFLAGS) \
205         $(kf_CFLAGS)
206 frontends_conf_kconfig_conf_LDADD = \
207         $(top_builddir)/libs/parser/libkconfig-parser.la \
208         $(intl_LIBS) \
209         $(conf_EXTRA_LIBS)
210
211 endif # COND_conf
212
213 #--------------------------
214 # mconf frontend
215 if COND_mconf
216
217 bin_PROGRAMS += frontends/mconf/kconfig-mconf
218
219 frontends_mconf_kconfig_mconf_SOURCES = frontends/mconf/mconf.c
220 frontends_mconf_kconfig_mconf_CPPFLAGS = \
221         $(AM_CPPFLAGS) \
222         $(ncurses_mconf_CPPFLAGS) \
223         $(intl_CPPFLAGS) \
224         -I$(top_srcdir)/libs \
225         -I$(top_srcdir)/libs/parser
226 frontends_mconf_kconfig_mconf_CFLAGS = \
227         $(AM_CFLAGS) \
228         $(kf_CFLAGS)
229 frontends_mconf_kconfig_mconf_LDADD = \
230         $(top_builddir)/libs/parser/libkconfig-parser.la \
231         $(top_builddir)/libs/lxdialog/libkconfig-lxdialog.a \
232         $(intl_LIBS) $(ncurses_LIBS) $(mconf_EXTRA_LIBS)
233
234 endif # COND_mconf
235
236 #--------------------------
237 # nconf frontend
238 if COND_nconf
239
240 bin_PROGRAMS += frontends/nconf/kconfig-nconf
241
242 frontends_nconf_kconfig_nconf_SOURCES = \
243         frontends/nconf/nconf.c \
244         frontends/nconf/nconf.gui.c \
245         frontends/nconf/nconf.h
246 frontends_nconf_kconfig_nconf_CPPFLAGS = \
247         $(AM_CPPFLAGS) \
248         $(intl_CPPFLAGS) \
249         $(ncurses_nconf_CPPFLAGS) \
250         -I$(top_srcdir)/libs/parser
251 frontends_nconf_kconfig_nconf_CFLAGS = \
252         $(AM_CFLAGS) \
253         $(kf_CFLAGS)
254 frontends_nconf_kconfig_nconf_LDADD = \
255         $(top_builddir)/libs/parser/libkconfig-parser.la \
256         $(intl_LIBS) $(ncurses_panel_menu_LIBS) $(ncurses_LIBS) \
257         $(nconf_EXTRA_LIBS)
258
259 endif # COND_nconf
260
261 #--------------------------
262 # gconf frontend
263 if COND_gconf
264
265 bin_PROGRAMS += frontends/gconf/kconfig-gconf
266
267 frontends_gconf_kconfig_gconf_SOURCES = \
268         frontends/gconf/gconf.c \
269         frontends/gconf/gconf.glade
270 frontends_gconf_kconfig_gconf_CPPFLAGS = \
271         $(AM_CPPFLAGS) \
272         $(intl_CPPFLAGS) \
273         -I$(top_srcdir)/libs/parser \
274         -I$(top_builddir)/libs/images \
275         -DGUI_PATH='"$(pkgdatadir)/gconf.glade"'
276 frontends_gconf_kconfig_gconf_CFLAGS = \
277         $(AM_CFLAGS) \
278         $(kf_CFLAGS) \
279         $(gtk_CFLAGS)
280 frontends_gconf_kconfig_gconf_LDADD = \
281         $(top_builddir)/libs/parser/libkconfig-parser.la \
282         $(top_builddir)/libs/images/libkconfig-images.a \
283         $(intl_LIBS) \
284         $(gtk_LIBS) \
285         $(gconf_EXTRA_LIBS)
286 frontends_gconf_kconfig_gconfdir = $(pkgdatadir)
287 frontends_gconf_kconfig_gconf_DATA = frontends/gconf/gconf.glade
288
289 EXTRA_DIST += frontends/gconf/gconf.c.patch
290
291 endif # COND_gconf
292
293 #--------------------------
294 # gconf frontend
295 if COND_qconf
296
297 bin_PROGRAMS += frontends/qconf/kconfig-qconf
298
299 frontends_qconf_kconfig_qconf_SOURCES = \
300         frontends/qconf/qconf.cc \
301         frontends/qconf/qconf.h
302 BUILT_SOURCES += frontends/qconf/qconf.moc
303 frontends_qconf_kconfig_qconf_CPPFLAGS = \
304         $(AM_CPPFLAGS) \
305         $(intl_CPPFLAGS) \
306         -I$(top_srcdir)/libs/parser \
307         -I$(top_builddir)/libs/images \
308         -I$(top_builddir)/frontends/qconf
309 frontends_qconf_kconfig_qconf_CXXFLAGS = \
310         $(AM_CXXFLAGS) \
311         $(kf_CFLAGS) \
312         $(Qt5_CFLAGS) \
313         -fPIC -std=c++11
314 frontends_qconf_kconfig_qconf_LDADD = \
315         $(top_builddir)/libs/parser/libkconfig-parser.la \
316         $(top_builddir)/libs/images/libkconfig-images.a \
317         $(intl_LIBS) $(Qt5_LIBS) $(qconf_EXTRA_LIBS)
318
319 AM_V_MOC = $(AM_V_MOC_$(V))
320 AM_V_MOC_ = $(AM_V_MOC_$(AM_DEFAULT_VERBOSITY))
321 AM_V_MOC_0 = @echo "  MOC     " $@;
322 AM_V_MOC_1 =
323
324 .h.moc:
325         $(AM_V_MOC)$(MOC) -i $< -o $@
326
327 CLEANFILES += frontends/qconf/qconf.moc
328 EXTRA_DIST += frontends/qconf/qconf.cc.patch
329
330 endif # COND_qconf
331
332 #===============================================================================
333 # Utilities
334 if COND_utils
335
336 bin_SCRIPTS += utils/kconfig-tweak
337 dist_bin_SCRIPTS += utils/kconfig-diff utils/kconfig-merge
338
339 if COND_utils_gettext
340 MAYBE_utils_gettext = utils/kconfig-gettext
341 endif
342 bin_PROGRAMS += $(MAYBE_utils_gettext)
343
344 utils_kconfig_gettext_SOURCES = utils/gettext.c
345 utils_kconfig_gettext_CPPFLAGS = \
346         $(AM_CPPFLAGS) \
347         -I$(top_srcdir)/libs/parser
348 utils_kconfig_gettext_CFLAGS = \
349         $(AM_CFLAGS) \
350         $(kf_CFLAGS)
351 utils_kconfig_gettext_LDADD = \
352         $(top_builddir)/libs/parser/libkconfig-parser.la \
353         $(intl_LIBS)
354
355 CLEANFILES += utils/kconfig-tweak
356 EXTRA_DIST += \
357         utils/kconfig-tweak.in \
358         utils/kconfig-tweak.in.patch
359
360 utils/kconfig-tweak: utils/kconfig-tweak.in
361         $(MKDIR_P) $(@D)
362         $(AM_V_GEN)$(SED) -e "s/@CONFIG_@/$(config_prefix)/g" \
363                 $< >$@
364         @chmod +x $@
365
366 endif # COND_utils
367
368 #===============================================================================
369 # Misc. scripts
370 EXTRA_DIST += \
371         scripts/ksync.sh \
372         scripts/ksync.list \
373         scripts/version.sh