| 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 | # Makefile for the TTCN-3 part of the compiler |
| 9 | |
| 10 | TOP := ../.. |
| 11 | include $(TOP)/Makefile.cfg |
| 12 | |
| 13 | ifeq ($(findstring g++, $(CXX)), g++) |
| 14 | CXXFLAGS += -fno-exceptions |
| 15 | endif |
| 16 | |
| 17 | ifdef OPENSSL_DIR |
| 18 | ifneq ($(OPENSSL_DIR), default) |
| 19 | CPPFLAGS += -I$(OPENSSL_DIR)/include |
| 20 | endif |
| 21 | endif |
| 22 | |
| 23 | CPPFLAGS += -I$(SRC_TOP) |
| 24 | |
| 25 | TARGETS := libttcn3_compiler.a |
| 26 | |
| 27 | ORIGINATORS := charstring_la.l coding_attrib_la.l coding_attrib_p.y \ |
| 28 | compiler.l compiler.y comptype_attrib_la.l pstring_la.l \ |
| 29 | rawAST.l rawAST.y ttcn3_preparser.l |
| 30 | |
| 31 | GENERATED_SOURCES := lex.ttcn3.cc compiler.tab.cc lex.rawAST.cc rawAST.tab.cc \ |
| 32 | charstring_la.cc pstring_la.cc comptype_attrib_la.cc coding_attrib_la.cc \ |
| 33 | coding_attrib_p.cc ttcn3_preparser.lex.c |
| 34 | |
| 35 | GENERATED_HEADERS := compiler.tab.hh rawAST.tab.hh coding_attrib_p.hh |
| 36 | |
| 37 | GENERATED_OTHERS := compiler.output rawAST.output coding_attrib_p.output lex.backup |
| 38 | |
| 39 | STATIC_SOURCES := ArrayDimensions.cc AST_ttcn3.cc Attributes.cc ILT.cc PatternString.cc \ |
| 40 | RawAST.cc Statement.cc TtcnTemplate.cc Templatestuff.cc TextAST.cc Ttcnstuff.cc \ |
| 41 | compiler.c port.c signature.c BerAST.cc JsonAST.cc Ttcn2Json.cc |
| 42 | |
| 43 | SOURCES := $(STATIC_SOURCES) $(GENERATED_SOURCES) |
| 44 | |
| 45 | COMMON_OBJECTS := $(addprefix ../../common/, JSON_Tokenizer.o) |
| 46 | |
| 47 | OBJECTS := $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(SOURCES))) $(COMMON_OBJECTS) |
| 48 | |
| 49 | DEPFILES := $(patsubst %.cc,%.d,$(patsubst %.c,%.d,$(SOURCES))) |
| 50 | |
| 51 | SUBDIRS := |
| 52 | |
| 53 | all run: $(TARGETS) |
| 54 | |
| 55 | libttcn3_compiler.a: $(OBJECTS) |
| 56 | $(AR) -r $@ $? |
| 57 | |
| 58 | %_la.cc: %_la.l |
| 59 | $(FLEX) $(FLEXFLAGS) -o$@ $< |
| 60 | |
| 61 | %_p.cc %_p.hh: %_p.y |
| 62 | $(BISON) $(BISONFLAGS) $< |
| 63 | |
| 64 | compiler.tab.cc compiler.tab.hh: compiler.y |
| 65 | $(BISON) $(BISONFLAGS) -p ttcn3_ -o compiler.tab.cc $< |
| 66 | |
| 67 | rawAST.tab.cc rawAST.tab.hh: rawAST.y |
| 68 | $(BISON) $(BISONFLAGS) -p rawAST_ -o rawAST.tab.cc $< |
| 69 | |
| 70 | lex.ttcn3.cc: compiler.l |
| 71 | $(FLEX) $(FLEXFLAGS) -Pttcn3_ -o$@ $< |
| 72 | |
| 73 | lex.rawAST.cc: rawAST.l |
| 74 | $(FLEX) $(FLEXFLAGS) -PrawAST_ -o$@ $< |
| 75 | |
| 76 | ttcn3_preparser.lex.c: ttcn3_preparser.l |
| 77 | $(FLEX) $(FLEXFLAGS) -Pttcn3_preparser_ -o$@ $< |
| 78 | |
| 79 | include ../../Makefile.genrules |
| 80 | |
| 81 | # pre-seed dependencies |
| 82 | lex.ttcn3.d: compiler.tab.hh |