Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / common / vera / niu_ippktgen / C / libnet / src / Makefile.nc
CommitLineData
86530b38
AT
1include $(INSTALL_DIR)/tools/inca/files/Makefile.nc.defines
2# Uncomment the following line to use the GCC compiler
3USE_COMPILER = g++
4# Uncomment the following line to use the C++ compiler to link shared libs
5USE_LINKER = g++
6# include $(INSTALL_DIR)/tools/inca/files/Makefile.nc.$(ARCH)
7include Makefile.nc.$(ARCH)
8################# PUT ALL USER MACROS AFTER THIS LINE #################
9
10#
11# Makefile.nc
12#
13# This makefile can be used as a template makefile for statically or
14# dynamically linking PLI/VPI, LMSI, or SWIFT code into the NC-Verilog tools
15# For C++ Rules and Macros refer to 'C++ HOWTO' in this file.
16#
17# All of the defines in this Makefile also exist in
18# $(INSTALL_DIR)/tools/inca/files/Makefile.nc.defines
19# By modifying them here, you will override the default values there.
20#
21# Any targets that you do not need can be safely deleted from this file.
22#
23
24#
25# The TARGETDIR macro should be set to the directory where the resulting
26# executables should be placed. This defaults to the current directory.
27#
28TARGETDIR=.
29
30# Shared libraries
31VPILIB = $(TARGETDIR)/libvpi.$(SHARED_LIB_POSTFIX)
32# PLILIB = $(TARGETDIR)/libpli.$(SHARED_LIB_POSTFIX)
33PLILIB = $(TARGETDIR)/libnet_niu_ippktgen_pli.$(SHARED_LIB_POSTFIX)
34VHPILIB = $(TARGETDIR)/libvhpi.$(SHARED_LIB_POSTFIX)
35CFCLIB = $(TARGETDIR)/libcfc.$(SHARED_LIB_POSTFIX)
36FMILIB = $(TARGETDIR)/libfmi.$(SHARED_LIB_POSTFIX)
37DPILIB = $(TARGETDIR)/libdpi.$(SHARED_LIB_POSTFIX)
38
39#
40# Set this to the set of targets that you want executed. For example, if
41# you want to create a libpli.so file, then set it to:
42#
43FIRST_TARGET = $(PLILIB)
44
45#
46# Specify any defines that you want set by uncommenting the USR_DEFINES
47# Macro below. All defines should have a '-D' prefix to work properly
48# e.g. INCA, INCA_test, MYTEST and ETC are defined below.
49#
50# USR_DEFINES = -DINCA -DINCA_test -DMYTEST -DETC
51
52#
53# The VPI_USER_C macro should be set to the vpi_user.c file containing any
54# user defined 'C' routines for use with VPI (PLI 2.0).
55# vpi_user.c can be copied from $(INSTALL_DIR)/tools/inca/src/vpi_user.c
56#
57VPI_USER_C = ./vpi_user.c
58VPI_USER_O = $(TARGETDIR)/vpi_user.$(OBJ_POSTFIX)
59
60#
61# The VPI_OBJECTS_SAFE macro should be set to the object files which you do
62# not want deleted in "clean" target.
63#
64VPI_OBJECTS_SAFE =
65
66#
67# Add any VPI objects which need to be compiled, and can be deleted using the
68# "clean" target here:
69#
70VPI_OBJECTS =
71
72#
73# Add any library linking options needed to resolve external references for
74# the VPILIB shared library
75#
76VPI_EXTERN_LIBS =
77
78#
79# The VERIUSER_C macro should be set to the veriuser.c file containing any
80# user defined 'C' routines for use with PLI 1.0.
81# veriuser.c can be copied from $(INSTALL_DIR)/tools/inca/src/veriuser.c
82#
83VERIUSER_C =
84VERIUSER_O =
85
86#
87# The PLI_OBJECTS_SAFE macro should be set to the object files which you do
88# not want deleted in "clean" target.
89#
90PLI_OBJECTS_SAFE = $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_advanced.o \
91 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_asn1.o \
92 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_802.1q.o \
93 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_802.1x.o \
94 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_802.2.o \
95 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_802.3.o \
96 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_arp.o \
97 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_bgp.o \
98 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_cdp.o \
99 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_data.o \
100 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_dhcp.o \
101 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_dns.o \
102 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_ethernet.o \
103 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_fddi.o \
104 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_gre.o \
105 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_icmp.o \
106 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_igmp.o \
107 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_ip.o \
108 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_ipsec.o \
109 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_isl.o \
110 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_mpls.o \
111 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_ntp.o \
112 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_ospf.o \
113 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_pim.o \
114 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_rip.o \
115 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_rpc.o \
116 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_rsvp.o \
117 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_sctp.o \
118 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_sebek.o \
119 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_snmp.o \
120 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_stp.o \
121 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_tcp.o \
122 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_token_ring.o \
123 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_udp.o \
124 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_build_vrrp.o \
125 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_checksum.o \
126 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_cq.o \
127 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_crc.o \
128 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_error.o \
129 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_if_addr.o \
130 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_init.o \
131 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_internal.o \
132 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_link_dlpi.o \
133 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_pblock.o \
134 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_pkt.o \
135 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_port_list.o \
136 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_prand.o \
137 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_raw.o \
138 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_resolve.o \
139 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_sctp_crc32c.o \
140 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_version.o \
141 $(DV_ROOT)/verif/env/common/vera/niu_ippktgen/C/libnet/src/obj/libnet_write.o
142
143
144#
145# Add any PLI objects which need to be compiled, and can be deleted using the
146# "clean" target here:
147#
148PLI_OBJECTS =
149
150#
151# Add any library linking options needed to resolve external references for
152# the PLILIB shared library
153#
154PLI_EXTERN_LIBS =
155
156#
157# The VHPI_OBJECTS_SAFE macro should be set to the object files which you do
158# not want deleted in "clean" target.
159#
160VHPI_OBJECTS_SAFE =
161
162#
163# Add any VHPI objects which need to be compiled, and can be deleted using the
164# "clean" target here:
165#
166VHPI_OBJECTS =
167
168#
169# Add any library linking options needed to resolve external references for
170# the VHPILIB shared library
171#
172VHPI_EXTERN_LIBS =
173
174#
175# The CFC_OBJECTS_SAFE macro should be set to the object files which you do
176# not want deleted in "clean" target.
177#
178CFC_OBJECTS_SAFE =
179
180#
181# Add any CFC objects which need to be compiled, and can be deleted using the
182# "clean" target here:
183#
184CFC_OBJECTS =
185
186#
187# Add any library linking options needed to resolve external references for
188# the CFCLIB shared library
189#
190CFC_EXTERN_LIBS =
191
192#
193# The FMI_OBJECTS_SAFE macro should be set to the object files which you do
194# not want deleted in "clean" target.
195#
196FMI_OBJECTS_SAFE =
197
198#
199# Add any FMI objects which need to be compiled, and can be deleted using the
200# "clean" target here:
201#
202FMI_OBJECTS =
203
204#
205# Add any library linking options needed to resolve external references for
206# the FMILIB shared library
207#
208FMI_EXTERN_LIBS =
209
210#
211# The DPI_OBJECTS_SAFE macro should be set to the object files which you do
212# not want deleted in "clean" target.
213#
214DPI_OBJECTS_SAFE =
215
216#
217# Add any DPI objects which need to be compiled, and can be deleted using the
218# "clean" target here:
219#
220DPI_OBJECTS =
221
222#
223# Add any library linking options needed to resolve external references for
224# the DPILIB shared library
225#
226DPI_EXTERN_LIBS =
227
228DPI_USER_C = ./_sv_export.c
229DPI_USER_O = $(TARGETDIR)/_sv_export.$(OBJ_POSTFIX)
230
231#
232# LMC_HOME is set to the swift installation
233# Shared library path environment variable should be set to include the
234# path of the swift shared library.
235#
236LMC_HOME =
237
238#
239# The SFI_ROOT macro should be set to the lmsi installation
240#
241SFI_ROOT =
242
243#
244# The NCELAB macro should be set to the name of the elaborator which should
245# be generated by the static link.
246#
247NCELAB = $(TARGETDIR)/ncelab
248
249#
250# The NCSIM macro should be set to the name of the simulator which should
251# be generated by the static link.
252#
253NCSIM = $(TARGETDIR)/ncsim
254
255#
256# The TARGETS macro should be set to pli/vpi objects/executables with statically
257# linked PLI/VPI objects
258#
259PLI_O_TARGETS = $(VERIUSER_O) $(PLI_OBJECTS) $(PLI_OBJECTS_SAFE)
260VPI_O_TARGETS = $(VPI_USER_O) $(VPI_OBJECTS) $(VPI_OBJECTS_SAFE)
261VHPI_O_TARGETS = $(VHPI_OBJECTS) $(VHPI_OBJECTS_SAFE)
262DPI_O_TARGETS = $(DPI_OBJECTS) $(DPI_OBJECTS_SAFE)
263
264# To add PLI 1.0 applications when linking statically, add $(PLI_O_TARGETS) to
265# the O_TARGETS list below.
266#
267# To add VPI applications when linking statically, add $(VPI_O_TARGETS) to
268# the O_TARGETS list below.
269#
270# To add VHPI applications when linking statically, add $(VHPI_O_TARGETS) to
271# the O_TARGETS list below.
272#
273#O_TARGETS = $(PLI_O_TARGETS) $(VPI_O_TARGETS) $(VHPI_O_TARGETS)
274
275O_TARGETS =
276
277# The CFC_O_TARGETS and FMI_O_TARGETS should be set to CFC/FMI objects/
278# executables with statically linked CFC/FMI objects respectively
279CFC_O_TARGETS = $(CFC_OBJECTS) $(CFC_OBJECTS_SAFE)
280FMI_O_TARGETS = $(FMI_OBJECTS) $(FMI_OBJECTS_SAFE)
281
282# To add CFC applications to ncsim when linking statically, add $(CFC_O_TARGETS)
283# to the NCSIM_O_TARGETS list below.
284#
285# To add FMI applications to ncsim when linking statically, add $(FMI_O_TARGETS)
286# to the NCSIM_O_TARGETS list below.
287
288NCSIM_O_TARGETS = \
289 $(CFC_OBJECTS) $(CFC_OBJECTS_SAFE) \
290 $(FMI_OBJECTS) $(FMI_OBJECTS_SAFE)
291
292TARGETS = $(NCELAB) $(NCSIM)
293
294# DYNAMIC LINKING
295
296# Begin targets for PLI/VPI dynamic linking
297# The dynamic target builds the NC executables for debugging with shared
298# libraries
299# The shared_libs target builds the VPI and PLI shared libraries.
300#
301
302DYN_TARGETS = $(NCELAB)_dynamic $(NCSIM)_dynamic
303
304#
305#
306#
307# C++ HOWTO
308#
309# History:
310# The Elaborator as well as the Simulator routines are written in C.
311# The supporting library routines are written in C too. However, there
312# are applications which have been written using C++. There are
313# some 3rd party vendors that have written their IP in C++ too. We
314# therefore need a way to integrate all of this into a single Elaborator
315# executable and a single Simulator executable.
316#
317# In order for C++ objects to be properly integrated with the ncelab and
318# ncsim objects (i.e. ncelab.$(OBJ_POSTFIX) and ncsim.$(OBJ_POSTFIX)) it
319# is required that the main() routine be compiled using C++. That was
320# the motivation for the following set of Rules and Macros.
321#
322# Gotchas:
323# There are some quirks that you should be aware of before integrating
324# the C++ routines.
325#
326# o You should ensure that the same C++ compiler is used to compile all
327# of the code, including the IP's provided by 3rd party vendor's.
328# It is not possible for a user.cc, compiled using CC and vendor.cc,
329# compiled using gcc, to be integrated together, due to name-mangling and
330# various other issues.
331#
332# o The routines and variables in your C++ code that are used in veriuser.c
333# and vpi_user.c, should be explicitly declared in your C++ code as an
334# 'extern "C"'. This tells the C++ compiler not to mangle the names that
335# will eventually be used in routines compiled using a C compiler. e.g.
336# File: veriuser.c
337# ----------------
338# extern int hello_world(int);
339# s_tfcell veriusertfs[TF_MAXARRAY] = {
340# {usertask, 0, 0, 0, (int (*)())hello_world, 0, "$hello_world", 1 },
341# 0
342# };
343#
344# File: user_code.cc
345# -------------------
346# extern "C" int hello_world(int);
347# extern "C" void io_printf(char*);
348# int hello_world(int foo) { io_printf("Hello World\n"); return(foo);}
349#
350# o If you intend on including some of the VPI/PLI include files, you
351# should ensure that proper defines are put in place. e.g.
352# File: user_code.cc
353# -------------------
354# #define PROTO_PARAMS(params) params
355# #define PLI_EXTERN extern "C"
356# #include <stdio.h>
357# #include "vpi_user.h"
358# #undef PROTO_PARAMS
359# #undef PLI_EXTERN
360# /* Other routines and declarations. */
361#
362# o '.cc' is the assumed extension of all the C++ files used here. You
363# should make appropriate corrections if you are using different
364# extensions, via the CC_EXTENSION macro.
365#
366# o You should copy over main.cc and veriuser.c and/or vpi_user.c from
367# $(INSTALL_DIR)/tools/inca/src and make the appropriate changes before
368# using them.
369#
370# o You should remember to modify the following macros as appropriate.
371# CCC -> To specify the C++ compiler (Default: CC)
372# CCFLAGS -> Flags for the C++ compiler (Default: CFLAGS)
373# CC_EXTENSION -> Extensions for C++ files (Default: .cc)
374# TARGETDIR -> Directory where targets will be put (Default: .)
375# VPI_USER_C -> Your vpi_user.c file if any (Default: ./vpi_user.c)
376# VERIUSER_C -> Your veriuser.c file if any (Default: ./veriuser.c)
377# CCC_MAIN_CC -> main.cc copied from $(INSTALL_DIR)/tools/inca/src
378# CCC_OBJECTS -> Objects created from your C++ files
379#
380
381
382#
383# The CCC_MAIN_CC macro should be set to the main.cc file containing the
384# main() routine. This topmost routine should be compiled using a C++
385# compiler. It can be copied from $(INSTALL_DIR)/tools/inca/src/main.cc.
386# If copied to another location make appropriate changes to following macros.
387#
388CCC_MAIN_CC = $(INSTALL_DIR)/tools/inca/src/main.$(CC_EXTENSION)
389CCC_MAIN_O = main.$(OBJ_POSTFIX)
390
391
392#
393# The CCC_OBJECTS macro should be populated with the names of your
394# C++ files' objects. For example:
395# If your sources are foo1.cc and foo2.cc then
396# CCC_OBJECTS = foo1.$(OBJ_POSTFIX) foo2.$(OBJ_POSTFIX)
397# These objects will be deleted by the 'clean' target.
398#
399CCC_OBJECTS =
400
401
402#
403# The CCC_OBJECTS_SAFE macro should be populated with the names of your
404# C++ files' objects. For example:
405# If your sources are foo1.cc and foo2.cc then
406# CCC_OBJECTS_SAFE = foo1.$(OBJ_POSTFIX) foo2.$(OBJ_POSTFIX)
407# These objects will *NOT* be deleted by the 'clean' target.
408#
409CCC_OBJECTS_SAFE =
410
411
412#
413# The OCCC_TARGETS macro should be set to pli/vpi objects
414# OCCC_TARGETS = $(VPI_USER_O) $(VERIUSER_O) $(CCC_OBJECTS) $(CCC_OBJECTS_SAFE)
415#
416OCCC_TARGETS =
417
418CCC_TARGETS = $(NCELAB)C $(NCSIM)C
419
420################# PUT ALL USER MACROS BEFORE THIS LINE #################
421include $(INSTALL_DIR)/tools/inca/files/Makefile.nc.targets