Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / Makefile
# ========== Copyright Header Begin ==========================================
#
# OpenSPARC T2 Processor File: Makefile
# 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 ============================================
#
# "@(#)1.2 06/04/24 Makefile, top level, SAM."
#
# ---------------- conditional/dependent defines -------------
include Makefile.defines
include Makefile.targetspecs
# -----------------------------------------------------------------
# help:
# -----------------------------------------------------------------
help:
@echo "specify target:"
@echo " cpu - cpu one of: $(ANYBUILD)"
@echo " clean - clean all"
# -----------------------------------------------------------------
# $(ANYBUILD):
#
# Build devices first. Then we build our cpu model, and
# we fiish with some analysers and other things (system for example).
# -----------------------------------------------------------------
SOL10.sh = echo $$SOL10
SOL10 = $(SOL10.sh:sh)
$(ANYBUILD): FRC
@if [ "`/bin/uname -r`" = "5.10" -a "$(SOL10)" != "OK" ] ; then \
echo 'Do not build on a s10 machine (use make SOL10=OK $@ to overwrite,' ; \
echo 'or do setenv SOL10 OK)' ; \
/bin/false ; \
fi
@if [ "$(CHECK_MODE)" = "" ]; then \
echo "MODE=$(MODE) is unknown, try g or opt." ;\
/bin/false ;\
fi
@if [ "$(CHECK_ARCH)" = "" ]; then \
echo "ARCH=$(ARCH) is unknown, try v9, v8plus, or amd64." ;\
/bin/false ;\
fi
- /bin/mkdir -p $(INSTALL_DIRS)
if [ "$(DEVICES.$(EXPORT_OK))" != "" ]; then \
for f in `echo "$(DEVICES.$(EXPORT_OK))"` ; do \
( \
cd devices/$$f ;\
$(MAKE) $(PASSDOWN) TREEPATH="devices/$$f" \
) \
done \
fi ;\
( \
cd cpus/$(CPU_DIR); \
$(MAKE) $(CPU) $(PASSDOWN) TREEPATH="cpus/$(CPU_DIR)" \
) ;\
if [ "$(ANALYZERS)" != "" ]; then \
for f in `echo "$(ANALYZERS)"` ; do \
( \
cd analyzers/$$f ;\
$(MAKE) $(PASSDOWN) TREEPATH="analyzers/$$f" \
) ; \
done \
fi ;\
if [ "$(OTHER)" != "" ]; then \
for f in `echo "$(OTHER)"` ; do \
( \
cd $$f ;\
$(MAKE) $(PASSDOWN) TREEPATH="$$f" \
) \
done \
fi ;\
if [ "$(IMPORT)" != "" ]; then \
$(MAKE) $(PASSDOWN) $(IMPORT) ;\
fi
# -----------------------------------------------------------------
# clean:
#
# This target cleans out all the make targets and intermittend
# results that get produced by the build processes
# -----------------------------------------------------------------
clean:
/bin/rm -rf $(BUILD_ROOT) $(ANYBUILD:%=install-%)
( cd cpus/vonk ; $(MAKE) clean $(PASSDOWN) TREEPATH="cpus/vonk" )
( cd devices/py ; $(MAKE) $(PASSDOWN) clean )
/bin/rm -fr nas,5.n2.opens.$(USER)
include Makefile.rules
include Makefile.release
# -----------------------------------------------------------------
# cscope
# -----------------------------------------------------------------
cscope.out: cscope.files
cscope -b
cscope.files: FRC
@$(RM) cscope.files cscope.files.raw
-find . -name SCCS -prune -o -name deleted_files -prune -o -type f \
\( -name "*.[chs]" -o -name "*.cc" -o -name "Makefile*" \
-o -name '*.il*' \) -print > cscope.files.raw
grep -v Makefile cscope.files.raw > cscope.files
grep Makefile cscope.files.raw >> cscope.files
@$(RM) cscope.files.raw
# ------------------------- -=oOo=- ------------------------