Makefile 3.59 KB
Newer Older
Elemer Lelik's avatar
Elemer Lelik committed
1
##############################################################################
balaskoa's avatar
balaskoa committed
2
# Copyright (c) 2000-2020 Ericsson Telecom AB
Elemer Lelik's avatar
Elemer Lelik committed
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v2.0
Elemer Lelik's avatar
Elemer Lelik committed
5
# which accompanies this distribution, and is available at
6
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
Elemer Lelik's avatar
Elemer Lelik committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
# Contributors:
#   
#   Baji, Laszlo
#   Balasko, Jeno
#   Baranyi, Botond
#   Beres, Szabolcs
#   Csondes, Tibor
#   Delic, Adam
#   Forstner, Matyas
#   Kovacs, Ferenc
#   Ormandi, Matyas
#   Raduly, Csaba
#   Szabo, Janos Zoltan – initial implementation
#   Zalanyi, Balazs Andor
#
##############################################################################
Elemer Lelik's avatar
Elemer Lelik committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Makefile for the common directory of the TTCN-3 Test Executor

TOP := ..
include $(TOP)/Makefile.cfg

TARGETS :=

# The origin of GENERATED_SOURCES
ORIGINATORS := pattern_la.l  pattern_p.y  pattern_uni.y  config_preproc_la.l config_preproc_p.y

GENERATED_SOURCES := pattern_la.cc pattern_p.cc pattern_uni.cc config_preproc_la.cc config_preproc_p.tab.cc

# Sources in the CVS

38
STATIC_SOURCES := memory.c new.cc userinfo.c path.c config_preproc.cc Quadruple.cc \
39
		  Path2.cc ModuleVersion.cc JSON_Tokenizer.cc UnicharPattern.cc openssl_version.c
Elemer Lelik's avatar
Elemer Lelik committed
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

ifndef MINGW
STATIC_SOURCES += NetworkHandler.cc
endif

ifeq ($(USAGE_STATS), yes)
  STATIC_SOURCES += usage_stats.cc
endif

ifeq ($(LICENSING), yes)
  STATIC_SOURCES += license.c
  ifeq ($(PLATFORM), WIN32)
    STATIC_SOURCES += hostid.c
    TARGETS += hostid$(EXESUFFIX)
  endif
  ifeq ($(PLATFORM), INTERIX)
    STATIC_SOURCES += hostid.c
    TARGETS += hostid$(EXESUFFIX)
  endif
endif

SOURCES := $(STATIC_SOURCES) $(GENERATED_SOURCES)

GENERATED_HEADERS := pattern_p.hh pattern_uni.hh config_preproc_p.tab.hh

GENERATED_OTHERS := pattern_p.output pattern_uni.output lex.backup

OBJECTS := $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(SOURCES)))

DEPFILES := $(patsubst %.cc,%.d,$(patsubst %.c,%.d,$(SOURCES)))

SUBDIRS :=

CPPFLAGS += -D_REENTRANT

ifdef REGEX_DIR
  CPPFLAGS += -I$(REGEX_DIR)/include
endif

all run: $(OBJECTS) $(TARGETS)

install: $(OBJECTS) $(TARGETS)
ifdef MINGW
	@echo Skipped ${CURDIR} for MinGW
else
	mkdir -p $(INCDIR)
	cp version.h memory.h platform.h ttcn3float.hh pattern.hh CharCoding.hh JSON_Tokenizer.hh $(INCDIR)
87
88
89
ifeq ($(DEBUG), yes)
	cp dbgnew.hh $(INCDIR)
endif
Elemer Lelik's avatar
Elemer Lelik committed
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
ifneq ($(TARGETS), )
  ifeq ($(DEBUG), no)
	$(STRIP) $(TARGETS)
  endif
	mkdir -p $(BINDIR)
	cp $(TARGETS) $(BINDIR)
endif
endif

hostid$(EXESUFFIX): hostid.o license.o memory.o
	$(CC) $(LDFLAGS) -o $@ $^ $(LICENSE_LIBS) $(MINGW_LIBS)

pattern_la.cc: pattern_la.l
	$(FLEX) $(FLEXFLAGS) -o$@ $<

pattern_p.cc pattern_p.hh: pattern_p.y
	$(BISON) $(BISONFLAGS) $<

pattern_uni.cc pattern_uni.hh: pattern_uni.y
	$(BISON) $(BISONFLAGS) $<

config_preproc_la.cc: config_preproc_la.l
	$(FLEX) $(FLEXFLAGS) -o$@ $<

config_preproc_p.tab.cc config_preproc_p.tab.hh: config_preproc_p.y
	$(BISON) $(BISONFLAGS) -o config_preproc_p.tab.cc -p config_process_ $<

# Target-specific variable alteration
# Target-specific += causes make 3.79.1 to crash, hence this old style
ifdef OPENSSL_DIR
ifneq ($(OPENSSL_DIR), default)
license.o license.d: CPPFLAGS := $(CPPFLAGS) -I$(OPENSSL_DIR)/include
122
openssl_version.o openssl_version.d: CPPFLAGS := $(CPPFLAGS) -I$(OPENSSL_DIR)/include
Elemer Lelik's avatar
Elemer Lelik committed
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
endif
endif

include ../Makefile.genrules


#vpath pattern_la.l        $(ABS_SRC)
#vpath pattern_p.y         $(ABS_SRC)
#vpath pattern_uni_lex.l   $(ABS_SRC)
#vpath pattern_uni.y       $(ABS_SRC)
#vpath config_preproc_la.l $(ABS_SRC)
#vpath config_preproc_p.y  $(ABS_SRC)

# no vpath for GENERATED_SOURCES !