| 1 |
############################################################################## |
| 2 |
# Copyright (c) 2000-2021 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 v2.0 |
| 5 |
# which accompanies this distribution, and is available at |
| 6 |
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html |
| 7 |
# |
| 8 |
# Contributors: |
| 9 |
# Baranyi, Botond |
| 10 |
# |
| 11 |
############################################################################## |
| 12 |
TOPDIR := ../../../ |
| 13 |
include $(TOPDIR)/Makefile.regression |
| 14 |
|
| 15 |
MAKE_PROG := $(MAKE) |
| 16 |
|
| 17 |
TTCN_FILE := expressions.ttcn |
| 18 |
CFG := expressions.cfg |
| 19 |
|
| 20 |
FILES := $(TTCN_FILE) $(CFG) |
| 21 |
RUNNABLE := $(TTCN_FILE:.ttcn=) |
| 22 |
|
| 23 |
DIR_SINGLE := dir_single_mode |
| 24 |
DIR_PARALLEL := dir_parallel_mode |
| 25 |
GENERATED_DIRS := $(DIR_SINGLE) $(DIR_PARALLEL) |
| 26 |
|
| 27 |
COVERAGE_FLAG := |
| 28 |
ifeq ($(COVERAGE), yes) |
| 29 |
COVERAGE_FLAG += -C |
| 30 |
endif |
| 31 |
|
| 32 |
ifdef DYN |
| 33 |
ifeq ($(PLATFORM), WIN32) |
| 34 |
export PATH:=$(PATH):$(TTCN3_DIR)/lib:$(ABS_SRC)/$(DIR_SINGLE):$(ABS_SRC)/$(DIR_PARALLEL): |
| 35 |
else |
| 36 |
export LD_LIBRARY_PATH:=$(LD_LIBRARY_PATH):$(ABS_SRC)/$(DIR_SINGLE):$(ABS_SRC)/$(DIR_PARALLEL): |
| 37 |
endif |
| 38 |
endif |
| 39 |
|
| 40 |
# List of fake targets: |
| 41 |
.PHONY: all clean run run_single run_parallel runall |
| 42 |
|
| 43 |
all: $(GENERATED_DIRS) |
| 44 |
|
| 45 |
$(DIR_SINGLE): |
| 46 |
mkdir $@ |
| 47 |
cd $@ && for file in $(FILES); do ln -s ../$$file || exit; done |
| 48 |
cd $@ && $(TTCN3_DIR)/bin/ttcn3_makefilegen $(COVERAGE_FLAG) $(SPLIT_FLAG) $(RT2_FLAG) -s ./* && $(MAKE_PROG) 'CXXFLAGS=$(CXXFLAGS)' 'LDFLAGS=$(LDFLAGS)' |
| 49 |
|
| 50 |
$(DIR_PARALLEL): |
| 51 |
mkdir $@ |
| 52 |
cd $@ && for file in $(FILES); do ln -s ../$$file || exit; done |
| 53 |
cd $@ && $(TTCN3_DIR)/bin/ttcn3_makefilegen $(COVERAGE_FLAG) $(SPLIT_FLAG) $(RT2_FLAG) ./* && $(MAKE_PROG) 'CXXFLAGS=$(CXXFLAGS)' 'LDFLAGS=$(LDFLAGS)' |
| 54 |
|
| 55 |
run: $(GENERATED_DIRS) |
| 56 |
cd $(DIR_SINGLE) && ./$(RUNNABLE) $(CFG) |
| 57 |
cd $(DIR_PARALLEL) && $(TTCN3_DIR)/bin/ttcn3_start $(RUNNABLE) $(CFG) |
| 58 |
|
| 59 |
# To run all tests, possibly in parallel |
| 60 |
run_single: $(DIR_SINGLE) |
| 61 |
cd $(DIR_SINGLE) && ./$(RUNNABLE) $(CFG) |
| 62 |
run_parallel: $(DIR_PARALLEL) |
| 63 |
cd $(DIR_PARALLEL) && $(TTCN3_DIR)/bin/ttcn3_start $(RUNNABLE) $(CFG) |
| 64 |
runall: run_single run_parallel |
| 65 |
|
| 66 |
clean distclean: |
| 67 |
rm -rf $(GENERATED_DIRS) |
| 68 |
|
| 69 |
|