1 ###############################################################################
2 # Copyright (c) 2000-2014 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 ###############################################################################
11 include $(TOPDIR
)/Makefile.regression
14 # Makefile for isbound() test
16 # Files named *OK.ttcn are expected to pass syntax and semantic check
17 # Files named *SY.ttcn are expected to fail syntax check
18 # Files named *SE.ttcn are expected to pass syntax check,
19 # but fail semantic check
21 # Adding new files conforming to this naming convention
22 # automatically includes them in the test.
32 GOOD_TTCN
:= $(wildcard *OK.ttcn
)
33 SYNT_TTCN
:= $(wildcard *SY.ttcn
)
34 SEMA_TTCN
:= $(wildcard *SE.ttcn
)
36 GOOD_CC
:= $(GOOD_TTCN
:.ttcn
=.
cc)
37 #SEMA_CC := $(SEMA_TTCN:.ttcn=.cc)
38 #SYNT_CC := $(SYNT_TTCN:.ttcn=.cc)
40 GOOD_HH
:= $(GOOD_TTCN
:.ttcn
=.hh
)
41 #SEMA_HH := $(SEMA_TTCN:.ttcn=.hh)
42 #SYNT_HH := $(SYNT_TTCN:.ttcn=.hh)
45 GOOD_CC
:= $(foreach file
, $(GOOD_CC
:.
cc=), $(addprefix $(file
), .
cc _seq.
cc _set.
cc _seqof.
cc _setof.
cc _union.
cc))
49 # The flags for the TTCN3 compiler
50 # Don't pass -i. Error lines with line *and* column
51 # are not recognised by Eclipse (which is what we want).
54 run
: the good the bad and the ugly
55 # for ttcn in $(GOOD_TTCN); do if $(TTCN3_COMPILER) $F $$ttcn ; then true; else exit 1; fi; done
60 echo
$(TTCN3_COMPILER
) $F -s
$$f;
61 if
$(TTCN3_COMPILER
) $F -s
$$f; \
65 echo
$$f:1: error
: should have passed syntax and sema
; exit
1; \
72 echo
$(TTCN3_COMPILER
) $F -p
$$f;
73 if
$(TTCN3_COMPILER
) $F -p
$$f; \
75 echo
$$f:1: error
: should have failed syntax
; exit
1; \
84 echo
$(TTCN3_COMPILER
) $F -p
$$f;
85 if
$(TTCN3_COMPILER
) $F -p
$$f; \
89 echo
$$f:1: error
: should have passed syntax
; exit
1; \
91 echo
$(TTCN3_COMPILER
) $F -s
$$f;
92 if
$(TTCN3_COMPILER
) $F -s
$$f; \
94 echo
$$f:1: error
: should have failed semantic
check; exit
1; \
103 @echo
+++++ The good
+++++
107 @echo
----- The bad
-----
111 @echo \
##### The ugly \#####
116 TARGET
:= goodprog
$(EXESUFFIX
)
118 GOOD_OBJ
:= $(GOOD_CC
:.
cc=.o
)
120 # Execution mode: (either ttcn3 or ttcn3-parallel)
121 TTCN3_LIB
= ttcn3
$(RT2_SUFFIX
)$(DYNAMIC_SUFFIX
)
123 $(TARGET
) : $(GOOD_CC
)
124 $(CXX
) $(CPPFLAGS
) $(CXXFLAGS
) $(LDFLAGS
) -o
$@
$^ \
125 -L
$(TTCN3_DIR
)/lib
-l
$(TTCN3_LIB
) \
126 -L
$(OPENSSL_DIR
)/lib
-lcrypto
$($(PLATFORM
)_LIBS
)
133 $(TTCN3_COMPILER
) $F $<
136 rm -f
$(GOOD_OBJ
) $(TARGET
) *.stackdump
*.log \
137 $(GOOD_CC
) $(SYNT_CC
) $(SEMA_CC
) \
138 $(GOOD_HH
) $(SYNT_HH
) $(SEMA_HH
)
141 .PHONY
: good bad ugly
all clean run the and