1 # |
|
2 # CDDL HEADER START |
|
3 # |
|
4 # The contents of this file are subject to the terms of the |
|
5 # Common Development and Distribution License (the "License"). |
|
6 # You may not use this file except in compliance with the License. |
|
7 # |
|
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 # or http://www.opensolaris.org/os/licensing. |
|
10 # See the License for the specific language governing permissions |
|
11 # and limitations under the License. |
|
12 # |
|
13 # When distributing Covered Code, include this CDDL HEADER in each |
|
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 # If applicable, add the following below this CDDL HEADER, with the |
|
16 # fields enclosed by brackets "[]" replaced with your own identifying |
|
17 # information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 # |
|
19 # CDDL HEADER END |
|
20 # |
|
21 |
|
22 # |
|
23 # Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
|
24 # |
|
25 |
|
26 # |
|
27 # Common macros |
|
28 # |
|
29 |
|
30 PRE_POUND = pre\# |
|
31 POUND_SIGN = $(PRE_POUND:pre\%=%) |
|
32 |
|
33 DIRMODE = 755 |
|
34 FILEMODE = 0444 |
|
35 |
|
36 # Installation directories |
|
37 MFS_DIR = /lib/svc/manifest |
|
38 VP_DIR = /usr/share/vpanels |
|
39 RAD_JAVA_DIR = /usr/lib/rad/java |
|
40 VP_LOCALE = $(VP_DIR)/locale |
|
41 |
|
42 PROTO_APPS = $(ROOT)/usr/share/applications |
|
43 PROTO_APPS_PO = $(ROOT)/usr/share/applications/po |
|
44 PROTO_AUTOSTART = $(ROOT)/usr/share/gnome/autostart |
|
45 PROTO_BIN = $(ROOT)/usr/bin |
|
46 PROTO_DOC = $(ROOT)/usr/share/lib/java/javadoc |
|
47 PROTO_ETC_SEC = $(ROOT)/etc/security |
|
48 PROTO_ETC_UATTR.D = $(ROOT)/etc/user_attr.d |
|
49 PROTO_ETC_VPANELS = $(ROOT)/etc/vpanels |
|
50 PROTO_INCLUDE = $(ROOT)/usr/include |
|
51 PROTO_LIB = $(ROOT)/usr/lib |
|
52 PROTO_RAD = $(PROTO_LIB)/rad |
|
53 PROTO_RAD_JAVA = $(PROTO_RAD)/java |
|
54 PROTO_MAN = $(ROOT)/usr/share/man |
|
55 PROTO_MDB = $(ROOT)/usr/lib/mdb/proc |
|
56 PROTO_MFS_NETWORK = $(ROOT)$(MFS_DIR)/network |
|
57 PROTO_MFS_SYSTEM = $(ROOT)$(MFS_DIR)/system |
|
58 PROTO_MTD = $(ROOT)/lib/svc/method |
|
59 PROTO_PYTHON = $(ROOT)/usr/lib/python2.6/vendor-packages |
|
60 PROTO_SCHEMA = $(ROOT)/etc/gconf/schemas |
|
61 PROTO_VP_DIR = $(ROOT)$(VP_DIR) |
|
62 PROTO_VP_LOCALE = $(ROOT)$(VP_LOCALE) |
|
63 PROTO_HELP_AUTHS = $(PROTO_LIB)/help/auths/locale/C |
|
64 PROTO_HELP_PROFS = $(PROTO_LIB)/help/profiles/locale/C |
|
65 |
|
66 PROJ_CORE = $(SRC)/core/build/$(MACH32) |
|
67 |
|
68 # Files generated during build removed during "make clean/clobber" |
|
69 CLEAN_FILES = |
|
70 CLOBBER_FILES = $(CLEAN_FILES) |
|
71 |
|
72 # Remove the CDDL from a target file |
|
73 RMCDDL = $(PERL) -ni -e '\ |
|
74 if (!$$cddl) {\ |
|
75 print unless ($$cddl = /CDDL HEADER START/);\ |
|
76 } elsif (/CDDL HEADER END/) {\ |
|
77 $$cddl = 0;\ |
|
78 }' $@ |
|
79 |
|
80 # Install macros |
|
81 INS.dir = $(INS) -s -d -m $(DIRMODE) $@ |
|
82 INS.file = \ |
|
83 $(INS) -s -d -m $(DIRMODE) $(@D); \ |
|
84 $(RM) -- $@; \ |
|
85 $(INS) -s -m $(FILEMODE) -f $(@D) $< |
|
86 INS.pyfile = $(INS.file); $(RMCDDL); $(TOUCH) -r $< $@ |
|
87 |
|
88 #Install and rename a file |
|
89 INS.rename = \ |
|
90 $(INS.file); \ |
|
91 $(MV) $(@D)/$(<F) $@ |
|
92 |
|
93 # Tools and dependencies used at build time |
|
94 ISA:sh = uname -p |
|
95 CHMOD = /usr/bin/chmod |
|
96 CP = /usr/bin/cp |
|
97 EGREP = /usr/bin/egrep |
|
98 ENV = /usr/bin/env |
|
99 FIND = /usr/bin/find |
|
100 GREP = /usr/bin/grep |
|
101 GTAR = /usr/sfw/bin/gtar |
|
102 HEAD = /usr/bin/head |
|
103 INS = /usr/sbin/install |
|
104 LN = /usr/bin/ln |
|
105 LS = /usr/bin/ls |
|
106 MKDIR = /usr/bin/mkdir |
|
107 MV = /usr/bin/mv |
|
108 PERL = /usr/bin/perl |
|
109 PKG = /usr/bin/pkg |
|
110 PKGMERGE = /usr/bin/pkgmerge |
|
111 PKGMOGRIFY = /usr/bin/pkgmogrify |
|
112 PKGREPO = /usr/bin/pkgrepo |
|
113 PKGSEND = /usr/bin/pkgsend |
|
114 PWDCMD = /usr/bin/pwd |
|
115 SED = /usr/bin/sed |
|
116 SORT = /usr/bin/sort |
|
117 TAR = /usr/bin/tar |
|
118 WGET = /usr/bin/wget |
|
119 XARGS = /usr/bin/xargs |
|
120 PYTHON = /usr/bin/python |
|
121 TOUCH = /usr/bin/touch |
|
122 TRUE = /usr/bin/true |
|
123 INTLTOOL_EXTRACT = /usr/bin/intltool-extract |
|
124 INTLTOOL_UPDATE = /usr/bin/intltool-update |
|
125 INTLTOOL_MERGE = /usr/bin/intltool-merge |
|
126 |
|
127 # Set here explicitly to avoid compiling with newer class version |
|
128 JDK_HOME = $(JAVA7_HOME) |
|
129 JAVA_HOME = $(JDK_HOME) |
|
130 |
|
131 JAVAC = $(JDK_HOME)/bin/javac |
|
132 JAR = $(JDK_HOME)/bin/jar |
|
133 JAVADOC = $(JDK_HOME)/bin/javadoc |
|
134 JAVAH = $(JDK_HOME)/bin/javah |
|
135 |
|
136 JAVA = $(JAVA_HOME)/bin/java |
|
137 |
|
138 # Consumers must depend on java (or java/adr) |
|
139 RADADRGEN = $(ENV) \ |
|
140 RADADR_SCHEMA=/usr/share/lib/xml/rng/radadr.rng.1 \ |
|
141 RADADR_XSLDIR=/usr/share/lib/xml/style \ |
|
142 /usr/bin/radadrgen |
|
143 |
|
144 |
|
145 # Lint |
|
146 LINTFLAGS = -s -errtags=yes -errsecurity=core -errwarn=%all |
|
147 |
|
148 # Mapfiles |
|
149 MAPFILES_i386 = /usr/lib/ld/map.noexdata |
|
150 MAPFILES_sparc = |
|
151 MAPFILES = $(MAPFILES_$(ISA)) /usr/lib/ld/map.pagealign |
|
152 |
|
153 MAPOPTS = $(MAPFILES:%=-M%) |
|
154 |
|
155 # Libraries |
|
156 LIBNAME = $(LIBRARY:lib%.a=%) |
|
157 DYNLIB = $(LIBRARY:.a=.so$(VERS)) |
|
158 SOLIB = $(LIBRARY:.a=.so) |
|
159 |
|
160 LLINK = 32 |
|
161 LINTLIB = llib-l$(LIBNAME).ln |
|
162 LINTSRC = $(LINTLIB:%.ln=%) |
|
163 LINTOUT = lint.out |
|
164 LINTSRCS = $(SRCS) |
|
165 |
|
166 LIBDIR64_i386=amd64 |
|
167 LIBDIR64_sparc=sparcv9 |
|
168 LIBDIR64=$(LIBDIR64_$(ISA)) |
|
169 |
|
170 ROOTHDRDIR = $(PROTO_INCLUDE) |
|
171 ROOTHDRS = $(HDRS:%=$(ROOTHDRDIR)/%) |
|
172 |
|
173 ROOTLIBBASE = $(PROTO_LIB) |
|
174 |
|
175 ROOTLINTDIR = $(ROOTLIBBASE) |
|
176 ROOTLINT = $(LINTSRC:%=$(ROOTLINTDIR)/%) |
|
177 |
|
178 ROOTLIBDIR32 = $(ROOTLIBBASE) |
|
179 ROOTLIBDIR64 = $(ROOTLIBBASE)/$(LIBDIR64) |
|
180 ROOTLIBDIR = $(ROOTLIBDIR$(LLINK)) |
|
181 ROOTLIBS = $(LIBS:%=$(ROOTLIBDIR)/%) |
|
182 |
|
183 ROOTLIBLINK32 = $(ROOTLIBBASE)/32 |
|
184 ROOTLIBLINK64 = $(ROOTLIBBASE)/64 |
|
185 ROOTLIBTGT32 = . |
|
186 ROOTLIBTGT64 = $(LIBDIR64) |
|
187 |
|
188 # Default to all subdirectories with a Makefile |
|
189 SUBDIRS_CMD = $(LS) -1 */Makefile 2>/dev/null | $(SED) 's@/Makefile$$@@' |
|
190 SUBDIRS = $(SUBDIRS_CMD:sh) |
|
191 |
|
192 # Use CLASS_PATH instead of CLASS_PATH to avoid picking up environment |
|
193 CLASS_PATH_ARRAY = $(DEPENDENCY_JARS) |
|
194 CLASS_PATH_CMD = echo "$(CLASS_PATH_ARRAY)" | $(SED) 's/[ ][ ]*/:/g' |
|
195 CLASS_PATH = $(CLASS_PATH_CMD:sh) |
|
196 |
|
197 .SUFFIXES: .py .pyc |
|
198 |
|
199 .py.pyc: |
|
200 $(RM) $@ |
|
201 $(PYTHON) -mpy_compile $< |
|
202 @[ $(<)c = $@ ] || $(MV) $(<)c $@ |
|