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