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