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/trconv | |
22 | include ../Makefile.master | |
23 | ||
24 | TOP_DIR = .. | |
25 | TARG = trconv | |
26 | ||
27 | $(TARG)-32g: $(TARG) | |
28 | $(TARG)-64g: $(TARG) | |
29 | $(TARG)-32opt: $(TARG) | |
30 | $(TARG)-64opt: $(TARG) | |
31 | ||
32 | CFILES = main.C trconv.C | |
33 | HFILES = trconv.H | |
34 | ALLSRCS = $(CFILES) $(HFILES) | |
35 | OBJS = $(CFILES:%.C=%.o) | |
36 | ||
37 | SPIX_DIR = /import/archperf/pkgs/spix/1.1 | |
38 | READSYMBOLS_DIR = /import/archperf/pkgs/readsymbols/1.0 | |
39 | INCLUDES += -I$(READSYMBOLS_DIR)/inc -I$(SPIX_DIR)/inc | |
40 | ||
41 | LIBS = $(SPIX_DIR)/$(HOST3264)/lib/libspix_sparc.a $(READSYMBOLS_DIR)/$(HOST3264)/lib/read_symbols.a | |
42 | ||
43 | %amd64 := LIBS=$(SPIX_DIR)/x64/lib/libspix_sparc.a $(READSYMBOLS_DIR)/amd64/lib/read_symbols.a | |
44 | ||
45 | EXTRAFLAGS += -D_PRINT_PA -D_VALUE_TRACE | |
46 | CFLAGS += $(EXTRAFLAGS) | |
47 | CCFLAGS += $(EXTRAFLAGS) | |
48 | CXXFLAGS += $(EXTRAFLAGS) | |
49 | ||
50 | $(TARG)-amd64: byteswap.o $(OBJS) | |
51 | $(CCC) $(CFLAGS) -o $(TARG) byteswap.o $(OBJS) $(LIBS) | |
52 | ||
53 | trconv: $(OBJS) | |
54 | $(CCC) $(CFLAGS) -o $@ $^ $(LIBS) | |
55 | ||
56 | byteswap.o: byteswap.s | |
57 | $(AS) -P -xarch=amd64 -DARCH_AMD64 byteswap.s | |
58 | ||
59 | 32g 32opt 64g 64opt amd64: setup | |
60 | cd $(OBJ_DIR)/$(BUILDTAG); $(MAKE) -f ../Makefile $(TARG)-$(BUILDTAG); cd $(CUR_DIR) | |
61 | ||
62 | ||
63 | clean: | |
64 | -rm -rf $(OBJ_DIR) | |
65 | -rm -f $(INSTALL_DIR)/bin/$(TARG) | |
66 | ||
67 | clean-obj:: | |
68 | -rm -rf $(OBJ_DIR) | |
69 | ||
70 | install: $(INSTALL_TARG) | |
71 | install -m 0775 -f $(INSTALL_DIR)/bin $(OBJ_DIR)/$(INSTALL_TARG)/$(TARG) | |
72 | ||
73 | setup: FRC | |
74 | @echo making setup... | |
75 | 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; | |
76 | if test ! -d $(INSTALL_DIR)/bin; then mkdir -m 0775 -p $(INSTALL_DIR)/bin; fi; | |
77 | @for a in 32g 32opt 64g 64opt amd64; do \ | |
78 | if test ! -d $(OBJ_DIR)/$$a; then mkdir -m 0775 -p $(OBJ_DIR)/$$a; fi; \ | |
79 | 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; \ | |
80 | if [ "amd64" -eq "$$a" ]; then if test -L $(OBJ_DIR)/$$a/byteswap.s; then unlink $(OBJ_DIR)/$$a/byteswap.s; fi; ln -s $(CUR_DIR)/../rstf/byteswap.s $(OBJ_DIR)/$$a; fi; \ | |
81 | done | |
82 | FRC: | |
83 | ||
84 | .KEEP_STATE: | |
85 |