Statistics
| Branch: | Revision:

root / src / common / Makefile @ e1750c09

History | View | Annotate | Download (5.63 KB)

1
#
2
# Definitions to be customized by 'configure'
3
#
4

    
5
include ../../Makefile.inc
6

    
7
# Make sure that output locations are set
8
ifeq ("$(strip $(OMNETPP_BIN_DIR))","")
9
$(error OMNETPP_BIN_DIR must be correctly set)
10
endif
11
ifeq ("$(strip $(OMNETPP_OUT_DIR))","")
12
$(error OMNETPP_OUT_DIR must be correctly set)
13
endif
14
ifeq ("$(strip $(OMNETPP_LIB_DIR))","")
15
$(error OMNETPP_LIB_DIR must be correctly set)
16
endif
17

    
18
#
19
# Local definitions
20
#
21
LIBNAME=liboppcommon$D
22
O=$(OMNETPP_OUT_DIR)/$(TOOLCHAIN_NAME)-$(MODE)/src/common
23
L=$(OMNETPP_LIB_DIR)/$(TOOLCHAIN_NAME)
24

    
25
COPTS=$(CFLAGS) -I. -I$(OMNETPP_INCL_DIR)/platdep
26
IMPLIBS=
27

    
28
ifeq ("$(BUILDING_UILIBS)","yes")
29
COPTS+= -DTHREADED $(PTHREAD_CFLAGS)
30
IMPLIBS+= $(PTHREAD_LIBS)
31
endif
32

    
33
OBJS= $O/lcgrandom.o $O/filereader.o $O/linetokenizer.o \
34
      $O/stringpool.o $O/stringtokenizer.o $O/fnamelisttokenizer.o \
35
      $O/expression.o $O/lex.expressionyy.o $O/expression.tab.o \
36
      $O/matchexpression.o $O/matchexpressionlexer.o $O/matchexpression.tab.o \
37
      $O/patternmatcher.o $O/unitconversion.o $O/displaystring.o $O/fileglobber.o \
38
      $O/fileutil.o $O/stringutil.o $O/commonutil.o $O/exception.o $O/bigdecimal.o \
39
      $O/enumstr.o
40

    
41
ifeq ("$(BUILDING_UILIBS)","yes")
42
OBJS+= $O/rwlock.o
43
endif
44

    
45
GENERATED_SOURCES= expression.tab.hh expression.tab.cc lex.expressionyy.cc \
46
                   matchexpression.tab.hh matchexpression.tab.cc
47

    
48
#
49
# Automatic rules
50
#
51
.SUFFIXES : .cc
52

    
53
$O/%.o: %.cc
54
	@mkdir -p $O
55
	$(CXX) -c $(COPTS) -o $@ $<
56

    
57
#
58
# Targets
59
#
60
all : $L/$(LIBNAME)$(LIB_SUFFIX)
61
	cd $(OMNETPP_LIB_DIR) && rm -f $(LIBNAME).* && $(LN) $(TOOLCHAIN_NAME)/$(LIBNAME).* .
62

    
63
$L/$(LIBNAME)$(A_LIB_SUFFIX) : $(OBJS)
64
	mkdir -p $L
65
	$(AR) $O/$(LIBNAME)$(A_LIB_SUFFIX) $(OBJS)
66
	$(RANLIB) $O/$(LIBNAME)$(A_LIB_SUFFIX)
67
	cd $O && $(OMNETPP_ROOT)/src/utils/install-lib $(LIBNAME)$(A_LIB_SUFFIX) $L
68

    
69
$L/$(LIBNAME)$(SO_LIB_SUFFIX) : $(OBJS)
70
	mkdir -p $L
71
	$(SHLIB_LD) $(LDFLAGS) -o $O/$(LIBNAME)$(SO_LIB_SUFFIX) $(OBJS) $(IMPLIBS)
72
	$(SHLIB_POSTPROCESS) $O/$(LIBNAME)$(SO_LIB_SUFFIX)
73
	cd $O && $(OMNETPP_ROOT)/src/utils/install-lib $(LIBNAME)$(SO_LIB_SUFFIX) $L
74
	rm -f $(OMNETPP_LIB_DIR)/$(LIBNAME)$(SO_LIB_SUFFIX) && $(LN) $L/$(LIBNAME)$(SO_LIB_SUFFIX) $(OMNETPP_LIB_DIR)
75
	$(SHLIB_POSTPROCESS) $(OMNETPP_LIB_DIR)/$(LIBNAME)$(SO_LIB_SUFFIX)
76

    
77
$L/$(LIBNAME)$(DLL_LIB_SUFFIX) : $(OBJS)
78
	mkdir -p $L
79
	$(SHLIB_LD) $(LDFLAGS) -o $O/$(LIBNAME)$(DLL_LIB_SUFFIX) $(OBJS) $(IMPLIBS) -Wl,--out-implib,$O/$(LIBNAME)$(A_LIB_SUFFIX)
80
	cd $O && $(OMNETPP_ROOT)/src/utils/install-lib $(LIBNAME)$(A_LIB_SUFFIX) $L
81
	cp $O/$(LIBNAME)$(DLL_LIB_SUFFIX) $(OMNETPP_BIN_DIR)
