From 20a58c6d6f4bb80814e2ff89d4f0ac0e45ea41cc Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 13 Dec 2017 01:04:42 +0100 Subject: generalize shared code from regen_makefile.sh into shared helper script Change-Id: I86a738420851a7d9e3bdb2671f6862c3d505a4ba --- bsc-nat/regen_makefile.sh | 10 +--------- bsc/regen_makefile.sh | 10 +--------- ggsn_tests/regen_makefile.sh | 10 +--------- gprs_gb/regen_makefile.sh | 10 +--------- lapdm/regen_makefile.sh | 10 +--------- mgw/regen_makefile.sh | 10 +--------- msc_tests/regen_makefile.sh | 10 +--------- regen-makefile.sh | 20 ++++++++++++++++++++ selftest/regen_makefile.sh | 10 +--------- sysinfo/regen_makefile.sh | 10 +--------- 10 files changed, 29 insertions(+), 81 deletions(-) create mode 100755 regen-makefile.sh diff --git a/bsc-nat/regen_makefile.sh b/bsc-nat/regen_makefile.sh index 6d0ac127..a3c62431 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 4e334d5e..8b8fa435 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 cd2d95ae..3970187c 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 72fc632b..b883d1ee 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 c80b0946..c3601c80 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 30f8c337..9b94d69c 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 7db539d0..132da3bd 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 00000000..18146998 --- /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 086441b7..eefda497 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 e06b8f50..9dd3b7f2 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 -- cgit v1.2.3