Commit | Line | Data |
---|---|---|
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 | |
22 | include ../Makefile.master | |
23 | ||
24 | TOP_DIR = .. | |
25 | ||
26 | TARG=rstzip | |
27 | ||
28 | TARGETS = 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 | ||
35 | 32g 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 | ||
42 | clean: 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 | ||
50 | CCFILES = Rstzip.C rstzip.C | |
51 | HFILES = Rstzip.H rz_insttypes.h | |
52 | ALLSRCS = $(CCFILES) $(HFILES) | |
53 | ||
54 | install: 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 | ||
63 | setup: 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 | ||
74 | INCLUDES += -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 | |
77 | ZLIB = -L/import/archperf/local/lib/$(HOST3264) -lz | |
78 | SPIXLIB = -L/import/archperf/lib/$(HOST3264) -lspix6plus -L$(SHADE_DIR)/lib -lspix_sparc | |
79 | RSTZIP3_LIBS = $(SPIXLIB) | |
80 | ||
81 | rstzip3: rstzip.o librstzip3.o | |
82 | $(CCC) $(CCFLAGS) -o rstzip3 rstzip.o librstzip3.o $(RSTZIP3_LIBS) | |
83 | ||
84 | librstzip3.o: Rstzip.o FRC | |
85 | $(LD) -r -o $@ Rstzip.o ../rstzip_v3/$(BUILDTAG)/librz3.o ../rstzip_v2/$(BUILDTAG)/librstzip_v2.o $(ZLIB) | |
86 | ||
87 | librstzip3.so: Rstzip.o FRC | |
88 | $(CCC) $(CCFLAGS) -G -o $@ Rstzip.o ../rstzip_v3/$(BUILDTAG)/librz3.o ../rstzip_v2/$(BUILDTAG)/librstzip_v2.o $(ZLIB) | |
89 | ||
90 | FRC: | |
91 | ||
92 | .KEEP_STATE: | |
93 |