blob: 2e73f72e39183d9edcc7feda4fc4d055088c3d4b [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
Maxff932bb2017-07-04 18:19:38 +020010@RELMAKE@
11
12relengdir = $(includedir)
13releng_DATA = osmo-release.mk
14
Harald Welteee497f22017-10-03 16:54:41 +080015dist_bin_SCRIPTS = osmo-release.sh
16
Maxff932bb2017-07-04 18:19:38 +020017osmo-release.mk: git-version-gen
18
Harald Welte4cd3d8a2010-03-23 00:30:19 +080019BUILT_SOURCES = $(top_srcdir)/.version
20$(top_srcdir)/.version:
21 echo $(VERSION) > $@-t && mv $@-t $@
22dist-hook:
23 echo $(VERSION) > $(distdir)/.tarball-version
Holger Hans Peter Freytherec4f1602011-07-17 12:13:31 +020024
Harald Welteee497f22017-10-03 16:54:41 +080025EXTRA_DIST = git-version-gen .version README.md osmo-release.mk osmo-release.sh
Harald Welte21e73c22011-08-17 19:33:06 +020026
Neels Hofmeyr44c15b72019-02-01 05:56:09 +010027HTML = \
28 $(top_builddir)/doc/core/html/index.html \
29 $(top_builddir)/doc/gsm/html/index.html \
30 $(top_builddir)/doc/vty/html/index.html \
31 $(top_builddir)/doc/codec/html/index.html \
32 $(top_builddir)/doc/coding/html/index.html \
33 $(top_builddir)/doc/ctrl/html/index.html \
34 $(top_builddir)/doc/gb/html/index.html
Harald Welte21e73c22011-08-17 19:33:06 +020035
Neels Hofmeyr44c15b72019-02-01 05:56:09 +010036if HAVE_DOXYGEN
Diego Elio Pettenò200710e2012-06-29 13:01:26 -070037html_DATA = $(top_builddir)/doc/html.tar
Harald Welte21e73c22011-08-17 19:33:06 +020038
Neels Hofmeyr249fb712017-06-20 02:52:38 +020039doc: $(html_DATA)
40
Neels Hofmeyr44c15b72019-02-01 05:56:09 +010041$(html_DATA): apidoc
42else
43DOXYGEN=doxygen
44endif
45
46.PHONY: apidoc
47apidoc: $(HTML)
Harald Welte7992af02011-08-17 19:37:26 +020048 cd $(top_builddir)/doc && tar cf html.tar */html
Harald Welte21e73c22011-08-17 19:33:06 +020049
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +010050# Support doxygen cross references from each library to each other library:
51# First generate the docs to make sure all .tag files are in place.
52# In a second run, generate the content with proper referencing.
53# For example, libosmocore references tags from libosmovty and vice versa,
54# so both need to generate tag files first, and then do another run.
55#
56# Generate each docs tree, and touch a libosmofoo.tag.prep file when done.
57# It means that a libosmofoo.tag file is up-to-date.
58# Touch a separate "*.prep" target: libosmofoo.tag as target would create
59# circular dependency: we would rebuild all every time 'make' is invoked.
60# The .prep file also depends on all the source files for that library.
61
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +010062$(top_builddir)/doc/libosmocore.tag.prep: $(top_builddir)/Doxyfile.core \
63 $(top_srcdir)/include/osmocom/core/*.h \
64 $(top_srcdir)/src/*.[hc] \
65 $(top_srcdir)/src/pseudotalloc/*.[hc]
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +010066 rm -rf $(top_builddir)/doc/core; mkdir -p $(top_builddir)/doc/core
67 rm -rf $(top_builddir)/doc/libosmocore.map
68 -$(DOXYGEN) $(top_builddir)/Doxyfile.core
69 touch "$@"
70
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +010071$(top_builddir)/doc/libosmogsm.tag.prep: $(top_builddir)/Doxyfile.gsm \
72 $(top_srcdir)/include/osmocom/gsm/*.h \
73 $(top_srcdir)/include/osmocom/gsm/protocol/*.h \
74 $(top_srcdir)/include/osmocom/crypt/*.h \
75 $(top_srcdir)/src/gsm/*.c \
76 $(top_srcdir)/src/gsm/milenage/*.[hc]
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +010077 rm -rf $(top_builddir)/doc/gsm; mkdir -p $(top_builddir)/doc/gsm
78 rm -rf $(top_builddir)/doc/libosmogsm.map
79 -$(DOXYGEN) $(top_builddir)/Doxyfile.gsm
80 touch "$@"
81
Oliver Smith316d1e12019-06-28 09:13:22 +020082# Don't delete the entire doc/vty, it contains example.xml and vtydoc.xsd (OS#3986)
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +010083$(top_builddir)/doc/libosmovty.tag.prep: $(top_builddir)/Doxyfile.vty \
84 $(top_srcdir)/include/osmocom/vty/*.h \
85 $(top_srcdir)/src/vty/*.c
Oliver Smith316d1e12019-06-28 09:13:22 +020086 rm -rf $(top_builddir)/doc/vty/html $(top_builddir)/doc/vty/latex
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +010087 rm -rf $(top_builddir)/doc/libosmovty.map
88 -$(DOXYGEN) $(top_builddir)/Doxyfile.vty
89 touch "$@"
90
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +010091$(top_builddir)/doc/libosmocodec.tag.prep: $(top_builddir)/Doxyfile.codec \
92 $(top_srcdir)/include/osmocom/codec/*.h \
93 $(top_srcdir)/src/codec/*.c
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +010094 rm -rf $(top_builddir)/doc/codec; mkdir -p $(top_builddir)/doc/codec
95 rm -rf $(top_builddir)/doc/libosmocodec.map
96 -$(DOXYGEN) $(top_builddir)/Doxyfile.codec
97 touch "$@"
98
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +010099$(top_builddir)/doc/libosmocoding.tag.prep: $(top_builddir)/Doxyfile.coding \
100 $(top_srcdir)/include/osmocom/coding/*.h \
101 $(top_srcdir)/src/coding/*.c
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100102 rm -rf $(top_builddir)/doc/coding; mkdir -p $(top_builddir)/doc/coding
103 rm -rf $(top_builddir)/doc/libosmocoding.map
104 -$(DOXYGEN) $(top_builddir)/Doxyfile.coding
105 touch "$@"
106
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +0100107$(top_builddir)/doc/libosmoctrl.tag.prep: $(top_builddir)/Doxyfile.ctrl \
108 $(top_srcdir)/include/osmocom/ctrl/*.h \
109 $(top_srcdir)/src/ctrl/*.c
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100110 rm -rf $(top_builddir)/doc/ctrl; mkdir -p $(top_builddir)/doc/ctrl
111 rm -rf $(top_builddir)/doc/libosmoctrl.map
112 -$(DOXYGEN) $(top_builddir)/Doxyfile.ctrl
113 touch "$@"
114
Neels Hofmeyr375bf6d2019-02-01 05:25:36 +0100115$(top_builddir)/doc/libosmogb.tag.prep: $(top_builddir)/Doxyfile.gb \
116 $(top_srcdir)/include/osmocom/gprs/*.h \
117 $(top_srcdir)/src/gb/*.[hc]
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100118 rm -rf $(top_builddir)/doc/gb; mkdir -p $(top_builddir)/doc/gb
119 rm -rf $(top_builddir)/doc/libosmogb.map
120 -$(DOXYGEN) $(top_builddir)/Doxyfile.gb
121 touch "$@"
122
123# Build for real once all depending .tag files are in place.
124# Depend on the own .tag.prep file to avoid concurrent builds of the same doc
125# tree, and to also depend on all the source files listed above.
126#
127# Each library should depend on all the tag.prep files of which it lists .tag
128# files in Doxyfile under TAGFILES.
129#
130# In turn, include all .tag files in TAGFILES of libraries to which "\ref"
131# references point.
132#
133# Easiest is to just depend on all tag.prep files all across everywhere.
134
135$(top_builddir)/doc/core/html/index.html: $(top_builddir)/doc/libosmocore.tag.prep \
136 $(top_builddir)/doc/libosmogsm.tag.prep \
137 $(top_builddir)/doc/libosmovty.tag.prep \
138 $(top_builddir)/doc/libosmocodec.tag.prep \
139 $(top_builddir)/doc/libosmocoding.tag.prep \
140 $(top_builddir)/doc/libosmoctrl.tag.prep \
141 $(top_builddir)/doc/libosmogb.tag.prep
142 rm -rf $(top_builddir)/doc/core; mkdir -p $(top_builddir)/doc/core
Harald Weltec7859ed2011-08-20 12:54:17 +0200143 $(DOXYGEN) Doxyfile.core
Harald Welte21e73c22011-08-17 19:33:06 +0200144
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100145$(top_builddir)/doc/gsm/html/index.html: $(top_builddir)/doc/libosmogsm.tag.prep \
146 $(top_builddir)/doc/libosmocore.tag.prep \
147 $(top_builddir)/doc/libosmovty.tag.prep \
148 $(top_builddir)/doc/libosmocodec.tag.prep \
149 $(top_builddir)/doc/libosmocoding.tag.prep \
150 $(top_builddir)/doc/libosmoctrl.tag.prep \
151 $(top_builddir)/doc/libosmogb.tag.prep
152 rm -rf $(top_builddir)/doc/gsm; mkdir -p $(top_builddir)/doc/gsm
Harald Welte21e73c22011-08-17 19:33:06 +0200153 $(DOXYGEN) Doxyfile.gsm
154
Oliver Smith316d1e12019-06-28 09:13:22 +0200155# Don't delete the entire doc/vty, it contains example.xml and vtydoc.xsd (OS#3986)
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100156$(top_builddir)/doc/vty/html/index.html: $(top_builddir)/doc/libosmovty.tag.prep \
157 $(top_builddir)/doc/libosmocore.tag.prep \
158 $(top_builddir)/doc/libosmogsm.tag.prep \
159 $(top_builddir)/doc/libosmocodec.tag.prep \
160 $(top_builddir)/doc/libosmocoding.tag.prep \
161 $(top_builddir)/doc/libosmoctrl.tag.prep \
162 $(top_builddir)/doc/libosmogb.tag.prep
Oliver Smith316d1e12019-06-28 09:13:22 +0200163 rm -rf $(top_builddir)/doc/vty/html $(top_builddir)/doc/vty/latex
Harald Welte21e73c22011-08-17 19:33:06 +0200164 $(DOXYGEN) Doxyfile.vty
165
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100166$(top_builddir)/doc/codec/html/index.html: $(top_builddir)/doc/libosmocodec.tag.prep \
167 $(top_builddir)/doc/libosmocore.tag.prep \
168 $(top_builddir)/doc/libosmogsm.tag.prep \
169 $(top_builddir)/doc/libosmovty.tag.prep \
170 $(top_builddir)/doc/libosmocoding.tag.prep \
171 $(top_builddir)/doc/libosmoctrl.tag.prep \
172 $(top_builddir)/doc/libosmogb.tag.prep
173 rm -rf $(top_builddir)/doc/codec; mkdir -p $(top_builddir)/doc/codec
Harald Welte21e73c22011-08-17 19:33:06 +0200174 $(DOXYGEN) Doxyfile.codec
175
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100176$(top_builddir)/doc/coding/html/index.html: $(top_builddir)/doc/libosmocoding.tag.prep \
177 $(top_builddir)/doc/libosmocore.tag.prep \
178 $(top_builddir)/doc/libosmogsm.tag.prep \
179 $(top_builddir)/doc/libosmovty.tag.prep \
180 $(top_builddir)/doc/libosmocodec.tag.prep \
181 $(top_builddir)/doc/libosmoctrl.tag.prep \
182 $(top_builddir)/doc/libosmogb.tag.prep
183 rm -rf $(top_builddir)/doc/coding; mkdir -p $(top_builddir)/doc/coding
Vadim Yanitskiy3262f822016-09-23 01:48:59 +0700184 $(DOXYGEN) Doxyfile.coding
185
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100186$(top_builddir)/doc/ctrl/html/index.html: $(top_builddir)/doc/libosmoctrl.tag.prep \
187 $(top_builddir)/doc/libosmocore.tag.prep \
188 $(top_builddir)/doc/libosmogsm.tag.prep \
189 $(top_builddir)/doc/libosmovty.tag.prep \
190 $(top_builddir)/doc/libosmocodec.tag.prep \
191 $(top_builddir)/doc/libosmocoding.tag.prep \
192 $(top_builddir)/doc/libosmogb.tag.prep
193 rm -rf $(top_builddir)/doc/ctrl; mkdir -p $(top_builddir)/doc/ctrl
Harald Welteb4186822018-05-26 17:25:11 +0200194 $(DOXYGEN) Doxyfile.ctrl
195
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100196$(top_builddir)/doc/gb/html/index.html: $(top_builddir)/doc/libosmogb.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/libosmocodec.tag.prep \
201 $(top_builddir)/doc/libosmocoding.tag.prep \
202 $(top_builddir)/doc/libosmoctrl.tag.prep
203 rm -rf $(top_builddir)/doc/gb; mkdir -p $(top_builddir)/doc/gb
Neels Hofmeyr249fb712017-06-20 02:52:38 +0200204 $(DOXYGEN) Doxyfile.gb
205
Neels Hofmeyr44c15b72019-02-01 05:56:09 +0100206if HAVE_DOXYGEN
Harald Welte21e73c22011-08-17 19:33:06 +0200207install-data-hook:
Diego Elio Pettenò200710e2012-06-29 13:01:26 -0700208 cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar
Harald Welte21e73c22011-08-17 19:33:06 +0200209
210uninstall-hook:
Harald Welteb4186822018-05-26 17:25:11 +0200211 cd $(DESTDIR)$(htmldir) && rm -rf {core,gsm,vty,codec,coding,ctrl,gb}
Harald Welte21e73c22011-08-17 19:33:06 +0200212
Neels Hofmeyr2fe50ac2019-02-01 05:25:36 +0100213DX_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 +0200214endif
Harald Welte47945f02011-08-20 13:00:37 +0200215
216MOSTLYCLEANFILES = $(DX_CLEAN)