82

    
83
expression.tab.hh expression.tab.cc : expression.y
84
	$(YACC) -o expression.tab.cc -p expressionyy -d expression.y
85

    
86
lex.expressionyy.cc: expression.lex
87
	$(LEX) -olex.expressionyy.cc -Pexpressionyy expression.lex
88

    
89
matchexpression.tab.hh matchexpression.tab.cc : matchexpression.y
90
	$(YACC) -o matchexpression.tab.cc --no-lines -p matchexpressionyy -d matchexpression.y
91

    
92
depend: $(GENERATED_SOURCES)
93
	$(MAKEDEPEND) -I. -P\$$O/ -- *.cc
94

    
95
clean:
96
	rm -f $(GENERATED_SOURCES)
97
	rm -rf $O
98
	rm -f $L/$(LIBNAME).* $(OMNETPP_LIB_DIR)/$(LIBNAME).*
99

    
100
# DO NOT DELETE THIS LINE -- make depend depends on it.
101
$O/bigdecimal.o: bigdecimal.cc \
102
  bigdecimal.h \
103
  commonutil.h \
104
  commondefs.h \
105
  opp_ctype.h \
106
  exception.h
107
$O/commonutil.o: commonutil.cc \
108
  commonutil.h \
109
  commondefs.h \
110
  exception.h
111
$O/displaystring.o: displaystring.cc \
112
  commonutil.h \
113
  commondefs.h \
114
  stringutil.h \
115
  displaystring.h \
116
  opp_ctype.h \
117
  exception.h
118
$O/enumstr.o: enumstr.cc \
119
  commondefs.h \
120
  enumstr.h
121
$O/exception.o: exception.cc \
122
  commonutil.h \
123
  commondefs.h \
124
  exception.h
125
$O/expression.o: expression.cc \
126
  commonutil.h \
127
  commondefs.h \
128
  stringutil.h \
129
  expressionyydefs.h \
130
  exception.h \
131
  expression.h
132
$O/expression.tab.o: expression.tab.cc \
133
  commonutil.h \
134
  commondefs.h \
135
  unitconversion.h \
136
  stringutil.h \
137
  expressionyydefs.h \
138
  exception.h \
139
  expression.h
140
$O/fileglobber.o: fileglobber.cc \
141
  commondefs.h \
142
  fileglobber.h
143
$O/filereader.o: filereader.cc \
144
  filereader.h \
145
  commonutil.h \
146
  commondefs.h \
147
  exception.h
148
$O/fileutil.o: fileutil.cc \
149
  commondefs.h \
150
  stringtokenizer.h \
151
  fileutil.h \
152
  opp_ctype.h \
153
  exception.h
154
$O/fnamelisttokenizer.o: fnamelisttokenizer.cc \
155
  fnamelisttokenizer.h \
156
  commonutil.h \
157
  commondefs.h \
158
  exception.h
159
$O/lcgrandom.o: lcgrandom.cc \
160
  commondefs.h \
161
  lcgrandom.h \
162
  exception.h
163
$O/lex.expressionyy.o: lex.expressionyy.cc \
164
  commonutil.h \
165
  commondefs.h \
166
  stringutil.h \
167
  expressionyydefs.h \
168
  expression.tab.hh \
169
  exception.h \
170
  expression.h
171
$O/linetokenizer.o: linetokenizer.cc \
172
  commondefs.h \
173
  linetokenizer.h \
174
  exception.h
175
$O/matchexpression.o: matchexpression.cc \
176
  commonutil.h \
177
  commondefs.h \
178
  patternmatcher.h \
179
  matchexpression.h \
180
  exception.h
181
$O/matchexpression.tab.o: matchexpression.tab.cc \
182
  commondefs.h \
183
  patternmatcher.h \
184
  matchexpression.h \
185
  exception.h \
186
  matchexpressionlexer.h
187
$O/matchexpressionlexer.o: matchexpressionlexer.cc \
188
  commonutil.h \
189
  commondefs.h \
190
  stringutil.h \
191
  matchexpression.tab.hh \
192
  exception.h \
193
  matchexpressionlexer.h
194
$O/patternmatcher.o: patternmatcher.cc \
195
  commonutil.h \
196
  commondefs.h \
197
  patternmatcher.h \
198
  stringutil.h \
199
  opp_ctype.h \
200
  exception.h
201
$O/rwlock.o: rwlock.cc \
202
  rwlock.h \
203
  commondefs.h \
204
  exception.h
205
$O/stringpool.o: stringpool.cc \
206
  commondefs.h \
207
  stringpool.h
208
$O/stringtokenizer.o: stringtokenizer.cc \
209
  commondefs.h \
210
  stringtokenizer.h
211
$O/stringutil.o: stringutil.cc \
212
  commonutil.h \
213
  commondefs.h \
214
  stringutil.h \
215
  stringtokenizer.h \
216
  opp_ctype.h \
217
  exception.h
218
$O/unitconversion.o: unitconversion.cc \
219
  commonutil.h \
220
  commondefs.h \
221
  unitconversion.h \
222
  stringutil.h \
223
  opp_ctype.h \
224
  exception.h