summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2018-11-14 14:25:18 +0100
committerOliver Smith <osmith@sysmocom.de>2018-11-21 14:29:05 +0100
commit2947683c3ac2ac94fda43c21be491c6417321e2b (patch)
treeb3f5fceabd3dde5f9dbaa4f51c36b87f92d0d009
parentfc9426e02ee6a448f22a42b95866a2c91b77fd4e (diff)
use autotools to add "make install" target
For reasoning why a transition to autotools is desired, see the commit message of the previous patch in this series. "make install" copies the "build", "common" dirs, as well as the "*.xsl" files to $(prefix)/share/osmo-gsm-manuals. Prefix is typically /usr/local. Also a pkg-config file gets installed, so the path of the shared files can be looked up by autoconf scripts of the project repositories. The check-depends script is installed to $(prefix)/bin/osmo-gsm-manuals-check-depends and will be used by project specific autoconf scripts, too. All existing make targets ("make", "make check", "make upload") are still working, users only need to run "autoreconf -fi" and "./configure" beforehand. Makefile.am uses custom install-data-hook and uninstall-local targets, so we don't need to specify each file of the relevant subdirs in a _DATA variable (no extra maintenance effort). (moving manuals to project repositories 5/19) Related: OS#3385 Change-Id: I8e7036fae062ee783cb132b14608827a82c5e7c7
-rw-r--r--.gitignore20
-rw-r--r--INSTALL.txt5
-rw-r--r--Makefile78
-rw-r--r--Makefile.am51
-rw-r--r--OsmoBSC/Makefile.am (renamed from OsmoBSC/Makefile)0
-rw-r--r--OsmoBTS/Makefile.am (renamed from OsmoBTS/Makefile)0
-rw-r--r--OsmoGGSN/Makefile.am (renamed from OsmoGGSN/Makefile)0
-rw-r--r--OsmoGSMTester/Makefile.am (renamed from OsmoGSMTester/Makefile)0
-rw-r--r--OsmoHLR/Makefile.am (renamed from OsmoHLR/Makefile)0
-rw-r--r--OsmoMGCP/Makefile.am (renamed from OsmoMGCP/Makefile)0
-rw-r--r--OsmoMGW/Makefile.am (renamed from OsmoMGW/Makefile)0
-rw-r--r--OsmoMSC/Makefile.am (renamed from OsmoMSC/Makefile)0
-rw-r--r--OsmoNAT/Makefile.am (renamed from OsmoNAT/Makefile)0
-rw-r--r--OsmoNITB/Makefile.am (renamed from OsmoNITB/Makefile)0
-rw-r--r--OsmoPCU/Makefile.am (renamed from OsmoPCU/Makefile)0
-rw-r--r--OsmoSGSN/Makefile.am (renamed from OsmoSGSN/Makefile)0
-rw-r--r--OsmoSIPConnector/Makefile.am (renamed from OsmoSIPConnector/Makefile)0
-rw-r--r--OsmoSTP/Makefile.am (renamed from OsmoSTP/Makefile)0
-rw-r--r--OsmoTRX/Makefile.am (renamed from OsmoTRX/Makefile)0
-rw-r--r--OsmocomBB/Makefile.am (renamed from OsmocomBB/Makefile)0
-rw-r--r--build/Makefile.common.inc2
-rw-r--r--configure.ac46
-rwxr-xr-xcontrib/jenkins.sh2
-rw-r--r--osmo-gsm-manuals.pc.in6
-rw-r--r--tests/Makefile.am (renamed from tests/Makefile)0
25 files changed, 131 insertions, 79 deletions
diff --git a/.gitignore b/.gitignore
index fbe2111..30bc93e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,23 @@ tests/test-usermanual.adoc
# git-version-gen
.tarball-version
.version
+
+# autotools
+aclocal.m4
+autom4te.cache/
+config.log
+config.status
+config.guess
+config.sub
+configure
+compile
+depcomp
+install-sh
+missing
+stamp-h1
+libtool
+ltmain.sh
+m4/*.m4
+*.pc
+Makefile.in
+Makefile
diff --git a/INSTALL.txt b/INSTALL.txt
index 9c3ee7b..6efe8d1 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -15,8 +15,11 @@ apt-get install \
(Note that asciidoc-dblatex is required from debian 9 on and did not exist before.)
Build PDFs, run:
+ autoreconf -fi
+ ./configure
make
-or for a parallel build using more CPU cores:
+
+or for a parallel build using more CPU cores, replace make with:
make -j 5
To update the VTY reference for a given program, use 'osmo_interact_vty.py -X',
diff --git a/Makefile b/Makefile
deleted file mode 100644
index c94f0a8..0000000
--- a/Makefile
+++ /dev/null
@@ -1,78 +0,0 @@
-all: check-deps
- cd OsmoBTS; $(MAKE)
- cd OsmoNITB; $(MAKE)
- cd OsmoBSC; $(MAKE)
- cd OsmoMGCP; $(MAKE)
- cd OsmoSGSN; $(MAKE)
- cd OsmoGGSN; $(MAKE)
- cd OsmoNAT; $(MAKE)
- cd OsmoPCU; $(MAKE)
- cd OsmoGSMTester; $(MAKE)
- cd OsmoMSC; $(MAKE)
- cd OsmoHLR; $(MAKE)
- cd OsmoSIPConnector; $(MAKE)
- cd OsmoSTP; $(MAKE)
- cd OsmocomBB; $(MAKE)
- cd OsmoMGW; $(MAKE)
- cd OsmoTRX; $(MAKE)
-
-clean:
- cd tests; $(MAKE) clean
- cd OsmoBTS; $(MAKE) clean
- cd OsmoNITB; $(MAKE) clean
- cd OsmoBSC; $(MAKE) clean
- cd OsmoMGCP; $(MAKE) clean
- cd OsmoSGSN; $(MAKE) clean
- cd OsmoGGSN; $(MAKE) clean
- cd OsmoNAT; $(MAKE) clean
- cd OsmoPCU; $(MAKE) clean
- cd OsmoGSMTester; $(MAKE) clean
- cd OsmoMSC; $(MAKE) clean
- cd OsmoHLR; $(MAKE) clean
- cd OsmoSIPConnector; $(MAKE) clean
- cd OsmoSTP; $(MAKE) clean
- cd OsmocomBB; $(MAKE) clean
- cd OsmoMGW; $(MAKE) clean
- cd OsmoTRX; $(MAKE) clean
-
-upload:
- cd OsmoBTS; $(MAKE) upload
- cd OsmoNITB; $(MAKE) upload
- cd OsmoBSC; $(MAKE) upload
- cd OsmoMGCP; $(MAKE) upload
- cd OsmoSGSN; $(MAKE) upload
- cd OsmoGGSN; $(MAKE) upload
- cd OsmoNAT; $(MAKE) upload
- cd OsmoPCU; $(MAKE) upload
- cd OsmoGSMTester; $(MAKE) upload
- cd OsmoMSC; $(MAKE) upload
- cd OsmoHLR; $(MAKE) upload
- cd OsmoSIPConnector; $(MAKE) upload
- cd OsmoSTP; $(MAKE) upload
- cd OsmocomBB; $(MAKE) upload
- cd OsmoMGW; $(MAKE) upload
- cd OsmoTRX; $(MAKE) upload
-
-check:
- cd tests; $(MAKE)
- cd OsmoBTS; $(MAKE) check
- cd OsmoNITB; $(MAKE) check
- cd OsmoBSC; $(MAKE) check
- cd OsmoSGSN; $(MAKE) check
- cd OsmoGGSN; $(MAKE) check
- cd OsmoPCU; $(MAKE) check
- cd OsmoSTP; $(MAKE) check
- # These don't use asciidoc, so they have no 'make check' target:
- #cd OsmoMGCP; $(MAKE) check
- #cd OsmoNAT; $(MAKE) check
- #cd OsmoMGW; $(MAKE) check
- cd OsmoGSMTester; $(MAKE) check
- cd OsmoMSC; $(MAKE) check
- cd OsmoHLR; $(MAKE) check
- cd OsmoSIPConnector; $(MAKE) check
- cd OsmoSTP; $(MAKE) check
- cd OsmocomBB; $(MAKE) check
- cd OsmoTRX; $(MAKE) check
-
-check-deps:
- ./check-depends.sh
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..dc8f1ca
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,51 @@
+share_files = $(srcdir)/build $(srcdir)/common $(srcdir)/*.xsl
+share_path = "$(DESTDIR)$(prefix)/share/osmo-gsm-manuals"
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = osmo-gsm-manuals.pc
+BUILT_SOURCES = $(top_srcdir)/.version
+EXTRA_DIST = git-version-gen .version check-depends.sh $(share_files)
+SUBDIRS = tests \
+ OsmoBSC \
+ OsmoBTS \
+ OsmoGGSN \
+ OsmoGSMTester \
+ OsmoHLR \
+ OsmoMGCP \
+ OsmoMGW \
+ OsmoMSC \
+ OsmoNAT \
+ OsmoNITB \
+ OsmoPCU \
+ OsmoSGSN \
+ OsmoSIPConnector \
+ OsmoSTP \
+ OsmoTRX \
+ OsmocomBB
+
+$(top_srcdir)/.version:
+ echo $(VERSION) > $@-t && mv $@-t $@
+
+dist-hook:
+ echo $(VERSION) > $(distdir)/.tarball-version
+
+install-data-hook:
+ cd "$(srcdir)" && \
+ files="$$(find $(notdir $(share_files)) -not -type d)" && \
+ for i in $$files; do \
+ if [ -x "$$i" ]; then \
+ mode=755; \
+ else \
+ mode=644; \
+ fi; \
+ install -vDm$$mode "$$i" "$(share_path)/$$i" || exit 1; \
+ done;
+ install -Dm755 "$(srcdir)/check-depends.sh" "$(DESTDIR)$(prefix)/bin/osmo-gsm-manuals-check-depends"
+
+uninstall-local:
+ rm -rv "$(share_path)" "$(DESTDIR)$(prefix)/bin/osmo-gsm-manuals-check-depends"
+
+upload:
+ for i in Osmo*; do \
+ $(MAKE) -C "$$i" upload || exit 1; \
+ done
diff --git a/OsmoBSC/Makefile b/OsmoBSC/Makefile.am
index 422c598..422c598 100644
--- a/OsmoBSC/Makefile
+++ b/OsmoBSC/Makefile.am
diff --git a/OsmoBTS/Makefile b/OsmoBTS/Makefile.am
index 536ed17..536ed17 100644
--- a/OsmoBTS/Makefile
+++ b/OsmoBTS/Makefile.am
diff --git a/OsmoGGSN/Makefile b/OsmoGGSN/Makefile.am
index dce2b02..dce2b02 100644
--- a/OsmoGGSN/Makefile
+++ b/OsmoGGSN/Makefile.am
diff --git a/OsmoGSMTester/Makefile b/OsmoGSMTester/Makefile.am
index 4fe6748..4fe6748 100644
--- a/OsmoGSMTester/Makefile
+++ b/OsmoGSMTester/Makefile.am
diff --git a/OsmoHLR/Makefile b/OsmoHLR/Makefile.am
index 321c2a1..321c2a1 100644
--- a/OsmoHLR/Makefile
+++ b/OsmoHLR/Makefile.am
diff --git a/OsmoMGCP/Makefile b/OsmoMGCP/Makefile.am
index d47f390..d47f390 100644
--- a/OsmoMGCP/Makefile
+++ b/OsmoMGCP/Makefile.am
diff --git a/OsmoMGW/Makefile b/OsmoMGW/Makefile.am
index 96b436b..96b436b 100644
--- a/OsmoMGW/Makefile
+++ b/OsmoMGW/Makefile.am
diff --git a/OsmoMSC/Makefile b/OsmoMSC/Makefile.am
index 2548852..2548852 100644
--- a/OsmoMSC/Makefile
+++ b/OsmoMSC/Makefile.am
diff --git a/OsmoNAT/Makefile b/OsmoNAT/Makefile.am
index 8d7c4a5..8d7c4a5 100644
--- a/OsmoNAT/Makefile
+++ b/OsmoNAT/Makefile.am
diff --git a/OsmoNITB/Makefile b/OsmoNITB/Makefile.am
index 4b275dd..4b275dd 100644
--- a/OsmoNITB/Makefile
+++ b/OsmoNITB/Makefile.am
diff --git a/OsmoPCU/Makefile b/OsmoPCU/Makefile.am
index 0f0ae76..0f0ae76 100644
--- a/OsmoPCU/Makefile
+++ b/OsmoPCU/Makefile.am
diff --git a/OsmoSGSN/Makefile b/OsmoSGSN/Makefile.am
index ce69960..ce69960 100644
--- a/OsmoSGSN/Makefile
+++ b/OsmoSGSN/Makefile.am
diff --git a/OsmoSIPConnector/Makefile b/OsmoSIPConnector/Makefile.am
index e275e41..e275e41 100644
--- a/OsmoSIPConnector/Makefile
+++ b/OsmoSIPConnector/Makefile.am
diff --git a/OsmoSTP/Makefile b/OsmoSTP/Makefile.am
index 10149bf..10149bf 100644
--- a/OsmoSTP/Makefile
+++ b/OsmoSTP/Makefile.am
diff --git a/OsmoTRX/Makefile b/OsmoTRX/Makefile.am
index 3b4b8b1..3b4b8b1 100644
--- a/OsmoTRX/Makefile
+++ b/OsmoTRX/Makefile.am
diff --git a/OsmocomBB/Makefile b/OsmocomBB/Makefile.am
index a0b7a2a..a0b7a2a 100644
--- a/OsmocomBB/Makefile
+++ b/OsmocomBB/Makefile.am
diff --git a/build/Makefile.common.inc b/build/Makefile.common.inc
index e624b5f..6a210bc 100644
--- a/build/Makefile.common.inc
+++ b/build/Makefile.common.inc
@@ -12,3 +12,5 @@ upload: $(UPLOAD_FILES)
clean:
-rm -rf $(CLEAN_FILES)
+
+distclean: clean
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..e890b3e
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,46 @@
+dnl Process this file with autoconf to produce a configure script
+AC_INIT([osmo-gsm-manuals],
+ m4_esyscmd([./git-version-gen .tarball-version]),
+ [openbsc@lists.osmocom.org])
+
+dnl *This* is the root dir, even if an install-sh exists in ../ or ../../
+AC_CONFIG_AUX_DIR([.])
+
+AM_INIT_AUTOMAKE([foreign dist-bzip2 1.6 subdir-objects])
+
+dnl checks for programs
+AC_PROG_INSTALL
+LT_INIT
+
+dnl check for pkg-config (explained in detail in libosmocore/configure.ac)
+AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no)
+if test "x$PKG_CONFIG_INSTALLED" = "xno"; then
+ AC_MSG_WARN([You need to install pkg-config])
+fi
+PKG_PROG_PKG_CONFIG([0.20])
+
+if ! $srcdir/check-depends.sh
+then
+ AC_MSG_ERROR("missing dependencies!")
+fi
+
+AC_OUTPUT(
+ osmo-gsm-manuals.pc
+ Makefile
+ tests/Makefile
+ OsmoBSC/Makefile
+ OsmoBTS/Makefile
+ OsmoGGSN/Makefile
+ OsmoGSMTester/Makefile
+ OsmoHLR/Makefile
+ OsmoMGCP/Makefile
+ OsmoMGW/Makefile
+ OsmoMSC/Makefile
+ OsmoNAT/Makefile
+ OsmoNITB/Makefile
+ OsmoPCU/Makefile
+ OsmoSGSN/Makefile
+ OsmoSIPConnector/Makefile
+ OsmoSTP/Makefile
+ OsmoTRX/Makefile
+ OsmocomBB/Makefile)
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 80d873d..1fd19d1 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -6,6 +6,8 @@ publish="$1"
osmo-clean-workspace.sh
+autoreconf -fi
+./configure
$MAKE $PARALLEL_MAKE
$MAKE $PARALLEL_MAKE check
diff --git a/osmo-gsm-manuals.pc.in b/osmo-gsm-manuals.pc.in
new file mode 100644
index 0000000..f9b318e
--- /dev/null
+++ b/osmo-gsm-manuals.pc.in
@@ -0,0 +1,6 @@
+prefix=@prefix@
+osmogsmmanualsdir=@prefix@/share/osmo-gsm-manuals
+
+Name: Osmocom GSM Manuals Development Files
+Description: Common files for building manuals of Osmocom programs
+Version: @VERSION@
diff --git a/tests/Makefile b/tests/Makefile.am
index 5afc8ca..5afc8ca 100644
--- a/tests/Makefile
+++ b/tests/Makefile.am