Merge illumos-gate
[unleashed/lotheac.git] / usr / src / cmd / modload / Makefile.com
blob9b5f980e5d3c18eba777ee8eccc1a0b71b498b08
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 # Copyright (c) 2018, Joyent, Inc.
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 # not linted
57 SMATCH=off
59 # install specifics
61 $(ROOTDRVPROG) := FILEMODE = 0555
63 add_drv                 := LDLIBS += -ldevinfo -lelf
64 rem_drv                 := LDLIBS += -ldevinfo
65 update_drv              := LDLIBS += -ldevinfo
67 .KEEP_STATE:
69 %.o:    ../%.c
70         $(COMPILE.c) $<
72 all: $(PROG)
74 add_drv:        add_drv.o $(DRVCOMMONOBJ)
75         $(LINK.c)  -o $@ add_drv.o $(DRVCOMMONOBJ) $(LDLIBS)
76         $(POST_PROCESS)
78 rem_drv:        rem_drv.o $(DRVCOMMONOBJ)
79         $(LINK.c)  -o $@ rem_drv.o $(DRVCOMMONOBJ) $(LDLIBS)
80         $(POST_PROCESS)
82 update_drv:     update_drv.o $(DRVCOMMONOBJ)
83         $(LINK.c)  -o $@ update_drv.o $(DRVCOMMONOBJ) $(LDLIBS)
84         $(POST_PROCESS)
86 modload:        modload.o $(MODCOMMONOBJ)
87          $(LINK.c)  -o $@ modload.o $(MODCOMMONOBJ) $(LDLIBS)
88         $(POST_PROCESS)
90 modunload:      modunload.o $(MODCOMMONOBJ)
91          $(LINK.c)  -o $@ modunload.o $(MODCOMMONOBJ) $(LDLIBS)
92         $(POST_PROCESS)
94 modinfo:        modinfo.o $(MODCOMMONOBJ)
95          $(LINK.c)  -o $@ modinfo.o $(MODCOMMONOBJ) $(LDLIBS)
96         $(POST_PROCESS)
98 clean:
99         $(RM) $(OBJECTS)
101 include ../../Makefile.targ