blob: 7b6ba0aecce7f05603d765025104f5af682c2712 [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 Welte40f35212018-09-29 01:41:58 +02004SUBDIRS = include src src/vty src/codec src/gsm src/coding src/gb src/ctrl src/sim src/pseudotalloc 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 \
Martin Hauke13e7f052018-02-10 17:48:09 +01008 libosmogb.pc libosmoctrl.pc libosmocoding.pc libosmosim.pc
Harald Welte4cd3d8a2010-03-23 00:30:19 +08009
Vasil Velichkov499510b2019-04-03 02:32:37 +030010aclocaldir = $(datadir)/aclocal
11dist_aclocal_DATA = m4/osmo_ac_code_coverage.m4 \
12 m4/osmo_ax_code_coverage.m4
13
Maxff932bb2017-07-04 18:19:38 +020014@RELMAKE@
Vasil Velichkov499510b2019-04-03 02:32:37 +030015@CODE_COVERAGE_RULES@
Maxff932bb2017-07-04 18:19:38 +020016
17relengdir = $(includedir)
18releng_DATA = osmo-release.mk
19
Harald Welteee497f22017-10-03 16:54:41 +080020dist_bin_SCRIPTS = osmo-release.sh
21
Maxff932bb2017-07-04 18:19:38 +020022osmo-release.mk: git-version-gen
23
Harald Welte4cd3d8a2010-03-23 00:30:19 +080024BUILT_SOURCES = $(top_srcdir)/.version
25$(top_srcdir)/.version:
26 echo $(VERSION) > $@-t && mv $@-t $@
27dist-hook:
28 echo $(VERSION) > $(distdir)/.tarball-version
Holger Hans Peter Freytherec4f1602011-07-17 12:13:31 +020029
Harald Welteee497f22017-10-03 16:54:41 +080030EXTRA_DIST = git-version-gen .version README.md osmo-release.mk osmo-release.sh
Harald Welte21e73c22011-08-17 19:33:06 +020031
Neels Hofmeyr44c15b72019-02-01 05:56:09 +010032HTML = \
33 $(top_builddir)/doc/core/html/index.html \
34 $(top_builddir)/doc/gsm/html/index.html \
35 $(top_builddir)/doc/vty/html/index.html \
36 $(top_builddir)/doc/codec/html/index.html \
37 $(top_builddir)/doc/coding/html/index.html \
38 $(top_builddir)/doc/ctrl/html/index.html \
39 $(top_builddir)/doc/gb/html/index.html
Harald Welte21e73c22011-08-17 19:33:06 +020040
Neels Hofmeyr44c15b72019-02-01 05:56:09 +010041if HAVE_DOXYGEN
Diego Elio Pettenò200710e2012-06-29 13:01:26 -070042html_DATA = $(top_builddir)/doc/html.tar
Harald Welte21e73c22011-08-17 19:33:06 +020043
Neels Hofmeyr249fb712017-06-20 02:52:38 +020044doc: $(html_DATA)
45
Neels Hofmeyr44c15b72019-02-01 05:56:09 +010046$(html_DATA): apidoc
47else
48DOXYGEN=doxygen
49endif
50
51.PHONY: apidoc
52apidoc: $(HTML)
Harald Welte7992af02011-08-17 19:37:26 +020053 cd $(top_builddir)/doc && tar cf html.tar */html
Harald Welte21e73c22011-08-17 19:33:06 +020054
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +010055# Support doxygen cross references from each library to each other library:
56# First generate the docs to make sure all .tag files are in place.
57# In a second run, generate the content with proper referencing.
58# For example, libosmocore references tags from libosmovty and vice versa,
59# so both need to generate tag files first, and then do another run.
60#
61# Generate each docs tree, and touch a libosmofoo.tag.prep file when done.
62# It means that a libosmofoo.tag file is up-to-date.
63# Touch a separate "*.prep" target: libosmofoo.tag as target would create
64# circular dependency: we would rebuild all every time 'make' is invoked.
65# The .prep file also depends on all the source files for that library.
66
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +010067$(top_builddir)/doc/libosmocore.tag.prep: $(top_builddir)/Doxyfile.core \
68 $(top_srcdir)/include/osmocom/core/*.h \
69 $(top_srcdir)/src/*.[hc] \
70 $(top_srcdir)/src/pseudotalloc/*.[hc]
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +010071 rm -rf $(top_builddir)/doc/core; mkdir -p $(top_builddir)/doc/core
72 rm -rf $(top_builddir)/doc/libosmocore.map
73 -$(DOXYGEN) $(top_builddir)/Doxyfile.core
74 touch "$@"
75
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +010076$(top_builddir)/doc/libosmogsm.tag.prep: $(top_builddir)/Doxyfile.gsm \
77 $(top_srcdir)/include/osmocom/gsm/*.h \
78 $(top_srcdir)/include/osmocom/gsm/protocol/*.h \
79 $(top_srcdir)/include/osmocom/crypt/*.h \
80 $(top_srcdir)/src/gsm/*.c \
81 $(top_srcdir)/src/gsm/milenage/*.[hc]
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +010082 rm -rf $(top_builddir)/doc/gsm; mkdir -p $(top_builddir)/doc/gsm
83 rm -rf $(top_builddir)/doc/libosmogsm.map
84 -$(DOXYGEN) $(top_builddir)/Doxyfile.gsm
85 touch "$@"
86
Oliver Smith316d1e12019-06-28 09:13:22 +020087# Don't delete the entire doc/vty, it contains example.xml and vtydoc.xsd (OS#3986)
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +010088$(top_builddir)/doc/libosmovty.tag.prep: $(top_builddir)/Doxyfile.vty \
89 $(top_srcdir)/include/osmocom/vty/*.h \
90 $(top_srcdir)/src/vty/*.c
Oliver Smith316d1e12019-06-28 09:13:22 +020091 rm -rf $(top_builddir)/doc/vty/html $(top_builddir)/doc/vty/latex
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +010092 rm -rf $(top_builddir)/doc/libosmovty.map
93 -$(DOXYGEN) $(top_builddir)/Doxyfile.vty
94 touch "$@"
95
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +010096$(top_builddir)/doc/libosmocodec.tag.prep: $(top_builddir)/Doxyfile.codec \
97 $(top_srcdir)/include/osmocom/codec/*.h \
98 $(top_srcdir)/src/codec/*.c
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +010099 rm -rf $(top_builddir)/doc/codec; mkdir -p $(top_builddir)/doc/codec
100 rm -rf $(top_builddir)/doc/libosmocodec.map
101 -$(DOXYGEN) $(top_builddir)/Doxyfile.codec
102 touch "$@"
103
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +0100104$(top_builddir)/doc/libosmocoding.tag.prep: $(top_builddir)/Doxyfile.coding \
105 $(top_srcdir)/include/osmocom/coding/*.h \
106 $(top_srcdir)/src/coding/*.c
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100107 rm -rf $(top_builddir)/doc/coding; mkdir -p $(top_builddir)/doc/coding
108 rm -rf $(top_builddir)/doc/libosmocoding.map
109 -$(DOXYGEN) $(top_builddir)/Doxyfile.coding
110 touch "$@"
111
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +0100112$(top_builddir)/doc/libosmoctrl.tag.prep: $(top_builddir)/Doxyfile.ctrl \
113 $(top_srcdir)/include/osmocom/ctrl/*.h \
114 $(top_srcdir)/src/ctrl/*.c
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100115 rm -rf $(top_builddir)/doc/ctrl; mkdir -p $(top_builddir)/doc/ctrl
116 rm -rf $(top_builddir)/doc/libosmoctrl.map
117 -$(DOXYGEN) $(top_builddir)/Doxyfile.ctrl
118 touch "$@"
119
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +0100120$(top_builddir)/doc/libosmogb.tag.prep: $(top_builddir)/Doxyfile.gb \
121 $(top_srcdir)/include/osmocom/gprs/*.h \
122 $(top_srcdir)/src/gb/*.[hc]
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100123 rm -rf $(top_builddir)/doc/gb; mkdir -p $(top_builddir)/doc/gb
124 rm -rf $(top_builddir)/doc/libosmogb.map
125 -$(DOXYGEN) $(top_builddir)/Doxyfile.gb
126 touch "$@"
127
128# Build for real once all depending .tag files are in place.
129# Depend on the own .tag.prep file to avoid concurrent builds of the same doc
130# tree, and to also depend on all the source files listed above.
131#
132# Each library should depend on all the tag.prep files of which it lists .tag
133# files in Doxyfile under TAGFILES.
134#
135# In turn, include all .tag files in TAGFILES of libraries to which "\ref"
136# references point.
137#
138# Easiest is to just depend on all tag.prep files all across everywhere.
139
140$(top_builddir)/doc/core/html/index.html: $(top_builddir)/doc/libosmocore.tag.prep \
141 $(top_builddir)/doc/libosmogsm.tag.prep \
142 $(top_builddir)/doc/libosmovty.tag.prep \
143 $(top_builddir)/doc/libosmocodec.tag.prep \
144 $(top_builddir)/doc/libosmocoding.tag.prep \
145 $(top_builddir)/doc/libosmoctrl.tag.prep \
146 $(top_builddir)/doc/libosmogb.tag.prep
147 rm -rf $(top_builddir)/doc/core; mkdir -p $(top_builddir)/doc/core
Harald Weltec7859ed2011-08-20 12:54:17 +0200148 $(DOXYGEN) Doxyfile.core
Harald Welte21e73c22011-08-17 19:33:06 +0200149
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100150$(top_builddir)/doc/gsm/html/index.html: $(top_builddir)/doc/libosmogsm.tag.prep \
151 $(top_builddir)/doc/libosmocore.tag.prep \
152 $(top_builddir)/doc/libosmovty.tag.prep \
153 $(top_builddir)/doc/libosmocodec.tag.prep \
154 $(top_builddir)/doc/libosmocoding.tag.prep \
155 $(top_builddir)/doc/libosmoctrl.tag.prep \
156 $(top_builddir)/doc/libosmogb.tag.prep
157 rm -rf $(top_builddir)/doc/gsm; mkdir -p $(top_builddir)/doc/gsm
Harald Welte21e73c22011-08-17 19:33:06 +0200158 $(DOXYGEN) Doxyfile.gsm
159
Oliver Smith316d1e12019-06-28 09:13:22 +0200160# Don't delete the entire doc/vty, it contains example.xml and vtydoc.xsd (OS#3986)
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100161$(top_builddir)/doc/vty/html/index.html: $(top_builddir)/doc/libosmovty.tag.prep \
162 $(top_builddir)/doc/libosmocore.tag.prep \
163 $(top_builddir)/doc/libosmogsm.tag.prep \
164 $(top_builddir)/doc/libosmocodec.tag.prep \
165 $(top_builddir)/doc/libosmocoding.tag.prep \
166 $(top_builddir)/doc/libosmoctrl.tag.prep \
167 $(top_builddir)/doc/libosmogb.tag.prep
Oliver Smith316d1e12019-06-28 09:13:22 +0200168 rm -rf $(top_builddir)/doc/vty/html $(top_builddir)/doc/vty/latex
Harald Welte21e73c22011-08-17 19:33:06 +0200169 $(DOXYGEN) Doxyfile.vty
170
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100171$(top_builddir)/doc/codec/html/index.html: $(top_builddir)/doc/libosmocodec.tag.prep \
172 $(top_builddir)/doc/libosmocore.tag.prep \
173 $(top_builddir)/doc/libosmogsm.tag.prep \
174 $(top_builddir)/doc/libosmovty.tag.prep \
175 $(top_builddir)/doc/libosmocoding.tag.prep \
176 $(top_builddir)/doc/libosmoctrl.tag.prep \
177 $(top_builddir)/doc/libosmogb.tag.prep
178 rm -rf $(top_builddir)/doc/codec; mkdir -p $(top_builddir)/doc/codec
Harald Welte21e73c22011-08-17 19:33:06 +0200179 $(DOXYGEN) Doxyfile.codec
180
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100181$(top_builddir)/doc/coding/html/index.html: $(top_builddir)/doc/libosmocoding.tag.prep \
182 $(top_builddir)/doc/libosmocore.tag.prep \
183 $(top_builddir)/doc/libosmogsm.tag.prep \
184 $(top_builddir)/doc/libosmovty.tag.prep \
185 $(top_builddir)/doc/libosmocodec.tag.prep \
186 $(top_builddir)/doc/libosmoctrl.tag.prep \
187 $(top_builddir)/doc/libosmogb.tag.prep
188 rm -rf $(top_builddir)/doc/coding; mkdir -p $(top_builddir)/doc/coding
Vadim Yanitskiy3262f822016-09-23 01:48:59 +0700189 $(DOXYGEN) Doxyfile.coding
190
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100191$(top_builddir)/doc/ctrl/html/index.html: $(top_builddir)/doc/libosmoctrl.tag.prep \
192 $(top_builddir)/doc/libosmocore.tag.prep \
193 $(top_builddir)/doc/libosmogsm.tag.prep \
194 $(top_builddir)/doc/libosmovty.tag.prep \
195 $(top_builddir)/doc/libosmocodec.tag.prep \
196 $(top_builddir)/doc/libosmocoding.tag.prep \
197 $(top_builddir)/doc/libosmogb.tag.prep
198 rm -rf $(top_builddir)/doc/ctrl; mkdir -p $(top_builddir)/doc/ctrl
Harald Welteb4186822018-05-26 17:25:11 +0200199 $(DOXYGEN) Doxyfile.ctrl
200
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100201$(top_builddir)/doc/gb/html/index.html: $(top_builddir)/doc/libosmogb.tag.prep \
202 $(top_builddir)/doc/libosmocore.tag.prep \
203 $(top_builddir)/doc/libosmogsm.tag.prep \
204 $(top_builddir)/doc/libosmovty.tag.prep \
205 $(top_builddir)/doc/libosmocodec.tag.prep \
206 $(top_builddir)/doc/libosmocoding.tag.prep \
207 $(top_builddir)/doc/libosmoctrl.tag.prep
208 rm -rf $(top_builddir)/doc/gb; mkdir -p $(top_builddir)/doc/gb
Neels Hofmeyr249fb712017-06-20 02:52:38 +0200209 $(DOXYGEN) Doxyfile.gb
210
Neels Hofmeyr44c15b72019-02-01 05:56:09 +0100211if HAVE_DOXYGEN
Harald Welte21e73c22011-08-17 19:33:06 +0200212install-data-hook:
Diego Elio Pettenò200710e2012-06-29 13:01:26 -0700213 cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar
Harald Welte21e73c22011-08-17 19:33:06 +0200214
215uninstall-hook:
Harald Welteb4186822018-05-26 17:25:11 +0200216 cd $(DESTDIR)$(htmldir) && rm -rf {core,gsm,vty,codec,coding,ctrl,gb}
Harald Welte21e73c22011-08-17 19:33:06 +0200217
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100218DX_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 +0200219endif
Harald Welte47945f02011-08-20 13:00:37 +0200220
221MOSTLYCLEANFILES = $(DX_CLEAN)