17c478bd9Sstevel@tonic-gate# 27c478bd9Sstevel@tonic-gate# CDDL HEADER START 37c478bd9Sstevel@tonic-gate# 47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate# (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate# with the License. 87c478bd9Sstevel@tonic-gate# 97c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate# and limitations under the License. 137c478bd9Sstevel@tonic-gate# 147c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate# 207c478bd9Sstevel@tonic-gate# CDDL HEADER END 217c478bd9Sstevel@tonic-gate# 227c478bd9Sstevel@tonic-gate# 237c478bd9Sstevel@tonic-gate# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate# Use is subject to license terms. 257c478bd9Sstevel@tonic-gate# 267c478bd9Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 277c478bd9Sstevel@tonic-gate# 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gateinclude ../../Makefile.cmd 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gateCOMMON = .. 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gateDEVFSADM_MOD = devfsadm 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gatePLCYSRC = devpolicy.c plcysubr.c 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gateMODLOADDIR = $(COMMON)/../modload 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gateDEVFSADM_SRC = $(COMMON)/$(DEVFSADM_MOD:%=%.c) $(PLCYSRC:%=$(COMMON)/%) 407c478bd9Sstevel@tonic-gateDEVFSADM_OBJ = $(DEVFSADM_MOD:%=%.o) $(PLCYSRC:%.c=%.o) 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gateDEVFSADM_DAEMON = devfsadmd 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gateLINKMOD_DIR = linkmod 457c478bd9Sstevel@tonic-gateDEVFSADM_DIR = devfsadm 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gateCLOBBERFILES = $(MODS) $(DEVLINKTAB) $(DEVFSCOMPATLINKS) $(DEVFSADM_DAEMON) 487c478bd9Sstevel@tonic-gate 497c478bd9Sstevel@tonic-gateLINK_SRCS = \ 507c478bd9Sstevel@tonic-gate $(COMMON)/disk_link.c \ 517c478bd9Sstevel@tonic-gate $(COMMON)/ieee1394_link.c \ 52*8eea8e29Sap25164 $(COMMON)/dcam1394_link.c \ 537c478bd9Sstevel@tonic-gate $(COMMON)/tape_link.c \ 547c478bd9Sstevel@tonic-gate $(COMMON)/usb_link.c \ 557c478bd9Sstevel@tonic-gate $(COMMON)/port_link.c \ 567c478bd9Sstevel@tonic-gate $(COMMON)/audio_link.c \ 577c478bd9Sstevel@tonic-gate $(COMMON)/cfg_link.c \ 587c478bd9Sstevel@tonic-gate $(COMMON)/misc_link.c \ 597c478bd9Sstevel@tonic-gate $(COMMON)/lofi_link.c \ 607c478bd9Sstevel@tonic-gate $(COMMON)/ramdisk_link.c \ 617c478bd9Sstevel@tonic-gate $(COMMON)/fssnap_link.c \ 627c478bd9Sstevel@tonic-gate $(COMMON)/sgen_link.c \ 637c478bd9Sstevel@tonic-gate $(COMMON)/md_link.c \ 647c478bd9Sstevel@tonic-gate $(COMMON)/dtrace_link.c \ 657c478bd9Sstevel@tonic-gate $(MISC_LINK_ISA).c 667c478bd9Sstevel@tonic-gate 677c478bd9Sstevel@tonic-gateLINT_MODULES = $(LINK_SRCS:.c=.ln) 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gateLINK_OBJS = \ 707c478bd9Sstevel@tonic-gate disk_link.o \ 717c478bd9Sstevel@tonic-gate ieee1394_link.o \ 72*8eea8e29Sap25164 dcam1394_link.o \ 737c478bd9Sstevel@tonic-gate tape_link.o \ 747c478bd9Sstevel@tonic-gate usb_link.o \ 757c478bd9Sstevel@tonic-gate port_link.o \ 767c478bd9Sstevel@tonic-gate audio_link.o \ 777c478bd9Sstevel@tonic-gate cfg_link.o \ 787c478bd9Sstevel@tonic-gate misc_link.o \ 797c478bd9Sstevel@tonic-gate lofi_link.o \ 807c478bd9Sstevel@tonic-gate ramdisk_link.o \ 817c478bd9Sstevel@tonic-gate fssnap_link.o \ 827c478bd9Sstevel@tonic-gate sgen_link.o \ 837c478bd9Sstevel@tonic-gate md_link.o \ 847c478bd9Sstevel@tonic-gate dtrace_link.o \ 857c478bd9Sstevel@tonic-gate $(MISC_LINK_ISA).o 867c478bd9Sstevel@tonic-gate 877c478bd9Sstevel@tonic-gateLINK_MODS = \ 887c478bd9Sstevel@tonic-gate SUNW_disk_link.so \ 897c478bd9Sstevel@tonic-gate SUNW_ieee1394_link.so \ 90*8eea8e29Sap25164 SUNW_dcam1394_link.so \ 917c478bd9Sstevel@tonic-gate SUNW_tape_link.so \ 927c478bd9Sstevel@tonic-gate SUNW_usb_link.so \ 937c478bd9Sstevel@tonic-gate SUNW_port_link.so \ 947c478bd9Sstevel@tonic-gate SUNW_audio_link.so \ 957c478bd9Sstevel@tonic-gate SUNW_cfg_link.so \ 967c478bd9Sstevel@tonic-gate SUNW_misc_link.so \ 977c478bd9Sstevel@tonic-gate SUNW_lofi_link.so \ 987c478bd9Sstevel@tonic-gate SUNW_ramdisk_link.so \ 997c478bd9Sstevel@tonic-gate SUNW_fssnap_link.so \ 1007c478bd9Sstevel@tonic-gate SUNW_sgen_link.so \ 1017c478bd9Sstevel@tonic-gate SUNW_md_link.so \ 1027c478bd9Sstevel@tonic-gate SUNW_dtrace_link.so \ 1037c478bd9Sstevel@tonic-gate SUNW_$(MISC_LINK_ISA).so 1047c478bd9Sstevel@tonic-gate 1057c478bd9Sstevel@tonic-gateDEVLINKTAB = devlink.tab 1067c478bd9Sstevel@tonic-gateDEVLINKTAB_SRC = $(COMMON)/$(DEVLINKTAB).sh 1077c478bd9Sstevel@tonic-gate 1087c478bd9Sstevel@tonic-gateDEVFSADM_DEFAULT = devfsadm 1097c478bd9Sstevel@tonic-gateDEVFSADM_DEFAULT_SRC = $(COMMON)/devfsadm.dfl 1107c478bd9Sstevel@tonic-gate 1117c478bd9Sstevel@tonic-gateCOMPAT_LINKS = disks tapes ports audlinks devlinks drvconfig 1127c478bd9Sstevel@tonic-gate 1137c478bd9Sstevel@tonic-gateCPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \ 1147c478bd9Sstevel@tonic-gate -I.. -I../../../uts/common -I$(MODLOADDIR) 1157c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) $(C_PICFLAGS) -I.. -I$(MODLOADDIR) 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gateLINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2 1187c478bd9Sstevel@tonic-gateLINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2 1197c478bd9Sstevel@tonic-gateLINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2 1207c478bd9Sstevel@tonic-gate 1217c478bd9Sstevel@tonic-gateLAZYLIBS = -z lazyload -lzonecfg -z nolazyload 1227c478bd9Sstevel@tonic-gatelint := LAZYLIBS = -lzonecfg 1237c478bd9Sstevel@tonic-gateLDLIBS += -ldevinfo -lgen -lsysevent -lnvpair -lcmd $(LAZYLIBS) 1247c478bd9Sstevel@tonic-gate 1257c478bd9Sstevel@tonic-gateSRCS = $(DEVFSADM_SRC) $(LINK_SRCS) 1267c478bd9Sstevel@tonic-gateOBJS = $(DEVFSADM_OBJ) $(LINK_OBJS) 1277c478bd9Sstevel@tonic-gateMODS = $(DEVFSADM_MOD) $(LINK_MODS) 1287c478bd9Sstevel@tonic-gate 1297c478bd9Sstevel@tonic-gatePOFILES = $(LINK_SRCS:.c=.po) $(DEVFSADM_SRC:.c=.po) 1307c478bd9Sstevel@tonic-gatePOFILE = pdevfsadm.po 1317c478bd9Sstevel@tonic-gate 1327c478bd9Sstevel@tonic-gate# install specifics 1337c478bd9Sstevel@tonic-gate 1347c478bd9Sstevel@tonic-gateROOTLIB_DEVFSADM = $(ROOTLIB)/$(DEVFSADM_DIR) 1357c478bd9Sstevel@tonic-gateROOTLIB_DEVFSADM_LINKMOD = $(ROOTLIB_DEVFSADM)/$(LINKMOD_DIR) 1367c478bd9Sstevel@tonic-gate 1377c478bd9Sstevel@tonic-gateETCDEFAULT = $(ROOTETC)/default 1387c478bd9Sstevel@tonic-gateETCDEFAULT_DEVFSADM = $(DEVFSADM_DEFAULT:%=$(ETCDEFAULT)/%) 1397c478bd9Sstevel@tonic-gate 1407c478bd9Sstevel@tonic-gateROOTLIB_DEVFSADM_LINK_MODS = $(LINK_MODS:%=$(ROOTLIB_DEVFSADM_LINKMOD)/%) 1417c478bd9Sstevel@tonic-gate 1427c478bd9Sstevel@tonic-gateROOTUSRSBIN_COMPAT_LINKS = $(COMPAT_LINKS:%=$(ROOTUSRSBIN)/%) 1437c478bd9Sstevel@tonic-gate 1447c478bd9Sstevel@tonic-gateROOTUSRSBIN_DEVFSADM = $(DEVFSADM_MOD:%=$(ROOTUSRSBIN)/%) 1457c478bd9Sstevel@tonic-gate 1467c478bd9Sstevel@tonic-gateROOTLIB_DEVFSADM_DAEMON = $(ROOTLIB_DEVFSADM)/$(DEVFSADM_DAEMON) 1477c478bd9Sstevel@tonic-gate 1487c478bd9Sstevel@tonic-gateROOTETC_DEVLINKTAB = $(DEVLINKTAB:%=$(ROOTETC)/%) 1497c478bd9Sstevel@tonic-gate 1507c478bd9Sstevel@tonic-gateOWNER= root 1517c478bd9Sstevel@tonic-gateGROUP= sys 1527c478bd9Sstevel@tonic-gateFILEMODE= 755 1537c478bd9Sstevel@tonic-gate 1547c478bd9Sstevel@tonic-gate$(ROOTETC_DEVLINKTAB) := FILEMODE = 644 1557c478bd9Sstevel@tonic-gate 1567c478bd9Sstevel@tonic-gate$(ETCDEFAULT_DEVFSADM) := FILEMODE = 444 1577c478bd9Sstevel@tonic-gate 1587c478bd9Sstevel@tonic-gateall := TARGET= all 1597c478bd9Sstevel@tonic-gateinstall := TARGET= install 1607c478bd9Sstevel@tonic-gateclean := TARGET= clean 1617c478bd9Sstevel@tonic-gateclobber := TARGET= clobber 1627c478bd9Sstevel@tonic-gatelint := TARGET= lint 1637c478bd9Sstevel@tonic-gate 1647c478bd9Sstevel@tonic-gate 1657c478bd9Sstevel@tonic-gate.KEEP_STATE: 1667c478bd9Sstevel@tonic-gate 1677c478bd9Sstevel@tonic-gateall: $(MODS) $(DEVLINKTAB) 1687c478bd9Sstevel@tonic-gate 1697c478bd9Sstevel@tonic-gateinstall: all \ 1707c478bd9Sstevel@tonic-gate $(ROOTLIB_DEVFSADM) \ 1717c478bd9Sstevel@tonic-gate $(ROOTLIB_DEVFSADM_LINKMOD) \ 1727c478bd9Sstevel@tonic-gate $(ROOTUSRSBIN_DEVFSADM) \ 1737c478bd9Sstevel@tonic-gate $(ROOTETC_DEVLINKTAB) \ 1747c478bd9Sstevel@tonic-gate $(ROOTLIB_DEVFSADM_LINK_MODS) \ 1757c478bd9Sstevel@tonic-gate $(ROOTUSRINCLUDE) \ 1767c478bd9Sstevel@tonic-gate $(ROOTLIB_DEVFSADM_DAEMON) \ 1777c478bd9Sstevel@tonic-gate $(ETCDEFAULT) \ 1787c478bd9Sstevel@tonic-gate $(ETCDEFAULT_DEVFSADM) \ 1797c478bd9Sstevel@tonic-gate $(ROOTUSRSBIN_COMPAT_LINKS) 1807c478bd9Sstevel@tonic-gate 1817c478bd9Sstevel@tonic-gate 1827c478bd9Sstevel@tonic-gateclean: 1837c478bd9Sstevel@tonic-gate $(RM) $(OBJS) 1847c478bd9Sstevel@tonic-gate 1857c478bd9Sstevel@tonic-gate 1867c478bd9Sstevel@tonic-gatelint: $(DEVFSADM_MOD).ln $(LINT_MODULES) 1877c478bd9Sstevel@tonic-gate 1887c478bd9Sstevel@tonic-gatedevfsadm.ln: FRC 1897c478bd9Sstevel@tonic-gate $(LINT.c) $(DEVFSADM_SRC) $(LDLIBS) 1907c478bd9Sstevel@tonic-gate 1917c478bd9Sstevel@tonic-gate%.ln: FRC 1927c478bd9Sstevel@tonic-gate $(LINT.c) $(DEVFSADM_SRC) $(@:.ln=.c) $(LDLIBS) 1937c478bd9Sstevel@tonic-gate 1947c478bd9Sstevel@tonic-gateFRC: 1957c478bd9Sstevel@tonic-gate 1967c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ 1977c478bd9Sstevel@tonic-gate 1987c478bd9Sstevel@tonic-gate$(POFILE): $(POFILES) 1997c478bd9Sstevel@tonic-gate $(RM) $@; cat $(POFILES) > $@ 2007c478bd9Sstevel@tonic-gate 2017c478bd9Sstevel@tonic-gate$(DEVFSADM_MOD): $(DEVFSADM_OBJ) 2027c478bd9Sstevel@tonic-gate $(LINK.c) -o $@ $< $(DEVFSADM_OBJ) $(LDLIBS) 2037c478bd9Sstevel@tonic-gate $(POST_PROCESS) 2047c478bd9Sstevel@tonic-gate 2057c478bd9Sstevel@tonic-gateSUNW_%.so: %.o 2067c478bd9Sstevel@tonic-gate $(LINK.c) -o $@ $(GSHARED) -h $@ $< 2077c478bd9Sstevel@tonic-gate 2087c478bd9Sstevel@tonic-gate%.o: $(COMMON)/%.c 2097c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 2107c478bd9Sstevel@tonic-gate 2117c478bd9Sstevel@tonic-gate 2127c478bd9Sstevel@tonic-gate$(DEVLINKTAB): $(DEVLINKTAB_SRC) 2137c478bd9Sstevel@tonic-gate $(RM) $(DEVLINKTAB) 2147c478bd9Sstevel@tonic-gate /bin/sh $(DEVLINKTAB_SRC) > $(DEVLINKTAB) 2157c478bd9Sstevel@tonic-gate 2167c478bd9Sstevel@tonic-gate$(ETCDEFAULT)/%: % 2177c478bd9Sstevel@tonic-gate $(RM) -r default 2187c478bd9Sstevel@tonic-gate mkdir default 2197c478bd9Sstevel@tonic-gate cp $(DEVFSADM_DEFAULT_SRC) default/$(DEVFSADM_DEFAULT) 2207c478bd9Sstevel@tonic-gate cd default ; $(INS.file) 2217c478bd9Sstevel@tonic-gate $(RM) -r default 2227c478bd9Sstevel@tonic-gate 2237c478bd9Sstevel@tonic-gate$(ETCDEFAULT): 2247c478bd9Sstevel@tonic-gate $(INS.dir) 2257c478bd9Sstevel@tonic-gate 2267c478bd9Sstevel@tonic-gate$(ROOTUSRSBIN): 2277c478bd9Sstevel@tonic-gate $(INS.dir) 2287c478bd9Sstevel@tonic-gate 2297c478bd9Sstevel@tonic-gate$(ROOTLIB_DEVFSADM): 2307c478bd9Sstevel@tonic-gate $(INS.dir) 2317c478bd9Sstevel@tonic-gate 2327c478bd9Sstevel@tonic-gate$(ROOTUSRINCLUDE): 2337c478bd9Sstevel@tonic-gate $(INS.dir) 2347c478bd9Sstevel@tonic-gate 2357c478bd9Sstevel@tonic-gate$(ROOTLIB_DEVFSADM_LINKMOD): 2367c478bd9Sstevel@tonic-gate $(INS.dir) 2377c478bd9Sstevel@tonic-gate 2387c478bd9Sstevel@tonic-gate$(ROOTLIB_DEVFSADM_LINKMOD)/%: % 2397c478bd9Sstevel@tonic-gate $(INS.file) 2407c478bd9Sstevel@tonic-gate 2417c478bd9Sstevel@tonic-gate$(ROOTLIB_DEVFSADM_DAEMON): 2427c478bd9Sstevel@tonic-gate $(RM) $@; $(SYMLINK) ../../sbin/$(DEVFSADM_DIR) $@ 2437c478bd9Sstevel@tonic-gate 2447c478bd9Sstevel@tonic-gate$(ROOTUSRSBIN_COMPAT_LINKS): $(ROOTUSRSBIN_DEVFSADM) 2457c478bd9Sstevel@tonic-gate $(RM) $@ ; $(LN) $(ROOTUSRSBIN_DEVFSADM) $@ 2467c478bd9Sstevel@tonic-gate 2477c478bd9Sstevel@tonic-gate# 2487c478bd9Sstevel@tonic-gate# Source shared with add_drv/update_drv 2497c478bd9Sstevel@tonic-gate# 2507c478bd9Sstevel@tonic-gate../plcysubr.c: 2517c478bd9Sstevel@tonic-gate rm -f $@ 2527c478bd9Sstevel@tonic-gate ln -s ../modload/plcysubr.c .. 253