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 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved. 23 # 24 # Definitions common to command source. 25 # 26 # include global definitions; SRC should be defined in the shell. 27 # SRC is needed until RFE 1026993 is implemented. 28 29 include $(SRC)/Makefile.master 30 31 LN= ln 32 SH= sh 33 ECHO= echo 34 MKDIR= mkdir 35 TOUCH= touch 36 37 FILEMODE= 0555 38 LIBFILEMODE= 0444 39 XPG4= $(XPG4PROG:%=%.xpg4) 40 XPG6= $(XPG6PROG:%=%.xpg6) 41 42 KRB5DIR= $(ROOT)/usr 43 KRB5BIN= $(KRB5DIR)/bin 44 KRB5SBIN= $(KRB5DIR)/sbin 45 KRB5LIB= $(KRB5DIR)/lib/krb5 46 KRB5RUNPATH= /usr/lib/krb5 47 GSSRUNPATH= /usr/lib/gss 48 49 50 ROOTBIN= $(ROOT)/usr/bin 51 ROOTLIB= $(ROOT)/usr/lib 52 ROOTLIBSVCBIN= $(ROOT)/lib/svc/bin 53 ROOTLIBSVCMETHOD= $(ROOT)/lib/svc/method 54 ROOTLIBXEN= $(ROOT)/usr/lib/xen/bin 55 ROOTLIBZONES= $(ROOT)/lib/zones 56 57 ROOTSHLIB= $(ROOT)/usr/share/lib 58 ROOTPKGBIN= $(ROOT)/usr/sadm/install/bin 59 ROOTCLASS_SCR_DIR= $(ROOT)/usr/sadm/install/scripts 60 ROOTADMIN_SRC_DIR= $(ROOT)/var/sadm/install/admin 61 62 ROOTSHLIBCCS= $(ROOTSHLIB)/ccs 63 ROOTSBIN= $(ROOT)/sbin 64 ROOTUSRSBIN= $(ROOT)/usr/sbin 65 ROOTETC= $(ROOT)/etc 66 67 ROOTETCSECURITY= $(ROOTETC)/security 68 ROOTETCTSOL= $(ROOTETCSECURITY)/tsol 69 ROOTETCSECLIB= $(ROOTETCSECURITY)/lib 70 ROOTETCZONES= $(ROOTETC)/zones 71 72 ROOTETCINET= $(ROOT)/etc/inet 73 ROOTCCSBIN= $(ROOT)/usr/ccs/bin 74 ROOTCCSBIN64= $(ROOTCCSBIN)/$(MACH64) 75 ROOTCCSBINLINKDIR= $(ROOT)/../../bin 76 ROOTCCSBINLINKDIR64= $(ROOT)../../../bin/$(MACH) 77 ROOTUSRKVM= $(ROOT)/usr/kvm 78 ROOTHAS= $(ROOT)/usr/has 79 ROOTHASBIN= $(ROOT)/usr/has/bin 80 ROOTHASLIB= $(ROOT)/usr/has/lib 81 ROOTXPG4= $(ROOT)/usr/xpg4 82 ROOTXPG4BIN= $(ROOT)/usr/xpg4/bin 83 ROOTXPG4BIN32= $(ROOTXPG4BIN)/$(MACH32) 84 ROOTXPG4BIN64= $(ROOTXPG4BIN)/$(MACH64) 85 ROOTXPG6= $(ROOT)/usr/xpg6 86 ROOTXPG6BIN= $(ROOT)/usr/xpg6/bin 87 ROOTLOCALEDEF= $(ROOT)/usr/lib/localedef 88 ROOTCHARMAP= $(ROOTLOCALEDEF)/charmap 89 ROOTI18NEXT= $(ROOTLOCALEDEF)/extensions 90 ROOTI18NEXT64= $(ROOTLOCALEDEF)/extensions/$(MACH64) 91 ROOTBIN32= $(ROOTBIN)/$(MACH32) 92 ROOTBIN64= $(ROOTBIN)/$(MACH64) 93 ROOTCMDDIR64= $(ROOTCMDDIR)/$(MACH64) 94 ROOTLIB64= $(ROOTLIB)/$(MACH64) 95 ROOTUSRSBIN32= $(ROOTUSRSBIN)/$(MACH32) 96 ROOTUSRSBIN64= $(ROOTUSRSBIN)/$(MACH64) 97 ROOTMAN= $(ROOT)/usr/share/man 98 ROOTMAN1= $(ROOTMAN)/man1 99 ROOTMAN1M= $(ROOTMAN)/man1m 100 ROOTMAN3= $(ROOTMAN)/man3 101 ROOTVARSMB= $(ROOT)/var/smb 102 103 104 # 105 # Like ROOTLIBDIR in $(SRC)/Makefile.lib, any lower-level Makefiles that 106 # put their binaries in a non-standard location should reset this and use 107 # $(ROOTCMD) in their `install' target. By default we set this to a bogus 108 # value so that it will not conflict with any of the other values already 109 # defined in this Makefile. 110 # 111 ROOTCMDDIR= $(ROOT)/__nonexistent_directory__ 112 113 ROOTSHAUDIO= $(ROOT)/usr/share/audio 114 ROOTAUDIOSAMP= $(ROOTSHAUDIO)/samples 115 ROOTAUDIOSAMPAU=$(ROOTAUDIOSAMP)/au 116 117 ISAEXEC= $(ROOT)/usr/lib/isaexec 118 PLATEXEC= $(ROOT)/usr/lib/platexec 119 120 LDLIBS = $(LDLIBS.cmd) 121 122 LDFLAGS.cmd = \ 123 $(BDIRECT) $(ENVLDFLAGS1) $(ENVLDFLAGS2) $(ENVLDFLAGS3) \ 124 $(MAPFILE.NES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%) 125 126 LDFLAGS = $(LDFLAGS.cmd) 127 128 LINTFLAGS= -axsm 129 LINTFLAGS64= -axsm -m64 130 LINTOUT= lint.out 131 132 KRB5PROG= $(PROG:%=$(KRB5BIN)/%) 133 KRB5SBINPROG= $(PROG:%=$(KRB5SBIN)/%) 134 KRB5LIBPROG= $(PROG:%=$(KRB5LIB)/%) 135 136 ROOTPROG= $(PROG:%=$(ROOTBIN)/%) 137 ROOTCMD= $(PROG:%=$(ROOTCMDDIR)/%) 138 ROOTSHFILES= $(SHFILES:%=$(ROOTBIN)/%) 139 ROOTLIBPROG= $(PROG:%=$(ROOTLIB)/%) 140 ROOTLIBSHFILES= $(SHFILES:%=$(ROOTLIB)/%) 141 ROOTSHLIBPROG= $(PROG:%=$(ROOTSHLIB)/%) 142 ROOTSBINPROG= $(PROG:%=$(ROOTSBIN)/%) 143 ROOTPKGBINPROG= $(PROG:%=$(ROOTPKGBIN)/%) 144 ROOTCLASS_SCR_FILES= $(SCRIPTS:%=$(ROOTCLASS_SCR_DIR)/%) 145 ROOTUSRSBINPROG=$(PROG:%=$(ROOTUSRSBIN)/%) 146 ROOTUSRSBINSCRIPT=$(SCRIPT:%=$(ROOTUSRSBIN)/%) 147 ROOTETCPROG= $(PROG:%=$(ROOTETC)/%) 148 ROOTHASBINPROG= $(PROG:%=$(ROOTHASBIN)/%) 149 ROOTHASLIBPROG= $(PROG:%=$(ROOTHASLIB)/%) 150 ROOTCCSBINPROG= $(PROG:%=$(ROOTCCSBIN)/%) 151 ROOTCCSBINPROG64= $(PROG:%=$(ROOTCCSBIN64)/%) 152 ROOTCCSBINLINK=$(PROG:%= $(ROOTCCSBINLINKDIR)/%) 153 ROOTCCSBINLINK64=$(PROG:%=$(ROOTCCSBINLINKDIR64)/%) 154 ROOTUSRKVMPROG= $(PROG:%=$(ROOTUSRKVM)/%) 155 ROOTXPG4PROG= $(XPG4PROG:%=$(ROOTXPG4BIN)/%) 156 ROOTXPG4PROG32= $(XPG4PROG:%=$(ROOTXPG4BIN32)/%) 157 ROOTXPG4PROG64= $(XPG4PROG:%=$(ROOTXPG4BIN64)/%) 158 ROOTXPG6PROG= $(XPG6PROG:%=$(ROOTXPG6BIN)/%) 159 ROOTLOCALEPROG= $(PROG:%=$(ROOTLOCALEDEF)/%) 160 ROOTPROG64= $(PROG:%=$(ROOTBIN64)/%) 161 ROOTPROG32= $(PROG:%=$(ROOTBIN32)/%) 162 ROOTCMD64= $(PROG:%=$(ROOTCMDDIR64)/%) 163 ROOTUSRSBINPROG32= $(PROG:%=$(ROOTUSRSBIN32)/%) 164 ROOTUSRSBINPROG64= $(PROG:%=$(ROOTUSRSBIN64)/%) 165 ROOTMAN1FILES= $(MAN1FILES:%=$(ROOTMAN1)/%) 166 $(ROOTMAN1FILES) := FILEMODE= 444 167 ROOTMAN1MFILES= $(MAN1MFILES:%=$(ROOTMAN1M)/%) 168 $(ROOTMAN1MFILES) := FILEMODE= 444 169 ROOTMAN3FILES= $(MAN3FILES:%=$(ROOTMAN3)/%) 170 $(ROOTMAN3FILES) := FILEMODE= 444 171 172 # Symlink rules for /usr/ccs/bin commands. Note, those commands under 173 # the rule of the linker area, are controlled by a different set of 174 # rules defined in $(SRC)/cmd/sgs/Makefile.var. 175 176 INS.ccsbinlink= \ 177 $(RM) $(ROOTCCSBINPROG); \ 178 $(SYMLINK) ../../bin/$(PROG) $(ROOTCCSBINPROG) 179 180 INS.ccsbinlink64= \ 181 $(RM) $(ROOTCCSBINPROG64); \ 182 $(SYMLINK) ../../../bin/$(MACH64)/$(PROG) $(ROOTCCSBINPROG64) 183 184 ROOTETCDEFAULT= $(ROOTETC)/default 185 ROOTETCDEFAULTFILES= $(DEFAULTFILES:%.dfl=$(ROOTETCDEFAULT)/%) 186 $(ROOTETCDEFAULTFILES) := FILEMODE = 0644 187 188 ROOTETCSECFILES= $(ETCSECFILES:%=$(ROOTETCSECURITY)/%) 189 $(ROOTETCSECFILES) := FILEMODE = 0644 190 191 ROOTETCTSOLFILES= $(ETCTSOLFILES:%=$(ROOTETCTSOL)/%) 192 $(ROOTETCTSOLFILES) := FILEMODE = 0644 193 194 ROOTETCSECLIBFILES= $(ETCSECLIBFILES:%=$(ROOTETCSECLIB)/%) 195 196 ROOTETCZONESFILES= $(ETCZONESFILES:%=$(ROOTETCZONES)/%) 197 $(ROOTETCZONESFILES) := FILEMODE = 0444 198 199 ROOTLIBZONESFILES= $(LIBZONESFILES:%=$(ROOTLIBZONES)/%) 200 $(ROOTLIBZONESFILES) := FILEMODE = 0555 201 202 ROOTADMIN_SRC_FILE= $(ADMINFILE:%=$(ROOTADMIN_SRC_DIR)/%) 203 $(ROOTADMIN_SRC_FILE) := FILEMODE = 0444 204 205 # 206 # Directories for smf(5) service manifests and profiles. 207 # 208 ROOTSVC= $(ROOT)/lib/svc 209 ROOTETCSVC= $(ROOT)/etc/svc 210 211 ROOTSVCMANIFEST= $(ROOTSVC)/manifest 212 ROOTSVCPROFILE= $(ROOTETCSVC)/profile 213 214 ROOTSVCMILESTONE= $(ROOTSVCMANIFEST)/milestone 215 ROOTSVCDEVICE= $(ROOTSVCMANIFEST)/device 216 ROOTSVCSYSTEM= $(ROOTSVCMANIFEST)/system 217 ROOTSVCSYSTEMDEVICE= $(ROOTSVCSYSTEM)/device 218 ROOTSVCSYSTEMFILESYSTEM= $(ROOTSVCSYSTEM)/filesystem 219 ROOTSVCSYSTEMSECURITY= $(ROOTSVCSYSTEM)/security 220 ROOTSVCNETWORK= $(ROOTSVCMANIFEST)/network 221 ROOTSVCNETWORKDNS= $(ROOTSVCNETWORK)/dns 222 ROOTSVCNETWORKISCSI= $(ROOTSVCNETWORK)/iscsi 223 ROOTSVCNETWORKLDAP= $(ROOTSVCNETWORK)/ldap 224 ROOTSVCNETWORKNFS= $(ROOTSVCNETWORK)/nfs 225 ROOTSVCNETWORKNIS= $(ROOTSVCNETWORK)/nis 226 ROOTSVCNETWORKROUTING= $(ROOTSVCNETWORK)/routing 227 ROOTSVCNETWORKRPC= $(ROOTSVCNETWORK)/rpc 228 ROOTSVCNETWORKSMB= $(ROOTSVCNETWORK)/smb 229 ROOTSVCNETWORKSECURITY= $(ROOTSVCNETWORK)/security 230 ROOTSVCNETWORKSSL= $(ROOTSVCNETWORK)/ssl 231 ROOTSVCNETWORKIPSEC= $(ROOTSVCNETWORK)/ipsec 232 ROOTSVCNETWORKSHARES= $(ROOTSVCNETWORK)/shares 233 ROOTSVCSMB= $(ROOTSVCNETWORK)/smb 234 ROOTSVCPLATFORM= $(ROOTSVCMANIFEST)/platform 235 ROOTSVCPLATFORMSUN4U= $(ROOTSVCPLATFORM)/sun4u 236 ROOTSVCPLATFORMSUN4V= $(ROOTSVCPLATFORM)/sun4v 237 ROOTSVCAPPLICATION= $(ROOTSVCMANIFEST)/application 238 ROOTSVCAPPLICATIONMANAGEMENT= $(ROOTSVCAPPLICATION)/management 239 ROOTSVCAPPLICATIONSECURITY= $(ROOTSVCAPPLICATION)/security 240 ROOTSVCAPPLICATIONPRINT= $(ROOTSVCAPPLICATION)/print 241 242 # 243 # Commands Makefiles delivering a manifest are expected to define MANIFEST. 244 # 245 # Like ROOTCMDDIR, any lower-level Makefiles that put their manifests in a 246 # subdirectory of the manifest directories listed above should reset 247 # ROOTMANIFESTDIR and use it in their `install' target. By default we set this 248 # to a bogus value so that it will not conflict with any of the other values 249 # already defined in this Makefile. 250 # 251 # The manifest validation of the $SRC/cmd check target is also derived from a 252 # valid MANIFEST setting. 253 # 254 ROOTMANIFESTDIR= $(ROOTSVCMANIFEST)/__nonexistent_directory__ 255 ROOTMANIFEST= $(MANIFEST:%=$(ROOTMANIFESTDIR)/%) 256 CHKMANIFEST= $(MANIFEST:%.xml=%.xmlchk) 257 258 # Manifests cannot be checked in parallel, because we are using the global 259 # repository that is in $(SRC)/cmd/svc/seed/global.db. This is a 260 # repository that is built from the manifests in this workspace, whereas 261 # the build machine's repository may be out of sync with these manifests. 262 # Because we are using a private repository, svccfg-native must start up a 263 # private copy of configd-native. We cannot have multiple copies of 264 # configd-native trying to access global.db simultaneously. 265 266 .NO_PARALLEL: $(CHKMANIFEST) 267 268 # 269 # For installing "starter scripts" of services 270 # 271 272 ROOTSVCMETHOD= $(SVCMETHOD:%=$(ROOTLIBSVCMETHOD)/%) 273 274 ROOTSVCBINDIR= $(ROOTLIBSVCBIN)/__nonexistent_directory__ 275 ROOTSVCBIN= $(SVCBIN:%=$(ROOTSVCBINDIR)/%) 276 277 # 278 279 # For programs that are installed in the root filesystem, 280 # build $(ROOTFS_PROG) rather than $(PROG) 281 $(ROOTFS_PROG) := LDFLAGS += -Wl,-I/lib/ld.so.1 282 283 $(KRB5BIN)/%: % 284 $(INS.file) 285 286 $(KRB5SBIN)/%: % 287 $(INS.file) 288 289 $(KRB5LIB)/%: % 290 $(INS.file) 291 292 $(ROOTBIN)/%: % 293 $(INS.file) 294 295 $(ROOTLIB)/%: % 296 $(INS.file) 297 298 $(ROOTBIN64)/%: % 299 $(INS.file) 300 301 $(ROOTLIB64)/%: % 302 $(INS.file) 303 304 $(ROOTBIN32)/%: % 305 $(INS.file) 306 307 $(ROOTSHLIB)/%: % 308 $(INS.file) 309 310 $(ROOTPKGBIN)/%: % 311 $(INS.file) 312 313 $(ROOTCLASS_SCR_DIR)/%: % 314 $(INS.file) 315 316 $(ROOTADMIN_SRC_DIR)/%: % 317 $(INS.file) 318 319 $(ROOTSBIN)/%: % 320 $(INS.file) 321 322 $(ROOTUSRSBIN)/%: % 323 $(INS.file) 324 325 $(ROOTUSRSBIN32)/%: % 326 $(INS.file) 327 328 $(ROOTUSRSBIN64)/%: % 329 $(INS.file) 330 331 $(ROOTETC)/%: % 332 $(INS.file) 333 334 $(ROOTETCINET)/%: % 335 $(INS.file) 336 337 $(ROOTETCDEFAULT)/%: %.dfl 338 $(INS.rename) 339 340 $(ROOTETCTSOL)/%: % 341 $(INS.file) 342 343 $(ROOTETCSECLIB)/%: % 344 $(INS.file) 345 346 $(ROOTETCZONES)/%: % 347 $(INS.file) 348 349 $(ROOTLIBZONES)/%: % 350 $(INS.file) 351 352 $(ROOTLIBXEN)/%: % 353 $(INS.file) 354 355 $(ROOTHASBIN)/%: % 356 $(INS.file) 357 358 $(ROOTHASLIB)/%: % 359 $(INS.file) 360 361 $(ROOTUSRKVM)/%: % 362 $(INS.file) 363 364 $(ROOTXPG4BIN)/%: %.xpg4 365 $(INS.rename) 366 367 $(ROOTXPG4BIN32)/%: %.xpg4 368 $(INS.rename) 369 370 $(ROOTXPG4BIN64)/%: %.xpg4 371 $(INS.rename) 372 373 $(ROOTXPG6BIN)/%: %.xpg6 374 $(INS.rename) 375 376 $(ROOTLOCALEDEF)/%: % 377 $(INS.file) 378 379 $(ROOTCHARMAP)/%: % 380 $(INS.file) 381 382 $(ROOTI18NEXT)/%: % 383 $(INS.file) 384 385 $(ROOTI18NEXT64)/%: % 386 $(INS.file) 387 388 $(ROOTLIBSVCMETHOD)/%: % 389 $(INS.file) 390 391 $(ROOTLIBSVCBIN)/%: % 392 $(INS.file) 393 394 $(ROOTSVCMILESTONE)/%: % 395 $(INS.file) 396 397 $(ROOTSVCDEVICE)/%: % 398 $(INS.file) 399 400 $(ROOTSVCSYSTEM)/%: % 401 $(INS.file) 402 403 $(ROOTSVCSYSTEMDEVICE)/%: % 404 $(INS.file) 405 406 $(ROOTSVCSYSTEMFILESYSTEM)/%: % 407 $(INS.file) 408 409 $(ROOTSVCSYSTEMSECURITY)/%: % 410 $(INS.file) 411 412 $(ROOTSVCNETWORK)/%: % 413 $(INS.file) 414 415 $(ROOTSVCNETWORKLDAP)/%: % 416 $(INS.file) 417 418 $(ROOTSVCNETWORKNFS)/%: % 419 $(INS.file) 420 421 $(ROOTSVCNETWORKNIS)/%: % 422 $(INS.file) 423 424 $(ROOTSVCNETWORKRPC)/%: % 425 $(INS.file) 426 427 $(ROOTSVCNETWORKSECURITY)/%: % 428 $(INS.file) 429 430 $(ROOTSVCNETWORKSSL)/%: % 431 $(INS.file) 432 433 $(ROOTSVCNETWORKIPSEC)/%: % 434 $(INS.file) 435 436 $(ROOTSVCNETWORKSHARES)/%: % 437 $(INS.file) 438 439 $(ROOTSVCNETWORKSMB)/%: % 440 $(INS.file) 441 442 $(ROOTSVCAPPLICATION)/%: % 443 $(INS.file) 444 445 $(ROOTSVCAPPLICATIONMANAGEMENT)/%: % 446 $(INS.file) 447 448 $(ROOTSVCAPPLICATIONSECURITY)/%: % 449 $(INS.file) 450 451 $(ROOTSVCAPPLICATIONPRINT)/%: % 452 $(INS.file) 453 454 $(ROOTSVCPLATFORM)/%: % 455 $(INS.file) 456 457 $(ROOTSVCPLATFORMSUN4U)/%: % 458 $(INS.file) 459 460 $(ROOTSVCPLATFORMSUN4V)/%: % 461 $(INS.file) 462 463 # Install rule for gprof, yacc, and lex dependency files 464 $(ROOTSHLIBCCS)/%: ../common/% 465 $(INS.file) 466 467 $(ROOTCCSBINLINKDIR)/%: % 468 $(INS.ccsbinlink) 469 470 $(ROOTCCSBINLINKDIR64)/%: % 471 $(INS.ccsbinlink64) 472 473 $(ROOTMAN1)/%: %.sunman 474 $(INS.rename) 475 476 $(ROOTMAN1M)/%: %.sunman 477 $(INS.rename) 478 479 $(ROOTMAN3)/%: %.sunman 480 $(INS.rename) 481 482 $(ROOTVARSMB)/%: % 483 $(INS.file) 484 485 # build rule for statically linked programs with single source file. 486 %.static: %.c 487 $(LINK.c) -o $@ $< $(LDLIBS) 488 $(POST_PROCESS) 489 490 %.xpg4: %.c 491 $(LINK.c) -o $@ $< $(LDLIBS) 492 $(POST_PROCESS) 493 494 %.xpg6: %.c 495 $(LINK.c) -o $@ $< $(LDLIBS) 496 $(POST_PROCESS) 497 498 # Define the majority text domain in this directory. 499 TEXT_DOMAIN= SUNW_OST_OSCMD 500 501 CLOBBERFILES += $(XPG4) $(XPG6) $(DCFILE) 502 503 # This flag is for programs which should not build a 32-bit binary 504 sparc_64ONLY= $(POUND_SIGN) 505 64ONLY= $($(MACH)_64ONLY)