xref: /aosp_15_r20/external/libconfig/lib/Makefile.am (revision 2e9d491483b805f09ea864149eadd5680efcc72a)
1
2# Versioning rules ( C:R:A )
3#
4# Perform EACH step that applies.
5#
6# 1. Start with version 0:0:0.
7# 2. If any of the sources have changed, increment R. This is a new revision
8#    of the current interface.
9# 3. If the interface has changed, increment C and set R to 0. This is the
10#    first revision of a new interface.
11# 4. If the interface has changed, and the new interface is a superset of the
12#    previous interface (that is, if the previous interface has not been
13#    broken by the changes in this new release), increment A. This release is
14#    backwards compatible with the previous release.
15# 5. If the new interface has removed elements with respect to the
16#    previous interface, then backward compatibility is broken; set A to 0.
17#    This release has a new, but backwards incompatible interface.
18#
19# For more info see section 6.3 of the GNU Libtool Manual.
20
21VERINFO = -version-info 12:0:1
22
23## Flex
24PARSER_PREFIX = libconfig_yy
25AM_LFLAGS = --header-file=scanner.h --prefix=$(PARSER_PREFIX)
26
27## Bison
28AM_YFLAGS = -d -p $(PARSER_PREFIX)
29
30
31libsrc = grammar.y libconfig.c parsectx.h scanctx.c scanctx.h scanner.l \
32    strbuf.c strbuf.h strvec.c strvec.h util.c util.h wincompat.c wincompat.h
33libinc = libconfig.h
34
35libsrc_cpp =  $(libsrc) libconfigcpp.c++
36libinc_cpp =  libconfig.h++
37
38BUILT_SOURCES = scanner.c scanner.h grammar.c grammar.h
39
40
41## Build mode: C-only or C & C++
42lib_LTLIBRARIES = libconfig.la
43
44if BUILDCXX
45lib_LTLIBRARIES += libconfig++.la
46endif
47
48
49libconfig_la_SOURCES = $(libsrc)
50
51libconfig___la_SOURCES = $(libsrc_cpp)
52
53
54libcppflags = -D_REENTRANT
55libcppxxflags = -D_REENTRANT
56
57if GNU_WIN
58libcppflags += -DLIBCONFIG_EXPORTS
59libcppxxflags += -DLIBCONFIGXX_EXPORTS -DLIBCONFIG_STATIC
60endif
61
62libconfig_la_CPPFLAGS = -DPARSER_PREFIX=\"$(PARSER_PREFIX)\" $(libcppflags)
63libconfig___la_CPPFLAGS = -DPARSER_PREFIX=\"$(PARSER_PREFIX)\" $(libcppxxflags)
64
65include_HEADERS = $(libinc)
66
67if BUILDCXX
68  include_HEADERS += $(libinc_cpp)
69endif
70
71
72libconfig_la_LDFLAGS = $(VERINFO) -no-undefined
73
74libconfig___la_LDFLAGS = $(VERINFO) -no-undefined
75
76
77EXTRA_DIST = \
78	$(BUILT_SOURCES) \
79	libconfigcpp.cc libconfig.hh \
80	*.vcproj \
81	*.vcxproj
82
83pkgconfigdir = $(libdir)/pkgconfig
84
85pkgconfig_DATA = libconfig.pc
86
87if BUILDCXX
88pkgconfig_DATA += libconfig++.pc
89endif
90
91cmakedir = $(libdir)/cmake/libconfig
92cmake_DATA = libconfigConfig.cmake
93
94if BUILDCXX
95cmakeppdir = $(libdir)/cmake/libconfig++
96cmakepp_DATA = libconfig++Config.cmake
97endif
98