Sync with 5.4.0
[deliverable/titan.core.git] / mctr2 / mctr / Makefile
1 ###############################################################################
2 # Copyright (c) 2000-2015 Ericsson Telecom AB
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Eclipse Public License v1.0
5 # which accompanies this distribution, and is available at
6 # http://www.eclipse.org/legal/epl-v10.html
7 ###############################################################################
8 # Makefile for the TTCN-3 Main Controller
9
10 TOP := ../..
11 include $(TOP)/Makefile.cfg
12
13 TARGETS :=
14
15 ifeq ($(CLI), yes)
16 TARGETS += mctr_cli$(EXESUFFIX)
17 endif
18
19 ORIGINATORS := main.cc
20
21 GENERATED_SOURCES := Cli_main.cc
22
23 STATIC_SOURCES := MctrError.cc MainController.cc UserInterface.cc config_data.cc
24
25 SOURCES := $(STATIC_SOURCES) $(GENERATED_SOURCES)
26
27 GENERATED_HEADERS :=
28
29 GENERATED_OTHERS :=
30
31 OBJECTS := $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(SOURCES)))
32
33 OBJECTS_NOMAIN := $(filter-out Cli_main.o, $(OBJECTS))
34
35 COMMON_OBJECTS := $(addprefix ../../common/, memory.o config_preproc.o \
36 config_preproc_la.o config_preproc_p.tab.o path.o NetworkHandler.o \
37 Path2.o) ../../core/RInt.o ../../core/Textbuf.o
38
39 ifeq ($(LICENSING), yes)
40 COMMON_OBJECTS += ../../common/license.o
41 endif
42
43 COMMON_OBJECTS_CLI := $(COMMON_OBJECTS)
44
45 DEPFILES := $(patsubst %.cc,%.d,$(patsubst %.c,%.d,$(SOURCES)))
46
47 SUBDIRS :=
48
49 CPPFLAGS += -D_REENTRANT -I../../core -I../../common
50
51 ifdef OPENSSL_DIR
52 ifneq ($(OPENSSL_DIR), default)
53 CPPFLAGS += -I$(OPENSSL_DIR)/include
54 LDFLAGS += -L$(OPENSSL_DIR)/lib
55 endif
56 endif
57
58 # Platform specific libraries that are necessary for CLI # versions.
59 SOLARIS_LIBS := -lpthread -lsocket -lnsl
60 SOLARIS8_LIBS := -lpthread -lsocket -lnsl
61 LINUX_LIBS := -lpthread
62 FREEBSD_LIBS := -lpthread
63 WIN32_LIBS := -lpthread
64
65 SOLARIS_CLI_LIBS := -lcurses
66 SOLARIS8_CLI_LIBS := -lcurses
67 LINUX_CLI_LIBS := -lncurses
68 FREEBSD_CLI_LIBS := -lncurses
69 WIN32_CLI_LIBS := -lncurses
70 INTERIX_CLI_LIBS := -lncurses
71
72 all run: $(TARGETS)
73
74 mctr_cli$(EXESUFFIX): Cli_main.o $(OBJECTS_NOMAIN) $(COMMON_OBJECTS_CLI) \
75 ../cli/libcli.a ../editline/build/src/.libs/libedit.a
76 $(CXX) $(LDFLAGS) -o $@ $^ \
77 -lcrypto $($(PLATFORM)_CLI_LIBS) $($(PLATFORM)_LIBS) $(RSLICLIB)
78
79 install: $(TARGETS)
80 ifeq ($(DEBUG), no)
81 $(STRIP) $(TARGETS)
82 endif
83 mkdir -p $(BINDIR)
84 cp $(TARGETS) $(BINDIR)
85 ifeq ($(CLI), yes)
86 ln -s mctr_cli$(EXESUFFIX) $(BINDIR)/mctr$(EXESUFFIX)
87 endif
88 cp ttcn3_start $(BINDIR)
89 chmod +x $(BINDIR)/ttcn3_start
90
91 Cli_main.cc: main.cc
92 @echo "#define CLI" > $@ && cat $< >> $@
93
94 include ../../Makefile.genrules
This page took 0.032493 seconds and 5 git commands to generate.