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 | # Balasko, Jeno | |
10 | # Beres, Szabolcs | |
11 | # Raduly, Csaba | |
12 | # Szabados, Kristof | |
14e21cff | 13 | # Szabo, Bence Janos |
d44e3c4f | 14 | # |
15 | ############################################################################## | |
970ed795 EL |
16 | TOPDIR := ../../../ |
17 | include $(TOPDIR)/Makefile.regression | |
18 | ||
19 | MAKE_PROG := $(MAKE) | |
20 | ||
21 | TTCN_FILE := structured.ttcn | |
22 | CFG := structured.cfg | |
23 | ||
24 | FILES := $(TTCN_FILE) $(CFG) | |
25 | RUNNABLE := $(TTCN_FILE:.ttcn=) | |
26 | ||
27 | DIR_SINGLE := dir_single_mode | |
28 | DIR_PARALLEL := dir_parallel_mode | |
29 | GENERATED_DIRS := $(DIR_SINGLE) $(DIR_PARALLEL) | |
30 | ||
3abe9331 | 31 | COVERAGE_FLAG := |
32 | ifeq ($(COVERAGE), yes) | |
33 | COVERAGE_FLAG += -C | |
34 | endif | |
35 | ||
97421534 | 36 | ifdef DYN |
37 | ifeq ($(PLATFORM), WIN32) | |
1076e2d0 | 38 | export PATH+=:$(TTCN3_DIR)/lib:$(ABS_SRC)/$(DIR_SINGLE):$(ABS_SRC)/$(DIR_PARALLEL): |
97421534 | 39 | else |
1076e2d0 | 40 | export LD_LIBRARY_PATH+=:$(ABS_SRC)/$(DIR_SINGLE):$(ABS_SRC)/$(DIR_PARALLEL): |
97421534 | 41 | endif |
42 | endif | |
43 | ||
970ed795 EL |
44 | # List of fake targets: |
45 | .PHONY: all clean run run_single run_parallel runall | |
46 | ||
47 | all: $(GENERATED_DIRS) | |
48 | ||
49 | $(DIR_SINGLE): | |
50 | mkdir $@ | |
51 | cd $@ && for file in $(FILES); do ln -s ../$$file || exit; done | |
14e21cff | 52 | cd $@ && $(TTCN3_DIR)/bin/ttcn3_makefilegen $(COVERAGE_FLAG) $(SPLIT_FLAG) -s ./* && $(MAKE_PROG) 'CXXFLAGS=$(CXXFLAGS)' 'LDFLAGS=$(LDFLAGS)' |
970ed795 EL |
53 | |
54 | $(DIR_PARALLEL): | |
55 | mkdir $@ | |
56 | cd $@ && for file in $(FILES); do ln -s ../$$file || exit; done | |
14e21cff | 57 | cd $@ && $(TTCN3_DIR)/bin/ttcn3_makefilegen $(COVERAGE_FLAG) $(SPLIT_FLAG) ./* && $(MAKE_PROG) 'CXXFLAGS=$(CXXFLAGS)' 'LDFLAGS=$(LDFLAGS)' |
970ed795 EL |
58 | |
59 | run: $(GENERATED_DIRS) | |
60 | cd $(DIR_SINGLE) && ./$(RUNNABLE) $(CFG) | |
61 | cd $(DIR_PARALLEL) && $(TTCN3_DIR)/bin/ttcn3_start $(RUNNABLE) $(CFG) | |
62 | ||
63 | # To run all tests, possibly in parallel | |
64 | run_single: $(DIR_SINGLE) | |
65 | cd $(DIR_SINGLE) && ./$(RUNNABLE) $(CFG) | |
66 | run_parallel: $(DIR_PARALLEL) | |
67 | cd $(DIR_PARALLEL) && $(TTCN3_DIR)/bin/ttcn3_start $(RUNNABLE) $(CFG) | |
68 | runall: run_single run_parallel | |
69 | ||
70 | clean distclean: | |
71 | rm -rf $(GENERATED_DIRS) | |
72 | ||
73 |