In legion build config, updated path to GNU tools and updated deprecated Sun CC flag...
[OpenSPARC-T2-SAM] / rst / trconv / 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/trconv
22include ../Makefile.master
23
24TOP_DIR = ..
25TARG = trconv
26
27$(TARG)-32g: $(TARG)
28$(TARG)-64g: $(TARG)
29$(TARG)-32opt: $(TARG)
30$(TARG)-64opt: $(TARG)
31
32CFILES = main.C trconv.C
33HFILES = trconv.H
34ALLSRCS = $(CFILES) $(HFILES)
35OBJS = $(CFILES:%.C=%.o)
36
37SPIX_DIR = /import/archperf/pkgs/spix/1.1
38READSYMBOLS_DIR = /import/archperf/pkgs/readsymbols/1.0
39INCLUDES += -I$(READSYMBOLS_DIR)/inc -I$(SPIX_DIR)/inc
40
41LIBS = $(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
45EXTRAFLAGS += -D_PRINT_PA -D_VALUE_TRACE
46CFLAGS += $(EXTRAFLAGS)
47CCFLAGS += $(EXTRAFLAGS)
48CXXFLAGS += $(EXTRAFLAGS)
49
50$(TARG)-amd64: byteswap.o $(OBJS)
51 $(CCC) $(CFLAGS) -o $(TARG) byteswap.o $(OBJS) $(LIBS)
52
53trconv: $(OBJS)
54 $(CCC) $(CFLAGS) -o $@ $^ $(LIBS)
55
56byteswap.o: byteswap.s
57 $(AS) -P -xarch=amd64 -DARCH_AMD64 byteswap.s
58
5932g 32opt 64g 64opt amd64: setup
60 cd $(OBJ_DIR)/$(BUILDTAG); $(MAKE) -f ../Makefile $(TARG)-$(BUILDTAG); cd $(CUR_DIR)
61
62
63clean:
64 -rm -rf $(OBJ_DIR)
65 -rm -f $(INSTALL_DIR)/bin/$(TARG)
66
67clean-obj::
68 -rm -rf $(OBJ_DIR)
69
70install: $(INSTALL_TARG)
71 install -m 0775 -f $(INSTALL_DIR)/bin $(OBJ_DIR)/$(INSTALL_TARG)/$(TARG)
72
73setup: 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
82FRC:
83
84.KEEP_STATE:
85