~ubuntu-branches/ubuntu/trusty/verilator/trusty-proposed

« back to all changes in this revision

Viewing changes to .pc/Fix-PowerPC-runtime-error.patch/src/Makefile_obj.in

  • Committer: Bazaar Package Importer
  • Author(s): أحمد المحمودي (Ahmed El-Mahmoudy)
  • Date: 2011-08-23 13:15:42 UTC
  • Revision ID: james.westby@ubuntu.com-20110823131542-zcle7eobz4bbdxmm
Tags: 3.820-2
Cherry-picked Fix-PowerPC-runtime-error.patch from upstream VCS
(Closes: #598256)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- Makefile -*-
 
2
#*****************************************************************************
 
3
#
 
4
# DESCRIPTION: Verilator: Makefile for verilog source
 
5
#
 
6
# Code available from: http://www.veripool.org/verilator
 
7
#
 
8
#*****************************************************************************
 
9
#
 
10
# Copyright 2003-2011 by Wilson Snyder.  This program is free software; you can
 
11
# redistribute it and/or modify it under the terms of either the GNU
 
12
# Lesser General Public License Version 3 or the Perl Artistic License
 
13
# Version 2.0.
 
14
#
 
15
# Verilator is distributed in the hope that it will be useful,
 
16
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
# GNU General Public License for more details.
 
19
#
 
20
#****************************************************************************/
 
21
 
 
22
#### Start of system configuration section. ####
 
23
 
 
24
# Unfortunately configure uses relative paths, and this makefile is called
 
25
# from a level lower, so we need to move up if it's relative, not if absolute.
 
26
config_srcdir = @srcdir@
 
27
ifeq ($(config_srcdir),.)
 
28
 srcdir = ..
 
29
else  # Run an experiment
 
30
 ifeq ($(shell -e $(config_srcdir)/../Makefile_obj.in),)
 
31
   srcdir = $(config_srcdir)
 
32
 else
 
33
   srcdir = $(config_srcdir)/..
 
34
 endif
 
35
endif
 
36
 
 
37
incdir = $(srcdir)/../include
 
38
# Bldsrc may differ from srcdir if configure wan't run from the kit top
 
39
bldsrc = ..
 
40
 
 
41
# Programs
 
42
CC = @CC@
 
43
CXX = @CXX@
 
44
LINK = @CXX@
 
45
LEX = @LEX@
 
46
LFLAGS = -d
 
47
PERL = @PERL@
 
48
YACC = @YACC@
 
49
 
 
50
prefix = @prefix@
 
51
 
 
52
# Directory in which to install data across multiple architectures
 
53
datarootdir = @datarootdir@
 
54
 
 
55
# Directory in which to install package specific files
 
56
# Generally ${prefix}/share/verilator
 
57
pkgdatadir = @pkgdatadir@
 
58
 
 
59
# Compile options
 
60
CFG_WITH_DEFENV = @CFG_WITH_DEFENV@
 
61
CPPFLAGSNOWALL += @CPPFLAGS@
 
62
LDFLAGS += @LDFLAGS@
 
63
 
 
64
#### End of system configuration section. ####
 
65
 
 
66
VPATH += . $(bldsrc) $(srcdir)
 
67
TGT = ../../verilator_bin
 
68
 
 
69
#################
 
70
ifeq ($(VL_DEBUG),)
 
71
# Optimize
 
72
COPT = -O
 
73
else
 
74
# Debug
 
75
COPT = -ggdb -DVL_DEBUG
 
76
# Debug & Profile:
 
77
#LDFLAGS += -pg -g
 
78
#COPT = -ggdb -pg -g
 
79
endif
 
80
#################
 
81
 
 
82
#LIBS += -ldl
 
83
#CCMALLOC = /usr/local/lib/ccmalloc-gcc.o -lccmalloc -ldl
 
84
 
 
85
# -lfl not needed as Flex invoked with %nowrap option
 
86
LIBS = -lm
 
87
 
 
88
CPPFLAGSNOWALL += -MMD
 
89
CPPFLAGSNOWALL += -I. -I$(bldsrc) -I$(srcdir) -I$(incdir)
 
90
CPPFLAGSNOWALL += -DYYDEBUG     # Required to get nice error messages
 
91
#CPPFLAGSNOWALL += -DVL_LEAK_CHECKS     # If running valgrind or other hunting tool
 
92
CPPFLAGSNOWALL += $(COPT)
 
93
CPPFLAGS = $(CPPFLAGSNOWALL)
 
94
ifeq ($(VERILATOR_AUTHOR_SITE),1)       # Local... Else don't burden users
 
95
CPPFLAGSNOWALL += -MP   # Only works on recent GCC versions
 
96
CPPFLAGS += -W -Wall -Wno-unused-parameter -Wno-char-subscripts -Werror
 
97
#CPPFLAGS += -pedantic-errors
 
98
endif
 
99
 
 
100
ifneq ($(SYSTEMPERL),)  # Intuit SYSTEMPERL_INCLUDE as it's new
 
101
 SYSTEMPERL_INCLUDE ?= $(SYSTEMPERL)/src
 
102
#else if set, leave as-is.
 
103
#else if SYSTEMPERL="" don't set _INCLUDE so source will figure it out
 
104
endif
 
105
 
 
106
# Allow RPM builds to specify hardcoded data directories
 
107
# To do this:
 
108
ifeq ($(CFG_WITH_DEFENV),yes)
 
109
 CPPFLAGS += -DDEFENV_SYSTEMC=\"$(SYSTEMC)\"
 
110
 CPPFLAGS += -DDEFENV_SYSTEMC_ARCH=\"$(SYSTEMC_ARCH)\"
 
111
 CPPFLAGS += -DDEFENV_SYSTEMPERL=\"$(SYSTEMPERL)\"
 
112
 CPPFLAGS += -DDEFENV_SYSTEMPERL_INCLUDE=\"$(SYSTEMPERL_INCLUDE)\"
 
113
 ifeq ($(VERILATOR_ROOT),)      # Use what we're given, or intuit
 
114
  CPPFLAGS += -DDEFENV_VERILATOR_ROOT=\"$(pkgdatadir)\"
 
115
 else
 
116
  CPPFLAGS += -DDEFENV_VERILATOR_ROOT=\"$(VERILATOR_ROOT)\"
 
117
 endif
 
118
endif
 
119
 
 
120
HEADERS = $(wildcard V*.h v*.h)
 
121
 
 
122
ASTGEN = $(srcdir)/astgen
 
123
BISONPRE = $(srcdir)/bisonpre
 
124
FLEXFIX = $(srcdir)/flexfix
 
125
 
 
126
######################################################################
 
127
#### Top level
 
128
 
 
129
all: make_info $(TGT)
 
130
 
 
131
make_info:
 
132
        @echo "      Compile flags: " $(CXX) ${CPPFLAGS}
 
133
 
 
134
clean mostlyclean distclean maintainer-clean::
 
135
        -rm -f *.o *.d perlxsi.c *_gen_*
 
136
        -rm -f *__gen*
 
137
        -rm -f obj_* .objcache*
 
138
 
 
139
distclean maintainer-clean:: clean
 
140
 
 
141
maintainer-clean::
 
142
 
 
143
maintainer-copy::
 
144
 
 
145
#### Top executable
 
146
 
 
147
RAW_OBJS = \
 
148
        Verilator.o \
 
149
        V3Active.o \
 
150
        V3ActiveTop.o \
 
151
        V3Assert.o \
 
152
        V3AssertPre.o \
 
153
        V3Ast.o \
 
154
        V3AstNodes.o    \
 
155
        V3Begin.o \
 
156
        V3Branch.o \
 
157
        V3Broken.o \
 
158
        V3Case.o \
 
159
        V3Cast.o \
 
160
        V3Cdc.o \
 
161
        V3Changed.o \
 
162
        V3Clean.o \
 
163
        V3ClkGater.o \
 
164
        V3Clock.o \
 
165
        V3Combine.o \
 
166
        V3Config.o \
 
167
        V3Const__gen.o \
 
168
        V3Coverage.o \
 
169
        V3CoverageJoin.o \
 
170
        V3Dead.o \
 
171
        V3Delayed.o \
 
172
        V3Depth.o \
 
173
        V3DepthBlock.o \
 
174
        V3Descope.o \
 
175
        V3EmitC.o \
 
176
        V3EmitCInlines.o \
 
177
        V3EmitCSyms.o \
 
178
        V3EmitMk.o \
 
179
        V3EmitV.o \
 
180
        V3Error.o \
 
181
        V3Expand.o \
 
182
        V3File.o \
 
183
        V3Gate.o \
 
184
        V3GenClk.o \
 
185
        V3Graph.o \
 
186
        V3GraphAlg.o \
 
187
        V3GraphAcyc.o \
 
188
        V3GraphDfa.o \
 
189
        V3GraphTest.o \
 
190
        V3Hashed.o \
 
191
        V3Inline.o \
 
192
        V3Inst.o \
 
193
        V3Life.o \
 
194
        V3LifePost.o \
 
195
        V3Link.o \
 
196
        V3LinkCells.o \
 
197
        V3LinkDot.o \
 
198
        V3LinkJump.o \
 
199
        V3LinkLValue.o \
 
200
        V3LinkLevel.o \
 
201
        V3LinkParse.o \
 
202
        V3LinkResolve.o \
 
203
        V3Localize.o \
 
204
        V3Name.o \
 
205
        V3Number.o \
 
206
        V3Options.o \
 
207
        V3Order.o \
 
208
        V3Param.o \
 
209
        V3PreShell.o \
 
210
        V3Premit.o \
 
211
        V3Scope.o \
 
212
        V3Slice.o \
 
213
        V3Split.o \
 
214
        V3SplitAs.o \
 
215
        V3Stats.o \
 
216
        V3StatsReport.o \
 
217
        V3Subst.o \
 
218
        V3Table.o \
 
219
        V3Task.o \
 
220
        V3Trace.o \
 
221
        V3TraceDecl.o \
 
222
        V3Tristate.o \
 
223
        V3Undriven.o \
 
224
        V3Unknown.o \
 
225
        V3Unroll.o \
 
226
        V3Width.o \
 
227
        V3WidthSel.o \
 
228
 
 
229
# Non-concatable
 
230
OBJS += \
 
231
        V3ParseImp.o \
 
232
        V3ParseGrammar.o \
 
233
        V3ParseLex.o \
 
234
        V3PreProc.o \
 
235
 
 
236
#### Linking
 
237
 
 
238
ifeq ($(VL_DEBUG),)
 
239
# Building with fewer objects to better optimize
 
240
#OBJS += V3__CONCAT.o
 
241
OBJS += $(RAW_OBJS)
 
242
else
 
243
OBJS += $(RAW_OBJS)
 
244
endif
 
245
 
 
246
V3__CONCAT.cpp: $(addsuffix .cpp, $(basename $(RAW_OBJS)))
 
247
        $(PERL) $(srcdir)/../bin/verilator_includer $^ > $@
 
248
 
 
249
$(TGT): V3Ast__gen_classes.h $(OBJS)
 
250
        @echo "      Linking $@..."
 
251
        -rm -rf $@ $@.exe
 
252
        ${LINK} ${LDFLAGS} -o $@ $(OBJS) $(CCMALLOC) ${LIBS}
 
253
        @-(cp $@.exe $@ || true)
 
254
# ok if cp failes on linux, it's there to insure executable works on NT
 
255
 
 
256
V3Number_test: V3Number_test.o
 
257
        ${LINK} ${LDFLAGS} -o $@ $^ ${LIBS}
 
258
 
 
259
#### Modules
 
260
 
 
261
%__gen.cpp:     %.cpp $(ASTGEN) V3Ast.h V3AstNodes.h
 
262
        $(PERL) $(ASTGEN) -I$(srcdir) $*.cpp
 
263
 
 
264
%.o:    %.cpp
 
265
        $(OBJCACHE) ${CXX} ${CPPFLAGS} -c $<
 
266
%.o:    %.c
 
267
        $(OBJCACHE) ${CC}  ${CPPFLAGS} -c $<
 
268
 
 
269
V3ParseLex.o:   V3ParseLex.cpp V3Lexer.yy.cpp V3ParseBison.c
 
270
        $(OBJCACHE) ${CXX} ${CPPFLAGSNOWALL} -c $<
 
271
 
 
272
V3ParseGrammar.o:       V3ParseGrammar.cpp V3ParseBison.c
 
273
        $(OBJCACHE) ${CXX} ${CPPFLAGSNOWALL} -c $<
 
274
 
 
275
V3ParseImp.o:   V3ParseImp.cpp V3ParseBison.c
 
276
        $(OBJCACHE) ${CXX} ${CPPFLAGSNOWALL} -c $<
 
277
 
 
278
V3PreProc.o:    V3PreProc.cpp V3PreLex.yy.cpp
 
279
        $(OBJCACHE) ${CXX} ${CPPFLAGSNOWALL} -c $<
 
280
 
 
281
#### Generated files
 
282
 
 
283
# Target rule called before parallel build to make generated files
 
284
serial:: V3Ast__gen_classes.h V3ParseBison.c
 
285
 
 
286
V3Ast__gen_classes.h : $(ASTGEN) V3Ast.h V3AstNodes.h
 
287
        $(PERL) $(ASTGEN) -I$(srcdir)  --classes
 
288
 
 
289
V3ParseBison.h: V3ParseBison.c
 
290
 
 
291
# Have only one output file in this rule to prevent parallel make issues
 
292
V3ParseBison.c: verilog.y $(BISONPRE)
 
293
        @echo "If you get errors from verilog.y below, try upgrading bison to version 1.875 or newer."
 
294
        $(PERL) $(BISONPRE) --yacc ${YACC} -d -v -o V3ParseBison.c $<
 
295
 
 
296
V3Lexer_pregen.yy.cpp:  verilog.l V3ParseBison.h $(HEADERS)
 
297
        ${LEX} --version
 
298
        ${LEX} ${LFLAGS} -o$@ $<
 
299
 
 
300
V3Lexer.yy.cpp: V3Lexer_pregen.yy.cpp $(FLEXFIX)
 
301
        $(PERL) $(FLEXFIX) V3Lexer <$< >$@
 
302
 
 
303
V3PreLex_pregen.yy.cpp: V3PreLex.l $(HEADERS)
 
304
        ${LEX} --version
 
305
        ${LEX} ${LFLAGS} -o$@ $<
 
306
 
 
307
V3PreLex.yy.cpp: V3PreLex_pregen.yy.cpp $(FLEXFIX)
 
308
        $(PERL) $(FLEXFIX) V3PreLex <$< >$@
 
309
 
 
310
######################################################################
 
311
######################################################################
 
312
 
 
313
DEPS := $(wildcard *.d)
 
314
ifneq ($(DEPS),)
 
315
include $(DEPS)
 
316
endif