blob: f757fa332ebe641739b6214a2feaccaf7abbfc71 [file] [log] [blame]
Harald Welte20a58c62017-12-13 01:04:42 +01001#!/bin/sh
2
3# Wrapper around the TITAN make file generator to work in Debian.
4#
5# TITAN has a makefile generator, but somehow Debian seems to install
6# the binaries to different paths without patching the make file
7# generator, leading in inconsistent non-working Makefiles.
8#
9# The regexes below patch the generated Makefile to work on Debian 9 and
10# unstable, so far tested with TITAN 6.1.0, 6.2.0 and 6.3.0
Maxdbf15f82017-12-13 11:34:44 +010011#
Harald Welte20a58c62017-12-13 01:04:42 +010012
13ttcn3_makefilegen -l -f $*
14sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile
15sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile
16#sed -i -e 's/TTCN3_LIB = ttcn3-parallel/TTCN3_LIB = ttcn3/' Makefile
Maxdbf15f82017-12-13 11:34:44 +010017
18# The -DMAKEDEPEND_RUN is a workaround for Debian packaging issue,
19# see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879816 for details
20sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -DMAKEDEPEND_RUN -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile
Harald Welte20a58c62017-12-13 01:04:42 +010021
22# for TITAN 6.3.0
23sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile
24sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile