Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | # ========== Copyright Header Begin ========================================== |
2 | # | |
3 | # Hypervisor Software File: Makefile.master | |
4 | # | |
5 | # Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
6 | # | |
7 | # - Do no alter or remove copyright notices | |
8 | # | |
9 | # - Redistribution and use of this software in source and binary forms, with | |
10 | # or without modification, are permitted provided that the following | |
11 | # conditions are met: | |
12 | # | |
13 | # - Redistribution of source code must retain the above copyright notice, | |
14 | # this list of conditions and the following disclaimer. | |
15 | # | |
16 | # - Redistribution in binary form must reproduce the above copyright notice, | |
17 | # this list of conditions and the following disclaimer in the | |
18 | # documentation and/or other materials provided with the distribution. | |
19 | # | |
20 | # Neither the name of Sun Microsystems, Inc. or the names of contributors | |
21 | # may be used to endorse or promote products derived from this software | |
22 | # without specific prior written permission. | |
23 | # | |
24 | # This software is provided "AS IS," without a warranty of any kind. | |
25 | # ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, | |
26 | # INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A | |
27 | # PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN | |
28 | # MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR | |
29 | # ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR | |
30 | # DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN | |
31 | # OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR | |
32 | # FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE | |
33 | # DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, | |
34 | # ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF | |
35 | # SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. | |
36 | # | |
37 | # You acknowledge that this software is not designed, licensed or | |
38 | # intended for use in the design, construction, operation or maintenance of | |
39 | # any nuclear facility. | |
40 | # | |
41 | # ========== Copyright Header End ============================================ | |
42 | # | |
43 | # Copyright 2007 Sun Microsystems, Inc. All rights reserved. | |
44 | # Use is subject to license terms. | |
45 | # | |
46 | # ident "@(#)Makefile.master 1.16 07/06/07 SMI" | |
47 | # | |
48 | ||
49 | #COMPMT :sh =case "`/usr/bin/domainname`" in \ | |
50 | *East*) echo /ws/onnv-tools-burpen;; *) echo /ws/onnv-tools;; esac | |
51 | #COMPDIR = $(COMPMT)/SUNWspro | |
52 | COMPDIR = ${SUN_STUDIO} | |
53 | SPRODIR = $(COMPDIR) | |
54 | QTOOLS = $(TOP)/hypervisor-tools | |
55 | QBINDIR = $(QTOOLS)/bin | |
56 | ||
57 | ||
58 | STABS = $(QBINDIR)/stabs | |
59 | ASCHK = $(QBINDIR)/aschk | |
60 | OBJCOPY = $(QBINDIR)/objcopy | |
61 | AS = $(QBINDIR)/qas | |
62 | SAS = $(QBINDIR)/sas | |
63 | CC = $(SPRODIR)/bin/cc | |
64 | LINT= $(SPRODIR)/bin/lint | |
65 | CPP = /usr/ccs/lib/cpp | |
66 | LD = /usr/ccs/bin/ld | |
67 | MDGEN = $(QBINDIR)/mdgen-v1 | |
68 | INS = /usr/sbin/install | |
69 | RM = /usr/bin/rm -f | |
70 | ||
71 | BUILD_ISA :sh= uname -p | |
72 | ||
73 | PROTODIR = $(TOP)/../proto | |
74 | ||
75 | PROTO_INC = $(PROTODIR)/include | |
76 | PROTO_LIB = $(PROTODIR)/$(BUILD_ISA)/lib | |
77 | PROTO_BIN = $(PROTODIR)/$(BUILD_ISA)/bin | |
78 | PROTO_PLAT = $(PROTODIR)/$(PLATFORM)/$(VARIANT) | |
79 | PROTO_PLAT_INC = $(PROTODIR)/$(PLATFORM)/include | |
80 | PROTO_GUEST_BIN = $(PROTODIR)/sun4v/ | |
81 | ||
82 | SUN_INC = $(TOP)/include | |
83 | COMMON_INC = $(TOP)/common/include | |
84 | FAMILY_INC = $(TOP)/$(FAMILY)/common/include | |
85 | PLATFORM_INC = $(TOP)/$(FAMILY)/$(PLATFORM)/include | |
86 | COMMON_SRC = $(TOP)/common/src | |
87 | FAMILY_SRC = $(TOP)/$(FAMILY)/common/src | |
88 | PLATFORM_SRC = $(TOP)/$(FAMILY)/$(PLATFORM)/src | |
89 | OBJ_DIR = $(TOP)/$(FAMILY)/$(PLATFORM)/$(VARIANT) | |
90 | ||
91 | INCFLAGS = -I$(PLATFORM_INC) -I$(FAMILY_INC) -I$(COMMON_INC) -I$(SUN_INC) | |
92 | CFLAGS += -v $(INCFLAGS) | |
93 | ||
94 | .KEEP_STATE: | |
95 | ||
96 | TARGET = all | |
97 | ||
98 | TARGETS = all install clean clobber lint | |
99 | ||
100 | all := TARGET = all | |
101 | clean := TARGET = clean | |
102 | clobber := TARGET = clobber | |
103 | install := TARGET = install | |
104 | lint := TARGET = lint | |
105 | ||
106 | ||
107 | $(TARGETS) :: $(SUBDIRS) | |
108 | ||
109 | install :: all | |
110 | ||
111 | .PARALLEL: | |
112 | .NO_PARALLEL: $(SUBDIRS) .PHONY | |
113 | ||
114 | $(SUBDIRS) :: | |
115 | @cd $@ && pwd && $(MAKE) $(TARGET) | |
116 | ||
117 | INS.file = $(RM) $@; $(INS) -s -m 644 -f $(@D) $< | |
118 | INS.execfile = $(RM) $@; $(INS) -s -m 644 -f $(@D) $< | |
119 | INS.dir = $(INS) -s -d -m 755 $@ | |
120 | ||
121 | $(PROTO_LIB) $(PROTO_INC) $(PROTO_BIN) $(PROTO_PLAT) $(PROTO_GUEST_BIN) $(PROTO_PLAT_INC): | |
122 | $(INS.dir) | |
123 | ||
124 | $(PROTO_PLAT)/%: % $(PROTO_PLAT) | |
125 | $(INS.file) | |
126 | ||
127 | $(PROTO_PLAT_INC)/%: % $(PROTO_PLAT_INC) | |
128 | $(INS.file) | |
129 | ||
130 | $(PROTO_LIB)/%: % $(PROTO_LIB) | |
131 | $(INS.file) | |
132 | ||
133 | $(PROTO_INC)/%: % $(PROTO_INC) | |
134 | $(INS.file) | |
135 | ||
136 | $(PROTO_BIN)/%: % $(PROTO_BIN) | |
137 | $(INS.file) | |
138 | ||
139 | $(PROTO_GUEST_BIN)/%: % $(PROTO_GUEST_BIN) | |
140 | $(INS.file) | |
141 | ||
142 | # Source browsing | |
143 | CSDIR = $(TOP) | |
144 | CSDIRS = $(TOP)/ | |
145 | CSPATHS = $(CSDIRS:%=$(CSDIR)/%) | |
146 | CSINCS = -I$(TOP) | |
147 | CSCOPE = cscope | |
148 | CTAGS = ctags | |
149 | CSFLAGS = -b | |
150 | CTFLAGS = -wt | |
151 | ||
152 | .PRECIOUS: cscope.out | |
153 | ||
154 | cscope.out: cscope.files FRC | |
155 | ${CSCOPE} ${CSFLAGS} | |
156 | ||
157 | cscope.files: FRC | |
158 | @-$(RM) cscope.files cscope.files.raw | |
159 | echo "$(CSINCS)" > cscope.files | |
160 | -find $(CSDIRS) -name SCCS -prune -o \ | |
161 | -type d -name '.del-*' -prune -o -type f \ | |
162 | \( -name '*.[csh]' -o -name 'Makefile*' -o -name '*.il*' \) \ | |
163 | -print > cscope.files.raw | |
164 | -grep -v Makefile cscope.files.raw >> cscope.files | |
165 | -grep Makefile cscope.files.raw >> cscope.files | |
166 | -$(RM) cscope.files.raw | |
167 | @wc -l cscope.files | |
168 | ||
169 | tags: tags.list FRC | |
170 | ${CTAGS} ${CTFLAGS} `cat tags.list` | |
171 | ||
172 | tags.list: cscope.files | |
173 | @$(RM) tags.list | |
174 | grep '\.[chs]$$' cscope.files > tags.list | |
175 | ||
176 | clean :: | |
177 | $(RM) *.o *.ln offsets.h offsets.chk files.s | |
178 | ||
179 | clobber :: clean | |
180 | $(RM) q q.bin q0 reset reset.bin | |
181 | $(RM) cscope.* tags tags.list | |
182 | ||
183 | .PHONY : lintplus lintall | |
184 | ||
185 | # set the errors to report when running 'make lint' | |
186 | # all code should be clean with respect to this set | |
187 | LERRS0 = -erroff=%all | |
188 | LERRS1 = ,no%E_FUNC_VAR_UNUSED,no%E_FUNC_NO_RET_VAL | |
189 | LERRS2 = ,no%E_LABEL_NOT_USED,no%E_FUNC_SET_NOT_USED,no%E_NOP_IF_STMT | |
190 | LERRS3 = ,no%E_NO_IMPLICIT_DECL_ALLOWED,no%E_EXPR_NULL_EFFECT | |
191 | LERRS4 = ,no%E_CASE_FALLTHRU,no%E_USE_BEFORE_SET,no%E_EQUALITY_NOT_ASSIGNMENT | |
192 | LERRS5 = ,no%E_VAR_USED_BEFORE_SET,no%E_LOOP_EMPTY | |
193 | ||
194 | # add some extra potentially interesting errors to report when running | |
195 | # 'make lintplus' | |
196 | # code is not required to be clean with respect to these errors | |
197 | LPLUS1 = ,no%E_USE_BEFORE_SET_PSB,no%E_ASGN_RESET,no%E_ASGN_NEVER_USED | |
198 | LPLUS2 = ,no%E_P_REF_NULL_PSBL,no%E_P_REF_UNINI_PSBL,no%E_P_USE_UNINI_PSBL | |
199 | LPLUS3 = ,no%E_P_WRT_NULL_PSBL,no%E_BAD_FORMAT_ARG_TYPE,no%E_STATIC_UNUSED | |
200 | ||
201 | lintplus := LERRSPLUS = $(LPLUS1)$(LPLUS2)$(LPLUS3) | |
202 | ||
203 | # | |
204 | # Future: For now we only enable a small subset of the error checking. | |
205 | # We need to scrub the code and allow more checks for | |
206 | # lint checking to be really useful. | |
207 | # | |
208 | LINTERRS = $(LERRS0)$(LERRS1)$(LERRS2)$(LERRS3)$(LERRS4)$(LERRS5)$(LERRSPLUS) | |
209 | ||
210 | # report all errors plus security related ones when running 'make lintall' | |
211 | lintall := LINTERRS = -errsecurity=extended | |
212 | ||
213 | lintplus : lint | |
214 | ||
215 | lintall : lint | |
216 | ||
217 | ||
218 | LINT_SRCS = $(COMMON_SRC)/hvcontrol.c \ | |
219 | $(COMMON_SRC)/init.c \ | |
220 | $(COMMON_SRC)/mdsup.c \ | |
221 | $(COMMON_SRC)/reconf.c \ | |
222 | $(COMMON_SRC)/res_console.c \ | |
223 | $(COMMON_SRC)/res_guest.c \ | |
224 | $(COMMON_SRC)/res_ldc.c \ | |
225 | $(COMMON_SRC)/res_mau.c \ | |
226 | $(COMMON_SRC)/res_memory.c \ | |
227 | $(COMMON_SRC)/res_pcie.c \ | |
228 | $(COMMON_SRC)/res_vcpu.c \ | |
229 | $(COMMON_SRC)/support.c | |
230 | ||
231 | LINT_FLAGS =-D__sparcv9 -Xarch=v9 -Nlevel=4 -errtags -errchk=%all -h | |
232 | LINT_FLAGS += -Xc99 | |
233 | LINT_FLAGS += -c | |
234 | LINT_FLAGS += $(CPPFLAGS) | |
235 | LINT_FLAGS += $(LINTERRS) | |
236 | ||
237 | .KEEP_STATE: | |
238 | ||
239 | FRC: |