blob: d08f41b6c43f4ab585751cc59733bb2821fa9558 [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
Harald Welteda432cd2019-12-15 19:13:26 +01004SUBDIRS = include src src/vty src/codec src/gsm src/coding src/gb src/ctrl src/sim src/pseudotalloc src/usb utils tests
Harald Welte3cae0392010-02-20 21:09:24 +01005
6pkgconfigdir = $(libdir)/pkgconfig
Harald Welte641f7ce2012-06-17 23:05:26 +08007pkgconfig_DATA = libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc \
Harald Welteda432cd2019-12-15 19:13:26 +01008 libosmogb.pc libosmoctrl.pc libosmocoding.pc libosmosim.pc \
9 libosmousb.pc
Harald Welte4cd3d8a2010-03-23 00:30:19 +080010
Vasil Velichkov499510b2019-04-03 02:32:37 +030011aclocaldir = $(datadir)/aclocal
12dist_aclocal_DATA = m4/osmo_ac_code_coverage.m4 \
13 m4/osmo_ax_code_coverage.m4
14
Maxff932bb2017-07-04 18:19:38 +020015@RELMAKE@
Vasil Velichkov499510b2019-04-03 02:32:37 +030016@CODE_COVERAGE_RULES@
Maxff932bb2017-07-04 18:19:38 +020017
18relengdir = $(includedir)
19releng_DATA = osmo-release.mk
20
Harald Welteee497f22017-10-03 16:54:41 +080021dist_bin_SCRIPTS = osmo-release.sh
22
Maxff932bb2017-07-04 18:19:38 +020023osmo-release.mk: git-version-gen
24
Harald Welte4cd3d8a2010-03-23 00:30:19 +080025BUILT_SOURCES = $(top_srcdir)/.version
26$(top_srcdir)/.version:
27 echo $(VERSION) > $@-t && mv $@-t $@
28dist-hook:
29 echo $(VERSION) > $(distdir)/.tarball-version
Holger Hans Peter Freytherec4f1602011-07-17 12:13:31 +020030
Harald Welteee497f22017-10-03 16:54:41 +080031EXTRA_DIST = git-version-gen .version README.md osmo-release.mk osmo-release.sh
Harald Welte21e73c22011-08-17 19:33:06 +020032
Neels Hofmeyr44c15b72019-02-01 05:56:09 +010033HTML = \
34 $(top_builddir)/doc/core/html/index.html \
35 $(top_builddir)/doc/gsm/html/index.html \
36 $(top_builddir)/doc/vty/html/index.html \
37 $(top_builddir)/doc/codec/html/index.html \
38 $(top_builddir)/doc/coding/html/index.html \
39 $(top_builddir)/doc/ctrl/html/index.html \
40 $(top_builddir)/doc/gb/html/index.html
Harald Welte21e73c22011-08-17 19:33:06 +020041
Neels Hofmeyr44c15b72019-02-01 05:56:09 +010042if HAVE_DOXYGEN
Diego Elio Pettenò200710e2012-06-29 13:01:26 -070043html_DATA = $(top_builddir)/doc/html.tar
Harald Welte21e73c22011-08-17 19:33:06 +020044
Neels Hofmeyr249fb712017-06-20 02:52:38 +020045doc: $(html_DATA)
46
Neels Hofmeyr44c15b72019-02-01 05:56:09 +010047$(html_DATA): apidoc
48else
49DOXYGEN=doxygen
50endif
51
52.PHONY: apidoc
53apidoc: $(HTML)
Harald Welte7992af02011-08-17 19:37:26 +020054 cd $(top_builddir)/doc && tar cf html.tar */html
Harald Welte21e73c22011-08-17 19:33:06 +020055
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +010056# Support doxygen cross references from each library to each other library:
57# First generate the docs to make sure all .tag files are in place.
58# In a second run, generate the content with proper referencing.
59# For example, libosmocore references tags from libosmovty and vice versa,
60# so both need to generate tag files first, and then do another run.
61#
62# Generate each docs tree, and touch a libosmofoo.tag.prep file when done.
63# It means that a libosmofoo.tag file is up-to-date.
64# Touch a separate "*.prep" target: libosmofoo.tag as target would create
65# circular dependency: we would rebuild all every time 'make' is invoked.
66# The .prep file also depends on all the source files for that library.
67
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +010068$(top_builddir)/doc/libosmocore.tag.prep: $(top_builddir)/Doxyfile.core \
69 $(top_srcdir)/include/osmocom/core/*.h \
70 $(top_srcdir)/src/*.[hc] \
Neels Hofmeyr7e689c62019-02-04 14:13:52 +010071 $(top_srcdir)/src/crcXXgen.c.tpl \
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +010072 $(top_srcdir)/src/pseudotalloc/*.[hc]
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +010073 rm -rf $(top_builddir)/doc/core; mkdir -p $(top_builddir)/doc/core
74 rm -rf $(top_builddir)/doc/libosmocore.map
75 -$(DOXYGEN) $(top_builddir)/Doxyfile.core
76 touch "$@"
77
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +010078$(top_builddir)/doc/libosmogsm.tag.prep: $(top_builddir)/Doxyfile.gsm \
79 $(top_srcdir)/include/osmocom/gsm/*.h \
80 $(top_srcdir)/include/osmocom/gsm/protocol/*.h \
81 $(top_srcdir)/include/osmocom/crypt/*.h \
82 $(top_srcdir)/src/gsm/*.c \
83 $(top_srcdir)/src/gsm/milenage/*.[hc]
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +010084 rm -rf $(top_builddir)/doc/gsm; mkdir -p $(top_builddir)/doc/gsm
85 rm -rf $(top_builddir)/doc/libosmogsm.map
86 -$(DOXYGEN) $(top_builddir)/Doxyfile.gsm
87 touch "$@"
88
Oliver Smith316d1e12019-06-28 09:13:22 +020089# Don't delete the entire doc/vty, it contains example.xml and vtydoc.xsd (OS#3986)
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +010090$(top_builddir)/doc/libosmovty.tag.prep: $(top_builddir)/Doxyfile.vty \
91 $(top_srcdir)/include/osmocom/vty/*.h \
92 $(top_srcdir)/src/vty/*.c
Oliver Smith316d1e12019-06-28 09:13:22 +020093 rm -rf $(top_builddir)/doc/vty/html $(top_builddir)/doc/vty/latex
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +010094 rm -rf $(top_builddir)/doc/libosmovty.map
95 -$(DOXYGEN) $(top_builddir)/Doxyfile.vty
96 touch "$@"
97
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +010098$(top_builddir)/doc/libosmocodec.tag.prep: $(top_builddir)/Doxyfile.codec \
99 $(top_srcdir)/include/osmocom/codec/*.h \
100 $(top_srcdir)/src/codec/*.c
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100101 rm -rf $(top_builddir)/doc/codec; mkdir -p $(top_builddir)/doc/codec
102 rm -rf $(top_builddir)/doc/libosmocodec.map
103 -$(DOXYGEN) $(top_builddir)/Doxyfile.codec
104 touch "$@"
105
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +0100106$(top_builddir)/doc/libosmocoding.tag.prep: $(top_builddir)/Doxyfile.coding \
107 $(top_srcdir)/include/osmocom/coding/*.h \
108 $(top_srcdir)/src/coding/*.c
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100109 rm -rf $(top_builddir)/doc/coding; mkdir -p $(top_builddir)/doc/coding
110 rm -rf $(top_builddir)/doc/libosmocoding.map
111 -$(DOXYGEN) $(top_builddir)/Doxyfile.coding
112 touch "$@"
113
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +0100114$(top_builddir)/doc/libosmoctrl.tag.prep: $(top_builddir)/Doxyfile.ctrl \
115 $(top_srcdir)/include/osmocom/ctrl/*.h \
116 $(top_srcdir)/src/ctrl/*.c
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100117 rm -rf $(top_builddir)/doc/ctrl; mkdir -p $(top_builddir)/doc/ctrl
118 rm -rf $(top_builddir)/doc/libosmoctrl.map
119 -$(DOXYGEN) $(top_builddir)/Doxyfile.ctrl
120 touch "$@"
121
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +0100122$(top_builddir)/doc/libosmogb.tag.prep: $(top_builddir)/Doxyfile.gb \
123 $(top_srcdir)/include/osmocom/gprs/*.h \
124 $(top_srcdir)/src/gb/*.[hc]
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100125 rm -rf $(top_builddir)/doc/gb; mkdir -p $(top_builddir)/doc/gb
126 rm -rf $(top_builddir)/doc/libosmogb.map
127 -$(DOXYGEN) $(top_builddir)/Doxyfile.gb
128 touch "$@"
129
130# Build for real once all depending .tag files are in place.
131# Depend on the own .tag.prep file to avoid concurrent builds of the same doc
132# tree, and to also depend on all the source files listed above.
133#
134# Each library should depend on all the tag.prep files of which it lists .tag
135# files in Doxyfile under TAGFILES.
136#
137# In turn, include all .tag files in TAGFILES of libraries to which "\ref"
138# references point.
139#
140# Easiest is to just depend on all tag.prep files all across everywhere.
141
142$(top_builddir)/doc/core/html/index.html: $(top_builddir)/doc/libosmocore.tag.prep \
143 $(top_builddir)/doc/libosmogsm.tag.prep \
144 $(top_builddir)/doc/libosmovty.tag.prep \
145 $(top_builddir)/doc/libosmocodec.tag.prep \
146 $(top_builddir)/doc/libosmocoding.tag.prep \
147 $(top_builddir)/doc/libosmoctrl.tag.prep \
148 $(top_builddir)/doc/libosmogb.tag.prep
149 rm -rf $(top_builddir)/doc/core; mkdir -p $(top_builddir)/doc/core
Harald Weltec7859ed2011-08-20 12:54:17 +0200150 $(DOXYGEN) Doxyfile.core
Harald Welte21e73c22011-08-17 19:33:06 +0200151
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100152$(top_builddir)/doc/gsm/html/index.html: $(top_builddir)/doc/libosmogsm.tag.prep \
153 $(top_builddir)/doc/libosmocore.tag.prep \
154 $(top_builddir)/doc/libosmovty.tag.prep \
155 $(top_builddir)/doc/libosmocodec.tag.prep \
156 $(top_builddir)/doc/libosmocoding.tag.prep \
157 $(top_builddir)/doc/libosmoctrl.tag.prep \
158 $(top_builddir)/doc/libosmogb.tag.prep
159 rm -rf $(top_builddir)/doc/gsm; mkdir -p $(top_builddir)/doc/gsm
Harald Welte21e73c22011-08-17 19:33:06 +0200160 $(DOXYGEN) Doxyfile.gsm
161
Oliver Smith316d1e12019-06-28 09:13:22 +0200162# Don't delete the entire doc/vty, it contains example.xml and vtydoc.xsd (OS#3986)
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100163$(top_builddir)/doc/vty/html/index.html: $(top_builddir)/doc/libosmovty.tag.prep \
164 $(top_builddir)/doc/libosmocore.tag.prep \
165 $(top_builddir)/doc/libosmogsm.tag.prep \
166 $(top_builddir)/doc/libosmocodec.tag.prep \
167 $(top_builddir)/doc/libosmocoding.tag.prep \
168 $(top_builddir)/doc/libosmoctrl.tag.prep \
169 $(top_builddir)/doc/libosmogb.tag.prep
Oliver Smith316d1e12019-06-28 09:13:22 +0200170 rm -rf $(top_builddir)/doc/vty/html $(top_builddir)/doc/vty/latex
Harald Welte21e73c22011-08-17 19:33:06 +0200171 $(DOXYGEN) Doxyfile.vty
172
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100173$(top_builddir)/doc/codec/html/index.html: $(top_builddir)/doc/libosmocodec.tag.prep \
174 $(top_builddir)/doc/libosmocore.tag.prep \
175 $(top_builddir)/doc/libosmogsm.tag.prep \
176 $(top_builddir)/doc/libosmovty.tag.prep \
177 $(top_builddir)/doc/libosmocoding.tag.prep \
178 $(top_builddir)/doc/libosmoctrl.tag.prep \
179 $(top_builddir)/doc/libosmogb.tag.prep
180 rm -rf $(top_builddir)/doc/codec; mkdir -p $(top_builddir)/doc/codec
Harald Welte21e73c22011-08-17 19:33:06 +0200181 $(DOXYGEN) Doxyfile.codec
182
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100183$(top_builddir)/doc/coding/html/index.html: $(top_builddir)/doc/libosmocoding.tag.prep \
184 $(top_builddir)/doc/libosmocore.tag.prep \
185 $(top_builddir)/doc/libosmogsm.tag.prep \
186 $(top_builddir)/doc/libosmovty.tag.prep \
187 $(top_builddir)/doc/libosmocodec.tag.prep \
188 $(top_builddir)/doc/libosmoctrl.tag.prep \
189 $(top_builddir)/doc/libosmogb.tag.prep
190 rm -rf $(top_builddir)/doc/coding; mkdir -p $(top_builddir)/doc/coding
Vadim Yanitskiy3262f822016-09-23 01:48:59 +0700191 $(DOXYGEN) Doxyfile.coding
192
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100193$(top_builddir)/doc/ctrl/html/index.html: $(top_builddir)/doc/libosmoctrl.tag.prep \
194 $(top_builddir)/doc/libosmocore.tag.prep \
195 $(top_builddir)/doc/libosmogsm.tag.prep \
196 $(top_builddir)/doc/libosmovty.tag.prep \
197 $(top_builddir)/doc/libosmocodec.tag.prep \
198 $(top_builddir)/doc/libosmocoding.tag.prep \
199 $(top_builddir)/doc/libosmogb.tag.prep
200 rm -rf $(top_builddir)/doc/ctrl; mkdir -p $(top_builddir)/doc/ctrl
Harald Welteb4186822018-05-26 17:25:11 +0200201 $(DOXYGEN) Doxyfile.ctrl
202
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100203$(top_builddir)/doc/gb/html/index.html: $(top_builddir)/doc/libosmogb.tag.prep \
204 $(top_builddir)/doc/libosmocore.tag.prep \
205 $(top_builddir)/doc/libosmogsm.tag.prep \
206 $(top_builddir)/doc/libosmovty.tag.prep \
207 $(top_builddir)/doc/libosmocodec.tag.prep \
208 $(top_builddir)/doc/libosmocoding.tag.prep \
209 $(top_builddir)/doc/libosmoctrl.tag.prep
210 rm -rf $(top_builddir)/doc/gb; mkdir -p $(top_builddir)/doc/gb
Neels Hofmeyr249fb712017-06-20 02:52:38 +0200211 $(DOXYGEN) Doxyfile.gb
212
Neels Hofmeyr44c15b72019-02-01 05:56:09 +0100213if HAVE_DOXYGEN
Harald Welte21e73c22011-08-17 19:33:06 +0200214install-data-hook:
Diego Elio Pettenò200710e2012-06-29 13:01:26 -0700215 cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar
Harald Welte21e73c22011-08-17 19:33:06 +0200216
217uninstall-hook:
Harald Welteb4186822018-05-26 17:25:11 +0200218 cd $(DESTDIR)$(htmldir) && rm -rf {core,gsm,vty,codec,coding,ctrl,gb}
Harald Welte21e73c22011-08-17 19:33:06 +0200219
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100220DX_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 +0200221endif
Harald Welte47945f02011-08-20 13:00:37 +0200222
223MOSTLYCLEANFILES = $(DX_CLEAN)