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.
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.
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]
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
25 # cmd/modload/Makefile.com
27 # makefile for loadable module utilities
29 DRVPROG = add_drv rem_drv update_drv
30 MODPROG = modinfo modunload modload
31 PROG = $(MODPROG) $(DRVPROG)
33 include ../../Makefile.cmd
35 MODCOMMONOBJ = modsubr.o
36 MODCOMMONSRC = $(MODCOMMONOBJ:%.o=../%.c)
39 PLCYSRC = $(PLCYOBJ:%.o=../%.c)
42 ROOTDRVPROG = $(DRVPROG:%=$(ROOTUSRSBIN)/%)
44 DRVCOMMONOBJ = drvsubr.o $(PLCYOBJ)
45 DRVCOMMONSRC = $(DRVCOMMONOBJ:%.o=../%.c)
47 OBJECTS = $(MODCOMMONOBJ) $(DRVCOMMONOBJ) $(PROG:%=%.o)
48 SRCS = $(OBJECTS:%.o=../%.c)
50 COMMONSRC = $(DRVCOMMONSRC) $(MODCOMMONSRC)
52 CLOBBERFILES = $(PROG)
54 CERRWARN += -Wno-parentheses
58 $(ROOTDRVPROG) := FILEMODE = 0555
60 add_drv := LDLIBS += -ldevinfo -lelf
61 rem_drv := LDLIBS += -ldevinfo
62 update_drv := LDLIBS += -ldevinfo
71 add_drv: add_drv.o $(DRVCOMMONOBJ)
72 $(LINK.c) -o $@ add_drv.o $(DRVCOMMONOBJ) $(LDLIBS)
75 rem_drv: rem_drv.o $(DRVCOMMONOBJ)
76 $(LINK.c) -o $@ rem_drv.o $(DRVCOMMONOBJ) $(LDLIBS)
79 update_drv: update_drv.o $(DRVCOMMONOBJ)
80 $(LINK.c) -o $@ update_drv.o $(DRVCOMMONOBJ) $(LDLIBS)
83 modload: modload.o $(MODCOMMONOBJ)
84 $(LINK.c) -o $@ modload.o $(MODCOMMONOBJ) $(LDLIBS)
87 modunload: modunload.o $(MODCOMMONOBJ)
88 $(LINK.c) -o $@ modunload.o $(MODCOMMONOBJ) $(LDLIBS)
91 modinfo: modinfo.o $(MODCOMMONOBJ)
92 $(LINK.c) -o $@ modinfo.o $(MODCOMMONOBJ) $(LDLIBS)
98 include ../../Makefile.targ