summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-12-13 01:04:42 +0100
committerHarald Welte <laforge@gnumonks.org>2017-12-13 01:04:42 +0100
commit20a58c6d6f4bb80814e2ff89d4f0ac0e45ea41cc (patch)
tree488901d2bb205bc77c461ba8ba4d716f47d4eb6f
parente65d40e4dbea5b7d7f5ffd2bb9bde4d4dcd38d27 (diff)
generalize shared code from regen_makefile.sh into shared helper script
-rwxr-xr-xbsc-nat/regen_makefile.sh10
-rwxr-xr-xbsc/regen_makefile.sh10
-rwxr-xr-xggsn_tests/regen_makefile.sh10
-rwxr-xr-xgprs_gb/regen_makefile.sh10
-rwxr-xr-xlapdm/regen_makefile.sh10
-rwxr-xr-xmgw/regen_makefile.sh10
-rwxr-xr-xmsc_tests/regen_makefile.sh10
-rwxr-xr-xregen-makefile.sh20
-rwxr-xr-xselftest/regen_makefile.sh10
-rwxr-xr-xsysinfo/regen_makefile.sh10
10 files changed, 29 insertions, 81 deletions
diff --git a/bsc-nat/regen_makefile.sh b/bsc-nat/regen_makefile.sh
index 6d0ac12..a3c6243 100755
--- a/bsc-nat/regen_makefile.sh
+++ b/bsc-nat/regen_makefile.sh
@@ -4,12 +4,4 @@ MAIN=IPA_Test.ttcn
FILES="*.ttcn SCCP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc RTP_EncDec.cc SDP_EncDec.cc *.c MGCP_CodecPort_CtrlFunctDef.cc"
-ttcn3_makefilegen -l -f $MAIN $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh $MAIN $FILES
diff --git a/bsc/regen_makefile.sh b/bsc/regen_makefile.sh
index 4e334d5..8b8fa43 100755
--- a/bsc/regen_makefile.sh
+++ b/bsc/regen_makefile.sh
@@ -4,12 +4,4 @@ MAIN=BSC_Tests.ttcn
FILES="*.ttcn IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc SCTPasp_PT.cc RTP_EncDec.cc SDP_EncDec.cc *.c"
-ttcn3_makefilegen -l -f $MAIN $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh $MAIN $FILES
diff --git a/ggsn_tests/regen_makefile.sh b/ggsn_tests/regen_makefile.sh
index cd2d95a..3970187 100755
--- a/ggsn_tests/regen_makefile.sh
+++ b/ggsn_tests/regen_makefile.sh
@@ -2,12 +2,4 @@
FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc GTPC_EncDec.cc GTPU_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc ICMPv6_EncDec.cc IP_EncDec.cc Native_FunctionDefs.cc UDP_EncDec.cc"
-ttcn3_makefilegen -l -f GGSN_Tests.ttcn $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh GGSN_Tests.ttcn $FILES
diff --git a/gprs_gb/regen_makefile.sh b/gprs_gb/regen_makefile.sh
index 72fc632..b883d1e 100755
--- a/gprs_gb/regen_makefile.sh
+++ b/gprs_gb/regen_makefile.sh
@@ -2,12 +2,4 @@
FILES="*.ttcn BSSGP_Helper.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc NS_CodecPort_CtrlFunctDef.cc UD_PT.cc RLCMAC_EncDec.cc"
-ttcn3_makefilegen -f Test.ttcn $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan/' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh Test.ttcn $FILES
diff --git a/lapdm/regen_makefile.sh b/lapdm/regen_makefile.sh
index c80b094..c3601c8 100755
--- a/lapdm/regen_makefile.sh
+++ b/lapdm/regen_makefile.sh
@@ -2,12 +2,4 @@
FILES="*.ttcn UD_PT.cc UD_PT.hh RLCMAC_EncDec.cc"
-ttcn3_makefilegen -f L1CTL_Test.ttcn $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan `pkg-config --libs libnetfilter_conntrack`/' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh L1CTL_Test.ttcn $FILES
diff --git a/mgw/regen_makefile.sh b/mgw/regen_makefile.sh
index 30f8c33..9b94d69 100755
--- a/mgw/regen_makefile.sh
+++ b/mgw/regen_makefile.sh
@@ -2,12 +2,4 @@
FILES="*.ttcn SDP_EncDec.cc *.c MGCP_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc RTP_EncDec.cc RTP_CodecPort_CtrlFunctDef.cc"
-ttcn3_makefilegen -l -f MGCP_Test.ttcn $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh MGCP_Test.ttcn $FILES
diff --git a/msc_tests/regen_makefile.sh b/msc_tests/regen_makefile.sh
index 7db539d..132da3b 100755
--- a/msc_tests/regen_makefile.sh
+++ b/msc_tests/regen_makefile.sh
@@ -2,12 +2,4 @@
FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc"
-ttcn3_makefilegen -l -f MSC_Tests.ttcn $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh MSC_Tests.ttcn $FILES
diff --git a/regen-makefile.sh b/regen-makefile.sh
new file mode 100755
index 0000000..1814699
--- /dev/null
+++ b/regen-makefile.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Wrapper around the TITAN make file generator to work in Debian.
+#
+# TITAN has a makefile generator, but somehow Debian seems to install
+# the binaries to different paths without patching the make file
+# generator, leading in inconsistent non-working Makefiles.
+#
+# The regexes below patch the generated Makefile to work on Debian 9 and
+# unstable, so far tested with TITAN 6.1.0, 6.2.0 and 6.3.0
+
+ttcn3_makefilegen -l -f $*
+sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
+sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
+#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
+sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
+
+# for TITAN 6.3.0
+sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
+sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
diff --git a/selftest/regen_makefile.sh b/selftest/regen_makefile.sh
index 086441b..eefda49 100755
--- a/selftest/regen_makefile.sh
+++ b/selftest/regen_makefile.sh
@@ -4,12 +4,4 @@ MAIN=Selftest.ttcn
FILES="*.ttcn IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc SDP_EncDec.cc *.c"
-ttcn3_makefilegen -l -f $MAIN $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh $MAIN $FILES
diff --git a/sysinfo/regen_makefile.sh b/sysinfo/regen_makefile.sh
index e06b8f5..9dd3b7f 100755
--- a/sysinfo/regen_makefile.sh
+++ b/sysinfo/regen_makefile.sh
@@ -2,12 +2,4 @@
FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc IPL4_GSMTAP_CtrlFunctDef.cc TELNETasp_PT.cc"
-ttcn3_makefilegen -l -f Test.ttcn $FILES
-sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
-#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
-sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
-
-# for TITAN 6.3.0
-sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
-sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile
+../regen-makefile.sh Test.ttcn $FILES