blob: b3663baf7e30723615e1cb7bc2347cb61a20ff39 [file] [log] [blame]
Harald Welte4cd3d8a2010-03-23 00:30:19 +08001ACLOCAL_AMFLAGS = -I m4
Harald Welte3cae0392010-02-20 21:09:24 +01002
Harald Welted54c2ee2012-01-17 18:25:50 +01003AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
Neels Hofmeyr044f0cd2022-06-12 19:04:05 +02004SUBDIRS = \
5 include \
6 src \
7 src/vty \
8 src/codec \
9 src/gsm \
10 src/coding \
11 src/gb \
12 src/ctrl \
13 src/sim \
14 src/pseudotalloc \
15 src/usb \
16 utils \
17 tapset \
18 tests \
19 $(NULL)
Harald Welte3cae0392010-02-20 21:09:24 +010020
21pkgconfigdir = $(libdir)/pkgconfig
Harald Welte641f7ce2012-06-17 23:05:26 +080022pkgconfig_DATA = libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc \
Harald Welteda432cd2019-12-15 19:13:26 +010023 libosmogb.pc libosmoctrl.pc libosmocoding.pc libosmosim.pc \
24 libosmousb.pc
Harald Welte4cd3d8a2010-03-23 00:30:19 +080025
Vasil Velichkov499510b2019-04-03 02:32:37 +030026aclocaldir = $(datadir)/aclocal
27dist_aclocal_DATA = m4/osmo_ac_code_coverage.m4 \
28 m4/osmo_ax_code_coverage.m4
29
Maxff932bb2017-07-04 18:19:38 +020030@RELMAKE@
Vasil Velichkov499510b2019-04-03 02:32:37 +030031@CODE_COVERAGE_RULES@
Maxff932bb2017-07-04 18:19:38 +020032
33relengdir = $(includedir)
34releng_DATA = osmo-release.mk
35
Harald Welteee497f22017-10-03 16:54:41 +080036dist_bin_SCRIPTS = osmo-release.sh
37
Maxff932bb2017-07-04 18:19:38 +020038osmo-release.mk: git-version-gen
39
Harald Welte4cd3d8a2010-03-23 00:30:19 +080040BUILT_SOURCES = $(top_srcdir)/.version
41$(top_srcdir)/.version:
42 echo $(VERSION) > $@-t && mv $@-t $@
43dist-hook:
44 echo $(VERSION) > $(distdir)/.tarball-version
Holger Hans Peter Freytherec4f1602011-07-17 12:13:31 +020045
Oliver Smitha2991392020-05-22 13:13:17 +020046EXTRA_DIST = \
47 .version \
48 README.md \
49 contrib/libosmocore.spec.in \
50 debian \
51 git-version-gen \
52 osmo-release.mk \
53 osmo-release.sh \
54 $(NULL)
Harald Welte21e73c22011-08-17 19:33:06 +020055
Neels Hofmeyr44c15b72019-02-01 05:56:09 +010056HTML = \
57 $(top_builddir)/doc/core/html/index.html \
58 $(top_builddir)/doc/gsm/html/index.html \
59 $(top_builddir)/doc/vty/html/index.html \
60 $(top_builddir)/doc/codec/html/index.html \
61 $(top_builddir)/doc/coding/html/index.html \
62 $(top_builddir)/doc/ctrl/html/index.html \
63 $(top_builddir)/doc/gb/html/index.html
Harald Welte21e73c22011-08-17 19:33:06 +020064
Neels Hofmeyr44c15b72019-02-01 05:56:09 +010065if HAVE_DOXYGEN
Diego Elio Pettenò200710e2012-06-29 13:01:26 -070066html_DATA = $(top_builddir)/doc/html.tar
Harald Welte21e73c22011-08-17 19:33:06 +020067
Neels Hofmeyr249fb712017-06-20 02:52:38 +020068doc: $(html_DATA)
69
Neels Hofmeyr44c15b72019-02-01 05:56:09 +010070$(html_DATA): apidoc
71else
72DOXYGEN=doxygen
73endif
74
75.PHONY: apidoc
76apidoc: $(HTML)
Harald Welte7992af02011-08-17 19:37:26 +020077 cd $(top_builddir)/doc && tar cf html.tar */html
Harald Welte21e73c22011-08-17 19:33:06 +020078
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +010079# Support doxygen cross references from each library to each other library:
80# First generate the docs to make sure all .tag files are in place.
81# In a second run, generate the content with proper referencing.
82# For example, libosmocore references tags from libosmovty and vice versa,
83# so both need to generate tag files first, and then do another run.
84#
85# Generate each docs tree, and touch a libosmofoo.tag.prep file when done.
86# It means that a libosmofoo.tag file is up-to-date.
87# Touch a separate "*.prep" target: libosmofoo.tag as target would create
88# circular dependency: we would rebuild all every time 'make' is invoked.
89# The .prep file also depends on all the source files for that library.
90
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +010091$(top_builddir)/doc/libosmocore.tag.prep: $(top_builddir)/Doxyfile.core \
92 $(top_srcdir)/include/osmocom/core/*.h \
93 $(top_srcdir)/src/*.[hc] \
Neels Hofmeyr7e689c62019-02-04 14:13:52 +010094 $(top_srcdir)/src/crcXXgen.c.tpl \
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +010095 $(top_srcdir)/src/pseudotalloc/*.[hc]
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +010096 rm -rf $(top_builddir)/doc/core; mkdir -p $(top_builddir)/doc/core
97 rm -rf $(top_builddir)/doc/libosmocore.map
98 -$(DOXYGEN) $(top_builddir)/Doxyfile.core
99 touch "$@"
100
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +0100101$(top_builddir)/doc/libosmogsm.tag.prep: $(top_builddir)/Doxyfile.gsm \
102 $(top_srcdir)/include/osmocom/gsm/*.h \
103 $(top_srcdir)/include/osmocom/gsm/protocol/*.h \
104 $(top_srcdir)/include/osmocom/crypt/*.h \
105 $(top_srcdir)/src/gsm/*.c \
106 $(top_srcdir)/src/gsm/milenage/*.[hc]
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100107 rm -rf $(top_builddir)/doc/gsm; mkdir -p $(top_builddir)/doc/gsm
108 rm -rf $(top_builddir)/doc/libosmogsm.map
109 -$(DOXYGEN) $(top_builddir)/Doxyfile.gsm
110 touch "$@"
111
Oliver Smith316d1e12019-06-28 09:13:22 +0200112# Don't delete the entire doc/vty, it contains example.xml and vtydoc.xsd (OS#3986)
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +0100113$(top_builddir)/doc/libosmovty.tag.prep: $(top_builddir)/Doxyfile.vty \
114 $(top_srcdir)/include/osmocom/vty/*.h \
115 $(top_srcdir)/src/vty/*.c
Oliver Smith316d1e12019-06-28 09:13:22 +0200116 rm -rf $(top_builddir)/doc/vty/html $(top_builddir)/doc/vty/latex
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100117 rm -rf $(top_builddir)/doc/libosmovty.map
118 -$(DOXYGEN) $(top_builddir)/Doxyfile.vty
119 touch "$@"
120
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +0100121$(top_builddir)/doc/libosmocodec.tag.prep: $(top_builddir)/Doxyfile.codec \
122 $(top_srcdir)/include/osmocom/codec/*.h \
123 $(top_srcdir)/src/codec/*.c
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100124 rm -rf $(top_builddir)/doc/codec; mkdir -p $(top_builddir)/doc/codec
125 rm -rf $(top_builddir)/doc/libosmocodec.map
126 -$(DOXYGEN) $(top_builddir)/Doxyfile.codec
127 touch "$@"
128
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +0100129$(top_builddir)/doc/libosmocoding.tag.prep: $(top_builddir)/Doxyfile.coding \
130 $(top_srcdir)/include/osmocom/coding/*.h \
131 $(top_srcdir)/src/coding/*.c
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100132 rm -rf $(top_builddir)/doc/coding; mkdir -p $(top_builddir)/doc/coding
133 rm -rf $(top_builddir)/doc/libosmocoding.map
134 -$(DOXYGEN) $(top_builddir)/Doxyfile.coding
135 touch "$@"
136
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +0100137$(top_builddir)/doc/libosmoctrl.tag.prep: $(top_builddir)/Doxyfile.ctrl \
138 $(top_srcdir)/include/osmocom/ctrl/*.h \
139 $(top_srcdir)/src/ctrl/*.c
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100140 rm -rf $(top_builddir)/doc/ctrl; mkdir -p $(top_builddir)/doc/ctrl
141 rm -rf $(top_builddir)/doc/libosmoctrl.map
142 -$(DOXYGEN) $(top_builddir)/Doxyfile.ctrl
143 touch "$@"
144
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +0100145$(top_builddir)/doc/libosmogb.tag.prep: $(top_builddir)/Doxyfile.gb \
146 $(top_srcdir)/include/osmocom/gprs/*.h \
147 $(top_srcdir)/src/gb/*.[hc]
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100148 rm -rf $(top_builddir)/doc/gb; mkdir -p $(top_builddir)/doc/gb
149 rm -rf $(top_builddir)/doc/libosmogb.map
150 -$(DOXYGEN) $(top_builddir)/Doxyfile.gb
151 touch "$@"
152
153# Build for real once all depending .tag files are in place.
154# Depend on the own .tag.prep file to avoid concurrent builds of the same doc
155# tree, and to also depend on all the source files listed above.
156#
157# Each library should depend on all the tag.prep files of which it lists .tag
158# files in Doxyfile under TAGFILES.
159#
160# In turn, include all .tag files in TAGFILES of libraries to which "\ref"
161# references point.
162#
163# Easiest is to just depend on all tag.prep files all across everywhere.
164
165$(top_builddir)/doc/core/html/index.html: $(top_builddir)/doc/libosmocore.tag.prep \
166 $(top_builddir)/doc/libosmogsm.tag.prep \
167 $(top_builddir)/doc/libosmovty.tag.prep \
168 $(top_builddir)/doc/libosmocodec.tag.prep \
169 $(top_builddir)/doc/libosmocoding.tag.prep \
170 $(top_builddir)/doc/libosmoctrl.tag.prep \
171 $(top_builddir)/doc/libosmogb.tag.prep
172 rm -rf $(top_builddir)/doc/core; mkdir -p $(top_builddir)/doc/core
Harald Weltec7859ed2011-08-20 12:54:17 +0200173 $(DOXYGEN) Doxyfile.core
Harald Welte21e73c22011-08-17 19:33:06 +0200174
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100175$(top_builddir)/doc/gsm/html/index.html: $(top_builddir)/doc/libosmogsm.tag.prep \
176 $(top_builddir)/doc/libosmocore.tag.prep \
177 $(top_builddir)/doc/libosmovty.tag.prep \
178 $(top_builddir)/doc/libosmocodec.tag.prep \
179 $(top_builddir)/doc/libosmocoding.tag.prep \
180 $(top_builddir)/doc/libosmoctrl.tag.prep \
181 $(top_builddir)/doc/libosmogb.tag.prep
182 rm -rf $(top_builddir)/doc/gsm; mkdir -p $(top_builddir)/doc/gsm
Harald Welte21e73c22011-08-17 19:33:06 +0200183 $(DOXYGEN) Doxyfile.gsm
184
Oliver Smith316d1e12019-06-28 09:13:22 +0200185# Don't delete the entire doc/vty, it contains example.xml and vtydoc.xsd (OS#3986)
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100186$(top_builddir)/doc/vty/html/index.html: $(top_builddir)/doc/libosmovty.tag.prep \
187 $(top_builddir)/doc/libosmocore.tag.prep \
188 $(top_builddir)/doc/libosmogsm.tag.prep \
189 $(top_builddir)/doc/libosmocodec.tag.prep \
190 $(top_builddir)/doc/libosmocoding.tag.prep \
191 $(top_builddir)/doc/libosmoctrl.tag.prep \
192 $(top_builddir)/doc/libosmogb.tag.prep
Oliver Smith316d1e12019-06-28 09:13:22 +0200193 rm -rf $(top_builddir)/doc/vty/html $(top_builddir)/doc/vty/latex
Harald Welte21e73c22011-08-17 19:33:06 +0200194 $(DOXYGEN) Doxyfile.vty
195
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100196$(top_builddir)/doc/codec/html/index.html: $(top_builddir)/doc/libosmocodec.tag.prep \
197 $(top_builddir)/doc/libosmocore.tag.prep \
198 $(top_builddir)/doc/libosmogsm.tag.prep \
199 $(top_builddir)/doc/libosmovty.tag.prep \
200 $(top_builddir)/doc/libosmocoding.tag.prep \
201 $(top_builddir)/doc/libosmoctrl.tag.prep \
202 $(top_builddir)/doc/libosmogb.tag.prep
203 rm -rf $(top_builddir)/doc/codec; mkdir -p $(top_builddir)/doc/codec
Harald Welte21e73c22011-08-17 19:33:06 +0200204 $(DOXYGEN) Doxyfile.codec
205
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100206$(top_builddir)/doc/coding/html/index.html: $(top_builddir)/doc/libosmocoding.tag.prep \
207 $(top_builddir)/doc/libosmocore.tag.prep \
208 $(top_builddir)/doc/libosmogsm.tag.prep \
209 $(top_builddir)/doc/libosmovty.tag.prep \
210 $(top_builddir)/doc/libosmocodec.tag.prep \
211 $(top_builddir)/doc/libosmoctrl.tag.prep \
212 $(top_builddir)/doc/libosmogb.tag.prep
213 rm -rf $(top_builddir)/doc/coding; mkdir -p $(top_builddir)/doc/coding
Vadim Yanitskiy3262f822016-09-23 01:48:59 +0700214 $(DOXYGEN) Doxyfile.coding
215
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100216$(top_builddir)/doc/ctrl/html/index.html: $(top_builddir)/doc/libosmoctrl.tag.prep \
217 $(top_builddir)/doc/libosmocore.tag.prep \
218 $(top_builddir)/doc/libosmogsm.tag.prep \
219 $(top_builddir)/doc/libosmovty.tag.prep \
220 $(top_builddir)/doc/libosmocodec.tag.prep \
221 $(top_builddir)/doc/libosmocoding.tag.prep \
222 $(top_builddir)/doc/libosmogb.tag.prep
223 rm -rf $(top_builddir)/doc/ctrl; mkdir -p $(top_builddir)/doc/ctrl
Harald Welteb4186822018-05-26 17:25:11 +0200224 $(DOXYGEN) Doxyfile.ctrl
225
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100226$(top_builddir)/doc/gb/html/index.html: $(top_builddir)/doc/libosmogb.tag.prep \
227 $(top_builddir)/doc/libosmocore.tag.prep \
228 $(top_builddir)/doc/libosmogsm.tag.prep \
229 $(top_builddir)/doc/libosmovty.tag.prep \
230 $(top_builddir)/doc/libosmocodec.tag.prep \
231 $(top_builddir)/doc/libosmocoding.tag.prep \
232 $(top_builddir)/doc/libosmoctrl.tag.prep
233 rm -rf $(top_builddir)/doc/gb; mkdir -p $(top_builddir)/doc/gb
Neels Hofmeyr249fb712017-06-20 02:52:38 +0200234 $(DOXYGEN) Doxyfile.gb
235
Neels Hofmeyr44c15b72019-02-01 05:56:09 +0100236if HAVE_DOXYGEN
Harald Welte21e73c22011-08-17 19:33:06 +0200237install-data-hook:
Diego Elio Pettenò200710e2012-06-29 13:01:26 -0700238 cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar
Harald Welte21e73c22011-08-17 19:33:06 +0200239
240uninstall-hook:
Harald Welteb4186822018-05-26 17:25:11 +0200241 cd $(DESTDIR)$(htmldir) && rm -rf {core,gsm,vty,codec,coding,ctrl,gb}
Harald Welte21e73c22011-08-17 19:33:06 +0200242
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100243DX_CLEAN = doc/{core,gsm,vty,codec,coding,ctrl,gb}/html/search/* doc/{core,gsm,vty,codec,coding,ctrl,gb}/{html,latex}/* doc/html.tar doc/{core,gsm,vty,codec,coding,ctrl,gb}/doxygen_sqlite3.db doc/*.tag doc/*.tag.prep
Harald Welte21e73c22011-08-17 19:33:06 +0200244endif
Harald Welte47945f02011-08-20 13:00:37 +0200245
246MOSTLYCLEANFILES = $(DX_CLEAN)