Commit | Line | Data |
---|---|---|
d44e3c4f | 1 | ############################################################################## |
2 | # Copyright (c) 2000-2016 Ericsson Telecom AB | |
970ed795 EL |
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 | |
d44e3c4f | 7 | # |
8 | # Contributors: | |
9 | # Baji, Laszlo | |
10 | # Balasko, Jeno | |
11 | # Raduly, Csaba | |
14e21cff | 12 | # Szabo, Bence Janos |
d44e3c4f | 13 | # |
14 | ############################################################################## | |
970ed795 EL |
15 | TOPDIR := .. |
16 | include ../Makefile.regression | |
17 | ||
18 | # WARNING! This Makefile can be used with GNU make only. | |
19 | # Other versions of make may report syntax errors in it. | |
20 | ||
21 | # | |
22 | # Do NOT touch this line... | |
23 | # | |
24 | .PHONY: all archive check clean dep objects | |
25 | ||
26 | ||
27 | # Flags for the C++ compiler: | |
28 | CXXFLAGS += -g | |
29 | ||
30 | # Flags for the linker: | |
31 | LDFLAGS += -g | |
32 | ||
33 | # Flags for the TTCN-3 and ASN.1 compiler: | |
34 | #COMPILER_FLAGS += -Lg | |
35 | ||
36 | # Execution mode: (either ttcn3 or ttcn3-parallel) | |
37 | TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX) | |
38 | ||
39 | # | |
40 | # You may change these variables. Add your files if necessary... | |
41 | # | |
42 | ||
43 | # TTCN-3 modules of this project: | |
44 | TTCN3_MODULES = converter.ttcn convertest.ttcn | |
45 | ||
46 | # ASN.1 modules of this project: | |
47 | ASN1_MODULES = | |
48 | ||
49 | # C++ source & header files generated from the TTCN-3 & ASN.1 modules of | |
50 | # this project: | |
51 | GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc) | |
52 | GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh) | |
53 | ifdef CODE_SPLIT | |
54 | GENERATED_SOURCES := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc)) | |
14e21cff | 55 | else ifdef SPLIT_TO_SLICES |
56 | POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_)) | |
57 | POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc)) | |
58 | GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES))) | |
59 | GENERATED_SOURCES += $(GENERATED_SOURCES2) | |
970ed795 EL |
60 | endif |
61 | ||
62 | # C/C++ Source & header files of Test Ports, external functions and | |
63 | # other modules: | |
64 | USER_SOURCES = iconver.cc | |
65 | USER_HEADERS = $(USER_SOURCES:.cc=.hh) | |
66 | ||
67 | # Object files of this project that are needed for the executable test suite: | |
68 | OBJECTS = $(GENERATED_SOURCES:.cc=.o) $(USER_SOURCES:.cc=.o) | |
69 | ||
70 | # Other files of the project (Makefile, configuration files, etc.) | |
71 | # that will be added to the archived source files: | |
72 | OTHER_FILES = Makefile | |
73 | ||
74 | # The name of the executable test suite: | |
75 | TARGET = convertest$(EXESUFFIX) | |
76 | ||
77 | # | |
78 | # Do not modify these unless you know what you are doing... | |
79 | # Platform specific additional libraries: | |
80 | # -lxml2 (and -lxnet on SOLARIS*) already there | |
81 | SOLARIS_LIBS += -lsocket -lnsl -lcrypto | |
82 | SOLARIS8_LIBS += -lsocket -lnsl -lcrypto | |
83 | LINUX_LIBS += -lcrypto | |
84 | FREEBSD_LIBS += -lcrypto -liconv | |
85 | WIN32_LIBS += -lcrypto -liconv | |
86 | INTERIX_LIBS += -L/usr/local/ssl/lib -lcrypto | |
87 | ||
88 | # | |
89 | # Rules for building the executable... | |
90 | # | |
91 | ||
92 | all: $(TARGET) ; | |
93 | ||
94 | objects: $(OBJECTS) ; | |
95 | ||
96 | # Don't bother with .o files | |
97 | $(TARGET): $(GENERATED_SOURCES) $(USER_SOURCES) | |
98 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ \ | |
99 | -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \ | |
100 | -L$(XMLDIR)/lib -L$(OPENSSL_DIR)/lib $($(PLATFORM)_LIBS) | |
101 | ||
102 | $(GENERATED_SOURCES) $(GENERATED_HEADERS): compile | |
103 | @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi | |
104 | ||
105 | compile: $(TTCN3_MODULES) $(ASN1_MODULES) | |
106 | $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $? | |
107 | touch $@ | |
108 | ||
109 | clean distclean: | |
110 | -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \ | |
111 | $(GENERATED_SOURCES) compile \ | |
112 | tags *.log | |
113 | ||
114 | ||
115 | # | |
116 | # Add your rules here if necessary... | |
117 | # | |
118 | ||
119 | RUN := $(shell which colortitan 2>/dev/null) | |
120 | ifeq ($(firstword $(RUN)),no) | |
121 | # stupid /bin/which on Solaris writes errors to stdout instead of stderr | |
122 | RUN := | |
123 | endif | |
124 | ||
125 | run: $(TARGET) config.cfg | |
126 | $(RUN) ./$^ | |
127 | ||
128 | vpath iconver.cc $(ABS_SRC) | |
129 | vpath %.ttcn $(ABS_SRC) |