Titan Core Initial Contribution
[deliverable/titan.core.git] / regression_test / compileonly / isbound / Makefile
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 ###############################################################################
8 #!/usr/bin/make -f
9
10 TOPDIR := ../..
11 include $(TOPDIR)/Makefile.regression
12
13 #
14 # Makefile for isbound() test
15 #
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
20 #
21 # Adding new files conforming to this naming convention
22 # automatically includes them in the test.
23 #
24
25
26 # for debugging:
27 #SHELL := /bin/sh -x
28
29
30
31
32 GOOD_TTCN := $(wildcard *OK.ttcn)
33 SYNT_TTCN := $(wildcard *SY.ttcn)
34 SEMA_TTCN := $(wildcard *SE.ttcn)
35
36 GOOD_CC := $(GOOD_TTCN:.ttcn=.cc)
37 #SEMA_CC := $(SEMA_TTCN:.ttcn=.cc)
38 #SYNT_CC := $(SYNT_TTCN:.ttcn=.cc)
39
40 GOOD_HH := $(GOOD_TTCN:.ttcn=.hh)
41 #SEMA_HH := $(SEMA_TTCN:.ttcn=.hh)
42 #SYNT_HH := $(SYNT_TTCN:.ttcn=.hh)
43
44 ifdef CODE_SPLIT
45 GOOD_CC := $(foreach file, $(GOOD_CC:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc))
46 endif
47
48
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).
52 #F := -L
53
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
56
57
58 define comp_ok
59 @for f in $^; do \
60 echo $(TTCN3_COMPILER) $F -s $$f;
61 if $(TTCN3_COMPILER) $F -s $$f; \
62 then \
63 true; \
64 else \
65 echo $$f:1: error: should have passed syntax and sema; exit 1; \
66 fi; \
67 done
68 endef
69
70 define syntax_fail
71 @for f in $^; do \
72 echo $(TTCN3_COMPILER) $F -p $$f;
73 if $(TTCN3_COMPILER) $F -p $$f; \
74 then \
75 echo $$f:1: error: should have failed syntax; exit 1; \
76 else \
77 true; \
78 fi; \
79 done
80 endef
81
82 define sema_fail
83 @for f in $^; do \
84 echo $(TTCN3_COMPILER) $F -p $$f;
85 if $(TTCN3_COMPILER) $F -p $$f; \
86 then \
87 true; \
88 else \
89 echo $$f:1: error: should have passed syntax; exit 1; \
90 fi; \
91 echo $(TTCN3_COMPILER) $F -s $$f;
92 if $(TTCN3_COMPILER) $F -s $$f; \
93 then \
94 echo $$f:1: error: should have failed semantic check; exit 1; \
95 else \
96 true; \
97 fi; \
98 done
99 endef
100
101
102 good: $(GOOD_TTCN)
103 @echo +++++ The good +++++
104 $(comp_ok)
105
106 bad: $(SYNT_TTCN)
107 @echo ----- The bad -----
108 @$(syntax_fail)
109
110 ugly: $(SEMA_TTCN)
111 @echo \##### The ugly \#####
112 @$(sema_fail)
113
114 ####################
115
116 TARGET := goodprog$(EXESUFFIX)
117
118 GOOD_OBJ := $(GOOD_CC:.cc=.o)
119
120 # Execution mode: (either ttcn3 or ttcn3-parallel)
121 TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX)
122
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)
127
128 all: $(TARGET)
129
130 ####################
131
132 %.cc : %.ttcn
133 $(TTCN3_COMPILER) $F $<
134
135 clean distclean:
136 rm -f $(GOOD_OBJ) $(TARGET) *.stackdump *.log \
137 $(GOOD_CC) $(SYNT_CC) $(SEMA_CC) \
138 $(GOOD_HH) $(SYNT_HH) $(SEMA_HH)
139
140
141 .PHONY: good bad ugly all clean run the and
142
This page took 0.032665 seconds and 5 git commands to generate.