Commit 43e665c4 authored by Gábor Szalai's avatar Gábor Szalai
Browse files

Makefilegen: adopt for the Debian packaging

The Debian and Ubuntu packages install the
- headers into /usr/include/titan
- libraries into /usr/lib/titan

So the generated Makefile tries to detect the presence of these
directories if the TTCN3_DIR is not set, and adjust the CPPFLAGS and the
linker command
Signed-off-by: Gábor Szalai's avatarGabor Szalai <>
parent d7574bab
......@@ -2073,12 +2073,14 @@ static void print_makefile(struct makefile_struct *makefile)
fprintf(fp, "#\n"
fprintf(fp, "#\n"
"# Set these variables...\n"
"# The path of your TTCN-3 Test Executor installation:\n"
"# Uncomment this line to override the environment variable.\n"
"ifndef TTCN3_DIR\n"
"TTCN3_DIR = %s\n"
......@@ -2086,7 +2088,22 @@ static void print_makefile(struct makefile_struct *makefile)
"# The value below points to the location of the TITAN version\n"
"# that generated this makefile.\n" : ""
, titan_dir ? titan_dir : "");
if (titan_dir) Free(titan_dir);
} else {
fprintf(fp, "#\n"
"# Set these variables...\n"
"ifndef TTCN3_DIR\n"
"ifneq (,$(wildcard /usr/include/titan/))\n"
"TTCN3_DIR = /usr\n"
"TTCN3_SUBDIR = /titan\n"
"TTCN3_DIR = \n"
boolean cxx_free = FALSE;
if (makefile->cxxcompiler) {
......@@ -2123,7 +2140,7 @@ static void print_makefile(struct makefile_struct *makefile)
fputs("# Flags for the C++ preprocessor (and makedepend as well):\n"
"CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)/include", fp);
"CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)/include$(TTCN3_SUBDIR)", fp);
// enable debug mode for the generated code, too
......@@ -3800,7 +3817,7 @@ static void print_makefile(struct makefile_struct *makefile)
fprintf(fp, " \\\n"
"\t-L$(TTCN3_DIR)/lib -l$(TTCN3_LIB)"
"\t-L$(TTCN3_DIR)/lib$(TTCN3_SUBDIR) -l$(TTCN3_LIB)"
" \\\n"
"\t-L$(OPENSSL_DIR)/lib -lcrypto");
if (!makefile->linkingStrategy) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment