In legion build config, updated path to GNU tools and updated deprecated Sun CC flag...
[OpenSPARC-T2-SAM] / legion / src / procs / sunsparc / libniagara2 / Makefile.inc
CommitLineData
920dae64
AT
1# ========== Copyright Header Begin ==========================================
2#
3# OpenSPARC T2 Processor File: Makefile.inc
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#
22# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23# Use is subject to license terms.
24#
25# ident "@(#)Makefile.inc 1.20 07/10/12 SMI"
26#
27# libniagara2 makefile
28#
29# We create the libniagara2.so loadable module
30# from these source files.
31#
32
33NIAGARA2_VER=.1
34NIAGARA2_COMMON_OBJ=ss_common_n2.o ss_err_trap_n2.o
35NIAGARA2_SRC=niagara2.c niagara2_error.c niagara2_device.c niagara2_err_trap.c
36NIAGARA2_OBJ=niagara2.o niagara2_error.o niagara2_device.o niagara2_err_trap.o
37ifdef BUILDFPSIM
38NIAGARA2_COMMON_OBJ+=fpsim_support_n2.o
39NIAGARA2_SRC+=fpsim_n2.c
40NIAGARA2_OBJ+=fpsim_n2.o
41else
42NIAGARA2_SRC+=fpsim_dummy_n2.c
43NIAGARA2_OBJ+=fpsim_dummy_n2.o
44endif
45
46
47NIAGARA2_LIB=libniagara2.so
48NIAGARA2_LIB_LINK=./plugins/$(NIAGARA2_LIB)
49NIAGARA2_BIN=$(NIAGARA2_LIB_LINK)$(NIAGARA2_VER)
50
51NIAGARA2_INCLUDES=-I$(SRCDIR)/procs/sunsparc/include
52NIAGARA2_CFLAGS=$(NIAGARA2_INCLUDES) $(CFLAGS) $(SHAREDLIB_CFLAGS) -DNIAGARA2 -DHW_TABLEWALK
53
54NIAGARA2_DBG_OBJ=niagara2_dbg
55NIAGARA2_DBG_BIN=./plugins/lib$(NIAGARA2_DBG_OBJ).so
56
57
58# DBG_SRC defined in src/procs/sunsparc/debug/Makefile.inc
59NIAGARA2_DBG_SRC=$(DBG_SRC)
60
61LIBS+=\
62 $(NIAGARA2_BIN)
63
64ifdef INTERNAL_BUILD
65 LINK_TO_CRYPRO="-llegion_crypto"
66 NIAGARA2_STREAM_MA_SRC=stream_ma.c
67 NIAGARA2_STREAM_MA_OBJ=stream_ma.o
68 NIAGARA2_STREAM_MA_INCLUDES=-I$(SRCDIR)/procs/sunsparc/libcrypto/include
69 NIAGARA2_RNG_SRC=n2rng.c
70 NIAGARA2_RNG_OBJ=n2rng.o
71
72$(NIAGARA2_RNG_OBJ): $(NIAGARA2_RNG_SRC)
73 @echo "================> Making $(NIAGARA2_RNG_OBJ)"
74 $(CC) $(CPPFLAGS) $(CRYPTO_CFLAGS) -c -o $@ $^
75
76# -DCOMPILER_BIT_FIELD_BUG uses alternate, and less nice, code that
77# works around a compiler bug. You need this flag if, without it, all
78# CWQ (stream) cryptographic operations (e.g. DES, 3DES) fail with a
79# protocol error. It is definitely needed for
80# Sun WorkShop 6 update 1 C 5.2 2000/09/11 with -xO3.
81# See Bug ID 6325177.
82
83$(NIAGARA2_STREAM_MA_OBJ): $(NIAGARA2_STREAM_MA_SRC)
84 @echo "================> Making $(NIAGARA2_STREAM_MA_OBJ)"
85 $(CC) -DCOMPILER_BIT_FIELD_BUG $(NIAGARA2_CFLAGS) \
86 $(CPPFLAGS) $(NIAGARA2_STREAM_MA_INCLUDES) \
87 -c -o $@ $^
88
89else
90 # EXTERNAL build
91
92 LINK_TO_CRYPRO=
93 NIAGARA2_STREAM_MA_SRC=
94 NIAGARA2_STREAM_MA_OBJ=
95 NIAGARA2_STREAM_MA_INCLUDES=
96 NIAGARA2_RNG_SRC=
97 NIAGARA2_RNG_OBJ=
98$(NIAGARA2_RNG_OBJ):
99 @echo "================> Skipping the make of NIAGARA2_RNG_OBJ for External release"
100$(NIAGARA2_STREAM_MA_OBJ):
101 @echo "================> Skipping the make of NIAGARA2_STREAM_MA_OBJ for External release"
102endif
103
104ss_common_n2.o: ../common/ss_common.c
105 @echo "================> Making $@"
106 $(CC) $(NIAGARA2_CFLAGS) $(CPPFLAGS) -c -o $@ $^
107
108ss_err_trap_n2.o: ../common/ss_err_trap.c
109 @echo "================> Making $@"
110 $(CC) $(NIAGARA2_CFLAGS) $(CPPFLAGS) -c -o $@ $^
111
112niagara2.o: niagara2.c
113 @echo "================> Making $@"
114 $(CC) $(NIAGARA2_CFLAGS) $(CPPFLAGS) -c -o $@ $^
115
116niagara2_error.o: niagara2_error.c
117 @echo "================> Making $@"
118 $(CC) $(NIAGARA2_CFLAGS) $(CPPFLAGS) -c -o $@ $^
119
120niagara2_device.o: niagara2_device.c
121 @echo "================> Making $@"
122 $(CC) $(NIAGARA2_CFLAGS) $(CPPFLAGS) -c -o $@ $^
123
124ifdef BUILDFPSIM
125fpsim_support_n2.o: ../common/fpsim_support.s
126 @echo "================> Making $@"
127 $(AS) $(ASFLAGS) -P -b -o $@ $^
128
129fpsim_n2.o: fpsim_n2.c
130 @echo "================> Making $@"
131 $(CC) $(NIAGARA2_CFLAGS) $(CPPFLAGS) -xcode=pic13 -xregs=no%appl -errwarn=%all -c -o $@ $^
132else
133fpsim_dummy_n2.o: ../common/fpsim_dummy.c
134 @echo "================> Making $@"
135 $(CC) $(NIAGARA2_CFLAGS) $(CPPFLAGS) -c -o $@ $<
136endif
137
138niagara2_err_trap.o: niagara2_err_trap.c
139 @echo "================> Making $@"
140 $(CC) $(NIAGARA2_CFLAGS) $(CPPFLAGS) -c -o $@ $^
141
142$(NIAGARA2_DBG_BIN): $(NIAGARA2_DBG_SRC)
143 @echo "================> Making $(NIAGARA2_DBG_BIN)"
144 $(CC) $(CPPFLAGS) $(NIAGARA2_CFLAGS) -xs $(SHAREDLIB_FLAGS) \
145 -R \$$ORIGIN -o $(NIAGARA2_DBG_BIN) $^
146
147$(NIAGARA2_BIN): $(NIAGARA2_OBJ) $(NIAGARA2_COMMON_OBJ) \
148 $(NIAGARA2_DBG_BIN) $(NIAGARA2_STREAM_MA_OBJ) $(NIAGARA2_RNG_OBJ)
149 @echo "================> Making $(NIAGARA2_BIN)"
150 $(CC) $(CPPFLAGS) $(NIAGARA2_CFLAGS) $(SHAREDLIB_FLAGS) -R \$$ORIGIN \
151 -o $(NIAGARA2_BIN) $(NIAGARA2_OBJ) $(NIAGARA2_COMMON_OBJ) \
152 $(NIAGARA2_STREAM_MA_OBJ) $(NIAGARA2_RNG_OBJ) \
153 -lgeneric -l$(NIAGARA2_DBG_OBJ) $(LINK_TO_CRYPRO)
154 $(RM) $(NIAGARA2_LIB_LINK)
155 $(LN) -s $(NIAGARA2_LIB)$(NIAGARA2_VER) $(NIAGARA2_LIB_LINK)
156