Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / legion / src / Makefile.top
# ========== Copyright Header Begin ==========================================
#
# OpenSPARC T2 Processor File: Makefile.top
# Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
#
# The above named program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License version 2 as published by the Free Software Foundation.
#
# The above named program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this work; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ========== Copyright Header End ============================================
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)Makefile.top 1.64 07/10/12 SMI"
#
# Top level Makefile for simulator
#
#
# Use the RELEASE variable to determine which DIRS to build
#
COMMON_DIRS=\
simcore \
generic \
parser \
host \
support \
support/netcons \
devices/mmi \
devices/mem_bus/libgeneric \
devices/mem_bus/libio \
devices/mem_bus/libdumbserial \
devices/mem_bus/libdumbtod \
devices/mem_bus/libmemory \
devices/mem_bus/libmemsparse \
procs/sparcv9 \
procs/sunsparc/debug
INTERNAL_DIRS=\
support/save_restore \
devices/mem_bus/libmbox \
devices/mem_bus/libosp_fpga \
devices/mem_bus/libfalls_fpga \
devices/mem_bus/libvfpga \
devices/mem_bus/libhole \
devices/mem_bus/libtomatillo \
devices/mem_bus/libxdcbridge \
devices/mem_bus/libpiu/vf \
devices/mem_bus/libsndebugchan \
devices/service_processor/libgeneric_sp \
devices/pcie/libbobo \
devices/hub/libzambezi \
procs/sunsparc/debug/tools \
procs/sunsparc/liblegion_crypto \
devices/mem_bus/libpiu \
procs/sunsparc/libniagara \
procs/sunsparc/libniagara2 \
procs/sunsparc/libvfalls \
procs/sunsparc/librock
EXTERNAL_DIRS=\
devices/mem_bus/libpiu \
procs/sunsparc/libniagara \
procs/sunsparc/libniagara2
DIRS= $(COMMON_DIRS) $($(RELEASE)_DIRS)
ifdef BUILDFIRE
DIRS+= \
devices/mem_bus/libfire \
devices/pci/libbcm
FIRE_PATH=$(SRCDIR)/devices/mem_bus/libfire
FIRE_MODEL_PATH=$(FIRE_PATH)/libfiremodel
FIRE_INCLUDES=-I $(FIRE_MODEL_PATH)/Fire/src -I $(FIRE_PATH)
FIRE_MODEL_CLEAN=libfire_model_clean
endif
VPATH=$(OBJDIR):$(DIRS:%=$(SRCDIR)/%):$(DIRS:%=$(SRCDIR)/%/include)
INCLUDES=-I$(OBJDIR) -I$(SRCDIR)/include -I$(SRCDIR)/devices/mem_bus/libgeneric
INCLUDES+= -I$(SRCDIR)/devices/mem_bus/include $(DIRS:%=-I$(SRCDIR)/%/include)
PLUGINS_DIR=./plugins
CPPFLAGS=$(INCLUDES) $(DEFINES)
#LFLAGS=-s
LFLAGS=
TARGET=sim
OBJS=datestamp.o
MADESRCS=datestamp.c
MADEBINS=
TOOLS=
LIBS=
ifdef INTERNAL_BUILD
CONFIGURE_SCRIPT=configure
else
CONFIGURE_SCRIPT=configure.opensparc
endif
all : configuration support plugins $(TARGET) config
plugins:
@mkdir -m 755 $(PLUGINS_DIR)
ifdef INTERNAL_BUILD
config: MAKE=/usr/ccs/bin/make
config:
@cd $(SRCDIR)/config && $(MAKE) $(MFLAGS)
config_clean: MAKE=/usr/ccs/bin/make
config_clean:
cd $(SRCDIR)/config; $(MAKE) clean $(MFLAGS)
else
config:
config_clean:
endif
configuration: $(SRCDIR)/$(CONFIGURE_SCRIPT)
/bin/sh $^ testconfigure $(CONFVER)
#
# Some more default rules:
#
FRC:
# Delete the implicit .S->.o rule
%.o : %.S
# Delete the .S->.s rule
%.s : %.S
# Now create the intermediate rules
%.i : %.S
$(CPP) -D_ASM $(CPPFLAGS) $< > $@
%.s : %.i
./lsplitter "NL" < $< > $@
cscope.files: FRC
/usr/bin/find $(DESTDIR)/. $(SRCDIR)/. -name SCCS -prune -o \
-name built -prune -o \
-type f \( -name '*.[schS]' -o -name 'Makefile*' \
-o -name 'GNUmakefile*' \) \
-print > cscope.files
tags: FRC
/usr/bin/ctags -uw `cat cscope.files`
cscope.out: cscope.files tags FRC
$(CSCOPE) -bq
# Now read and apply sub-makefiles, so we build all rules correctly
include $(DIRS:%=$(SRCDIR)/%/Makefile.inc)
$(TARGET) : $(TOOLS) $(OBJS) $(LIBS)
@echo "================> Making $@"
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LOADLIBS)
.INTERMEDIATE: datestamp.c
datestamp.c : $(SRCDIR)/Makefile.top
echo "const char datestamp[] = \""`date +%Y-%m-%d--%T`"\";" > datestamp.c
clean: config_clean $(FIRE_MODEL_CLEAN)
@echo "================> Making clean in $$PWD"
rm -f $(OBJS) $(LIBS) $(MADEBINS) $(MADESRCS) $(TARGET) *.o temp_*
rm -rf $(PLUGINS_DIR)
distclean: clean
rm -f Makefile hostcpu.h hostnative_asm.h hostnative.h hostnative_ua200x.h \
dumbblue.conf hostnative_asm.S hostnative.c hostnative_ua200x.c hostos.h \
GNUmakefile Makefile.tools
clobber: clean distclean
rm -f tags cscope.*
release:
tar -cvf release.tar sim plugins
compress -f release.tar