2008-06-10 01:25:10 +00:00
|
|
|
# -*- Makefile -*-
|
2006-08-26 11:35:28 +00:00
|
|
|
#*****************************************************************************
|
|
|
|
#
|
|
|
|
# DESCRIPTION: Verilator Example: Makefile for inside object directory
|
|
|
|
#
|
2006-12-18 20:05:02 +00:00
|
|
|
# This is executed in the object directory, and called by ../Makefile
|
2006-08-26 11:35:28 +00:00
|
|
|
#
|
2017-01-15 17:09:59 +00:00
|
|
|
# Copyright 2003-2017 by Wilson Snyder. This program is free software; you can
|
2006-08-26 11:35:28 +00:00
|
|
|
# redistribute it and/or modify it under the terms of either the GNU
|
2009-05-04 21:07:57 +00:00
|
|
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
|
|
|
# Version 2.0.
|
2006-08-26 11:35:28 +00:00
|
|
|
#
|
|
|
|
#*****************************************************************************
|
|
|
|
|
|
|
|
default: $(VM_PREFIX)
|
|
|
|
|
|
|
|
ifneq ($(MAKE_MAIN),0)
|
2017-09-08 01:08:49 +00:00
|
|
|
# Add main to classes rather then SC_SRCS to save a compiler run
|
2009-12-03 02:15:56 +00:00
|
|
|
VM_CLASSES += ${VM_PREFIX}__main $(VM_USER_CLASSES) $(VM_GLOBAL_FAST) $(VM_GLOBAL_SLOW)
|
2006-08-26 11:35:28 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
include $(VM_PREFIX).mk
|
|
|
|
|
2009-12-03 02:15:56 +00:00
|
|
|
VPATH += ../../$(VM_USER_DIR)
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
#######################################################################
|
|
|
|
|
2009-12-03 11:55:29 +00:00
|
|
|
# Needed by DPI tests
|
|
|
|
CPPFLAGS += -DVERILATOR=1
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
# Needed by tracing routines
|
|
|
|
CPPFLAGS += -DVL_DEBUG=1
|
|
|
|
CPPFLAGS += -DVM_PREFIX=$(VM_PREFIX)
|
2009-03-14 02:58:55 +00:00
|
|
|
CPPFLAGS += $(CPPFLAGS_DRIVER)
|
2009-12-17 02:28:09 +00:00
|
|
|
CPPFLAGS += $(CPPFLAGS_DRIVER2)
|
2006-08-26 11:35:28 +00:00
|
|
|
CPPFLAGS += $(CPPFLAGS_ADD)
|
|
|
|
|
2017-10-08 01:29:57 +00:00
|
|
|
ifeq ($(CFG_WITH_LONGTESTS),yes)
|
|
|
|
ifeq ($(DRIVER_STD),newest)
|
|
|
|
CPPFLAGS += $(CFG_CXXFLAGS_STD_NEWEST)
|
2017-10-14 16:57:42 +00:00
|
|
|
else ifeq ($(DRIVER_STD),oldest)
|
2017-10-08 01:29:57 +00:00
|
|
|
CPPFLAGS += $(CFG_CXXFLAGS_STD_OLDEST)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
#######################################################################
|
|
|
|
# Linking final exe
|
|
|
|
|
2017-09-08 01:08:49 +00:00
|
|
|
ifeq ($(VM_SC),1)
|
2006-08-26 11:35:28 +00:00
|
|
|
LIBS += $(SC_LIBS)
|
|
|
|
endif
|
|
|
|
|
2015-11-28 22:33:01 +00:00
|
|
|
.SUFFIXES:
|
|
|
|
|
2012-03-03 17:09:01 +00:00
|
|
|
#Default compile, pick up OBJCACHE
|
|
|
|
%.o: %.cpp
|
|
|
|
$(OBJCACHE) $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $<
|
|
|
|
|
|
|
|
#Default link, using normal make rules
|
2010-01-24 23:37:01 +00:00
|
|
|
#$(VM_PREFIX): $(VK_GLOBAL_OBJS) $(VK_OBJS)
|
2007-04-19 18:39:47 +00:00
|
|
|
# $(LINK) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) 2>&1 | c++filt
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
#Our own compile rules; Faster compile, all in one file
|
|
|
|
$(VM_PREFIX)__ALLboth.cpp: $(VK_CLASSES_CPP) $(VK_SUPPORT_CPP)
|
2014-11-27 15:52:38 +00:00
|
|
|
$(VERILATOR_INCLUDER) -DVL_INLINE_OPT=inline $^ > $@
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
$(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 18:39:47 +00:00
|
|
|
$(LINK) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) 2>&1 | c++filt
|
2006-08-26 11:35:28 +00:00
|
|
|
endif
|