2008-06-10 03:25:10 +02:00
|
|
|
# -*- Makefile -*-
|
2006-08-26 13:35:28 +02:00
|
|
|
#*****************************************************************************
|
|
|
|
|
#
|
|
|
|
|
# DESCRIPTION: Verilator Example: Makefile for inside object directory
|
|
|
|
|
#
|
2006-12-18 21:05:02 +01:00
|
|
|
# This is executed in the object directory, and called by ../Makefile
|
2006-08-26 13:35:28 +02:00
|
|
|
#
|
2010-01-06 03:15:06 +01:00
|
|
|
# Copyright 2003-2010 by Wilson Snyder. This program is free software; you can
|
2006-08-26 13:35:28 +02:00
|
|
|
# redistribute it and/or modify it under the terms of either the GNU
|
2009-05-04 23:07:57 +02:00
|
|
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
|
|
|
|
# Version 2.0.
|
2006-08-26 13:35:28 +02:00
|
|
|
#
|
|
|
|
|
#*****************************************************************************
|
|
|
|
|
|
|
|
|
|
default: $(VM_PREFIX)
|
|
|
|
|
|
|
|
|
|
ifneq ($(MAKE_MAIN),0)
|
|
|
|
|
# Add main to classes rather then SP_SRCS to save a compiler run
|
2009-12-03 03:15:56 +01:00
|
|
|
VM_CLASSES += ${VM_PREFIX}__main $(VM_USER_CLASSES) $(VM_GLOBAL_FAST) $(VM_GLOBAL_SLOW)
|
2006-08-26 13:35:28 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
include $(VM_PREFIX).mk
|
|
|
|
|
|
2009-12-03 03:15:56 +01:00
|
|
|
VPATH += ../../$(VM_USER_DIR)
|
|
|
|
|
|
2006-08-26 13:35:28 +02:00
|
|
|
#######################################################################
|
|
|
|
|
|
|
|
|
|
ifeq ($(VERILATOR_AUTHOR_SITE),1)
|
|
|
|
|
#OBJCACHE := objcache --read --write
|
2008-06-10 03:25:10 +02:00
|
|
|
#OBJCACHE_HOSTS :=
|
2006-08-26 13:35:28 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
|
|
2009-12-03 12:55:29 +01:00
|
|
|
# Needed by DPI tests
|
|
|
|
|
CPPFLAGS += -DVERILATOR=1
|
|
|
|
|
|
2006-08-26 13:35:28 +02:00
|
|
|
# Needed by tracing routines
|
|
|
|
|
CPPFLAGS += -DVL_DEBUG=1
|
|
|
|
|
CPPFLAGS += -DVM_PREFIX=$(VM_PREFIX)
|
2009-03-14 03:58:55 +01:00
|
|
|
CPPFLAGS += $(CPPFLAGS_DRIVER)
|
2009-12-17 03:28:09 +01:00
|
|
|
CPPFLAGS += $(CPPFLAGS_DRIVER2)
|
2006-08-26 13:35:28 +02:00
|
|
|
CPPFLAGS += $(CPPFLAGS_ADD)
|
|
|
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
|
# Linking final exe
|
|
|
|
|
|
|
|
|
|
ifeq ($(VM_SP_OR_SC),1)
|
|
|
|
|
LIBS += $(SC_LIBS)
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
#Default compile, using normal make rules
|
|
|
|
|
#$(VM_PREFIX): $(SP_SRCS) $(VK_OBJS)
|
2007-04-19 20:39:47 +02:00
|
|
|
# $(LINK) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) 2>&1 | c++filt
|
2006-08-26 13:35:28 +02:00
|
|
|
|
|
|
|
|
#Our own compile rules; Faster compile, all in one file
|
|
|
|
|
$(VM_PREFIX)__ALLboth.cpp: $(VK_CLASSES_CPP) $(VK_SUPPORT_CPP)
|
|
|
|
|
$(SP_INCLUDER) $^ > $@
|
|
|
|
|
|
|
|
|
|
$(VM_PREFIX)__ALLboth.o: $(VM_PREFIX)__ALLboth.cpp
|
|
|
|
|
$(OBJCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPT_FAST) -c -o $@ $<
|
|
|
|
|
|
|
|
|
|
ifneq ($(MAKE_MAIN),0)
|
|
|
|
|
$(VM_PREFIX): $(VM_PREFIX)__ALLboth.o
|
2007-04-19 20:39:47 +02:00
|
|
|
$(LINK) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) 2>&1 | c++filt
|
2006-08-26 13:35:28 +02:00
|
|
|
endif
|