Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / rst / rstzip3 / Makefile
CommitLineData
920dae64
AT
1# ========== Copyright Header Begin ==========================================
2#
3# OpenSPARC T2 Processor File: Makefile
4# Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
5# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
6#
7# The above named program is free software; you can redistribute it and/or
8# modify it under the terms of the GNU General Public
9# License version 2 as published by the Free Software Foundation.
10#
11# The above named program is distributed in the hope that it will be
12# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14# General Public License for more details.
15#
16# You should have received a copy of the GNU General Public
17# License along with this work; if not, write to the Free Software
18# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19#
20# ========== Copyright Header End ============================================
21# Makefile for rst/rstzip
22include ../Makefile.master
23
24TOP_DIR = ..
25
26TARG=rstzip
27
28TARGETS = rstzip3 librstzip3.o librstzip3.so
29$(TARG)-32g: $(TARGETS)
30$(TARG)-32opt: $(TARGETS)
31$(TARG)-64g: $(TARGETS)
32$(TARG)-64opt: $(TARGETS)
33$(TARG)-amd64: $(TARGETS)
34
3532g 32opt 64g 64opt amd64: setup
36 cd rstzip_v3 ; $(MAKE) $(BUILDTAG); cd ..
37 cd rstzip_v2 ; $(MAKE) $(BUILDTAG); cd ..
38 cd $(BUILDTAG); $(MAKE) -f ../Makefile $(TARG)-$(BUILDTAG); cd ..
39 install -m 0664 -f $(INSTALL_DIR)/lib/$(HOST3264) $@/librstzip3.o
40 install -m 0664 -f $(INSTALL_DIR)/lib/$(HOST3264) $@/librstzip3.so
41
42clean: setup
43 cd rstzip_v3 ; $(MAKE) clean ; cd ..
44 cd rstzip_v2 ; $(MAKE) clean ; cd ..
45 -rm -rf 32g 32opt 64g 64opt amd64
46 -rm -f $(INSTALL_DIR)/bin/rstzip3 $(INSTALL_DIR)/bin/rstzip3-64 $(INSTALL_DIR)/bin/rstunzip3 $(INSTALL_DIR)/include/Rstzip.H
47 for a in 32 64; do for b in o so; do rm -f $(INSTALL_DIR)/lib/$$a/librstzip3.$$b ; done; done
48
49
50CCFILES = Rstzip.C rstzip.C
51HFILES = Rstzip.H rz_insttypes.h
52ALLSRCS = $(CCFILES) $(HFILES)
53
54install: 32opt 64opt
55 if test -d $(INSTALL_DIR)/include ; then true; else mkdir -m 0775 -p $(INSTALL_DIR)/include ; fi
56 install -m 0664 -f $(INSTALL_DIR)/include Rstzip.H
57 for a in 32 64; do for b in o so; do install -m 0664 -f $(INSTALL_DIR)/lib/$$a $${a}opt/librstzip3.$$b ; done; done
58 install -m 0775 -f $(INSTALL_DIR)/bin 32opt/rstzip3
59 cp -f 64opt/rstzip3 $(INSTALL_DIR)/bin/rstzip3-64 ; chmod 0775 $(INSTALL_DIR)/bin/rstzip3-64
60 if test -L $(INSTALL_DIR)/bin/rstunzip3 ; then unlink $(INSTALL_DIR)/bin/rstunzip3; fi; ln -s rstzip3 $(INSTALL_DIR)/bin/rstunzip3
61
62
63setup: FRC
64 @echo make setup in rstzip3
65 @if test -L Makefile.master ; then unlink Makefile.master ; fi
66 @ln -s ../Makefile.master
67 @for a in 32g 32opt 64g 64opt amd64; do \
68 if test -d $$a; then true; else mkdir $$a; fi; \
69 for f in $(ALLSRCS); do if test -L $$a/$$f; then unlink $$a/$$f; fi; ln -s ../$$f $$a/$$f; done \
70 done
71# @for a in rstzip_v3 rstzip_v2; do cd $$a; $(MAKE) setup; cd ..; done
72
73
74INCLUDES += -I../rstzip_v3 -I../rstzip_v2
75
76# use this version of ZLIB because it is built for large-file support in the 32-bit version
77ZLIB = -L/import/archperf/local/lib/$(HOST3264) -lz
78SPIXLIB = -L/import/archperf/lib/$(HOST3264) -lspix6plus -L$(SHADE_DIR)/lib -lspix_sparc
79RSTZIP3_LIBS = $(SPIXLIB)
80
81rstzip3: rstzip.o librstzip3.o
82 $(CCC) $(CCFLAGS) -o rstzip3 rstzip.o librstzip3.o $(RSTZIP3_LIBS)
83
84librstzip3.o: Rstzip.o FRC
85 $(LD) -r -o $@ Rstzip.o ../rstzip_v3/$(BUILDTAG)/librz3.o ../rstzip_v2/$(BUILDTAG)/librstzip_v2.o $(ZLIB)
86
87librstzip3.so: Rstzip.o FRC
88 $(CCC) $(CCFLAGS) -G -o $@ Rstzip.o ../rstzip_v3/$(BUILDTAG)/librz3.o ../rstzip_v2/$(BUILDTAG)/librstzip_v2.o $(ZLIB)
89
90FRC:
91
92.KEEP_STATE:
93