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