Merge commit 'f864f99efe57685e1762590c1a880dd16bca6da9' into merges
[unleashed.git] / usr / src / cmd / modload / Makefile.com
blob6e862e101746d8bf10755427ae4fd40f4e11d543
2 # CDDL HEADER START
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]
19 # CDDL HEADER END
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)
38 PLCYOBJ = plcysubr.o
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
56 # install specifics
58 $(ROOTDRVPROG) := FILEMODE = 0555
60 add_drv                 := LDLIBS += -ldevinfo -lelf
61 rem_drv                 := LDLIBS += -ldevinfo
62 update_drv              := LDLIBS += -ldevinfo
64 .KEEP_STATE:
66 %.o:    ../%.c
67         $(COMPILE.c) $<
69 all: $(PROG)
71 add_drv:        add_drv.o $(DRVCOMMONOBJ)
72         $(LINK.c)  -o $@ add_drv.o $(DRVCOMMONOBJ) $(LDLIBS)
73         $(POST_PROCESS)
75 rem_drv:        rem_drv.o $(DRVCOMMONOBJ)
76         $(LINK.c)  -o $@ rem_drv.o $(DRVCOMMONOBJ) $(LDLIBS)
77         $(POST_PROCESS)
79 update_drv:     update_drv.o $(DRVCOMMONOBJ)
80         $(LINK.c)  -o $@ update_drv.o $(DRVCOMMONOBJ) $(LDLIBS)
81         $(POST_PROCESS)
83 modload:        modload.o $(MODCOMMONOBJ)
84          $(LINK.c)  -o $@ modload.o $(MODCOMMONOBJ) $(LDLIBS)
85         $(POST_PROCESS)
87 modunload:      modunload.o $(MODCOMMONOBJ)
88          $(LINK.c)  -o $@ modunload.o $(MODCOMMONOBJ) $(LDLIBS)
89         $(POST_PROCESS)
91 modinfo:        modinfo.o $(MODCOMMONOBJ)
92          $(LINK.c)  -o $@ modinfo.o $(MODCOMMONOBJ) $(LDLIBS)
93         $(POST_PROCESS)
95 clean:
96         $(RM) $(OBJECTS)
98 include ../../Makefile.targ