| 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 |
# |
| 10 |
# Balasko, Jeno |
| 11 |
# Godar, Marton |
| 12 |
# Pilisi, Gergely |
| 13 |
# Raduly, Csaba |
| 14 |
# Szabo, Bence Janos |
| 15 |
# |
| 16 |
############################################################################## |
| 17 |
TOP := .. |
| 18 |
include $(TOP)/Makefile.cfg |
| 19 |
|
| 20 |
SOURCES := converter.cc \ |
| 21 |
XMLParser.cc TTCN3Module.cc TTCN3ModuleInventory.cc \ |
| 22 |
RootType.cc SimpleType.cc AttributeType.cc ComplexType.cc \ |
| 23 |
Annotation.cc ImportStatement.cc \ |
| 24 |
PredefinedModules.cc GeneralFunctions.cc \ |
| 25 |
Mstring.cc Constant.cc |
| 26 |
|
| 27 |
# No generated sources |
| 28 |
STATIC_SOURCES := $(SOURCES) |
| 29 |
|
| 30 |
HEADERS := $(SOURCES:.cc=.hh) |
| 31 |
|
| 32 |
|
| 33 |
OBJECTS := $(SOURCES:.cc=.o) \ |
| 34 |
$(TOP)/common/new.o \ |
| 35 |
$(TOP)/common/memory.o |
| 36 |
|
| 37 |
ifeq ($(LICENSING), yes) |
| 38 |
OBJECTS += $(TOP)/common/license.o |
| 39 |
endif |
| 40 |
|
| 41 |
|
| 42 |
TARGETS := xsd2ttcn$(EXESUFFIX) |
| 43 |
|
| 44 |
DEPFILES := $(patsubst %.cc,%.d,$(patsubst %.c,%.d,$(SOURCES))) |
| 45 |
|
| 46 |
ifdef XMLDIR |
| 47 |
ifeq ($(XMLDIR), default) |
| 48 |
# libxml2 headers supplied by the system are usually in /usr/include/libxml2, |
| 49 |
# so a -I is required. Rename XMLDIR for use in the common case. |
| 50 |
XMLDIR := /usr |
| 51 |
# do not add -L/usr/lib to LDFLAGS, it's redundant |
| 52 |
else |
| 53 |
LDFLAGS += -L$(XMLDIR)/lib |
| 54 |
endif |
| 55 |
# Always add to CPPFLAGS, even if "default" |
| 56 |
CPPFLAGS += -I$(XMLDIR)/include/libxml2 |
| 57 |
endif |
| 58 |
|
| 59 |
ifdef OPENSSL_DIR |
| 60 |
ifneq ($(OPENSSL_DIR), default) |
| 61 |
CPPFLAGS += -I$(OPENSSL_DIR)/include |
| 62 |
LDFLAGS += -L$(OPENSSL_DIR)/lib |
| 63 |
endif |
| 64 |
endif |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
ifeq ($(PLATFORM),INTERIX) |
| 69 |
# to get the "right" iconv, used by libxml2 |
| 70 |
CPPFLAGS += -I/usr/local/include |
| 71 |
endif |
| 72 |
|
| 73 |
# libraries for the linker |
| 74 |
LDLIBS += -lxml2 -lcrypto |
| 75 |
|
| 76 |
ifdef MINGW |
| 77 |
LDLIBS += -lregex |
| 78 |
endif |
| 79 |
|
| 80 |
all run: $(TARGETS) $(PROGRAMS) |
| 81 |
|
| 82 |
xsd2ttcn$(EXESUFFIX): $(OBJECTS) |
| 83 |
$(CXX) $(LDFLAGS) -o $@ $(OBJECTS) $(LDLIBS) $(MINGW_LIBS) |
| 84 |
|
| 85 |
install: $(TARGETS) |
| 86 |
ifdef MINGW |
| 87 |
mkdir -p $(TTCN3_DIR)/programs |
| 88 |
cp $(TARGETS) $(TTCN3_DIR)/programs |
| 89 |
else |
| 90 |
mkdir -p $(BINDIR) |
| 91 |
cp -f $(TARGETS) $(BINDIR) |
| 92 |
endif |
| 93 |
|
| 94 |
include $(TOP)/Makefile.genrules |