| 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/rstf |
| 22 | include ../Makefile.master |
| 23 | |
| 24 | TOP_DIR = .. |
| 25 | TARG = rstf_objs |
| 26 | |
| 27 | $(TARG)-32g: $(TARG) |
| 28 | $(TARG)-64g: $(TARG) |
| 29 | $(TARG)-32opt: $(TARG) |
| 30 | $(TARG)-64opt: $(TARG) |
| 31 | $(TARG)-amd64: $(TARG) |
| 32 | |
| 33 | CFILES = rstf.c vercheck.c |
| 34 | HFILES = rstf.h rstf_deprecated.h vercheck.h |
| 35 | ALLSRCS = $(CFILES) $(HFILES) |
| 36 | OBJS = $(CFILES:%.c=%.o) |
| 37 | |
| 38 | $(TARG): $(OBJS) |
| 39 | |
| 40 | 32g 32opt 64g 64opt amd64: setup |
| 41 | cd $(OBJ_DIR)/$(BUILDTAG); $(MAKE) -f ../Makefile $(TARG)-$(BUILDTAG); cd $(CUR_DIR) |
| 42 | |
| 43 | clean: |
| 44 | -rm -rf $(OBJ_DIR) |
| 45 | for a in 32 64; do for b in $(OBJS); do \ |
| 46 | rm -f $(INSTALL_DIR)/lib/$$a/$$b; \ |
| 47 | done; done |
| 48 | |
| 49 | clean-obj:: |
| 50 | -rm -rf $(OBJ_DIR) |
| 51 | |
| 52 | install: 32opt 64opt |
| 53 | if test ! -d $(INSTALL_DIR)/include/rstf ; then mkdir -m 0775 -p $(INSTALL_DIR)/include/rstf ; fi |
| 54 | install -m 0664 -f $(INSTALL_DIR)/include/rstf rstf.h |
| 55 | for a in 32 64; do for b in $(OBJS); do \ |
| 56 | if test ! -d $(INSTALL_DIR)/lib/$$a ; then mkdir -m 0775 -p $(INSTALL_DIR)/lib/$$a ; fi; \ |
| 57 | install -m 0664 -f $(INSTALL_DIR)/lib/$$a $(OBJ_DIR)/$${a}opt/$$b; \ |
| 58 | done; done |
| 59 | |
| 60 | setup: FRC |
| 61 | @echo making setup... |
| 62 | if test ! -d $(OBJ_DIR); then mkdir -m 0775 -p $(OBJ_DIR); cp $(TOP_DIR)/Makefile.master $(OBJ_DIR); ln -s $(CUR_DIR)/Makefile $(OBJ_DIR); fi; |
| 63 | if test ! -d $(INSTALL_DIR)/bin; then mkdir -m 0775 -p $(INSTALL_DIR)/bin; fi; |
| 64 | @for a in 32g 32opt 64g 64opt amd64; do \ |
| 65 | if test ! -d $(OBJ_DIR)/$$a; then mkdir -m 0775 -p $(OBJ_DIR)/$$a; fi; \ |
| 66 | for f in $(ALLSRCS); do if test -L $(OBJ_DIR)/$$a/$$f; then unlink $(OBJ_DIR)/$$a/$$f; fi; ln -s $(CUR_DIR)/$$f $(OBJ_DIR)/$$a; done \ |
| 67 | done |
| 68 | FRC: |
| 69 | |
| 70 | .KEEP_STATE: |