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 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 #
25 # cmd/modload/Makefile.com
26 #
27 # makefile for loadable module utilities
28
29 DRVPROG = add_drv rem_drv update_drv
30 MODPROG = modinfo modunload modload
31 PROG = $(MODPROG) $(DRVPROG)
32
33 include ../../Makefile.cmd
34
35 MODCOMMONOBJ = modsubr.o
36 MODCOMMONSRC = $(MODCOMMONOBJ:%.o=../%.c)
37
38 PLCYOBJ = plcysubr.o
39 PLCYSRC = $(PLCYOBJ:%.o=../%.c)
40
41 $(PLCYOBJ) := CPPFLAGS += -D_REENTRANT
42
43 ROOTDRVPROG = $(DRVPROG:%=$(ROOTUSRSBIN)/%)
44
45 DRVCOMMONOBJ = drvsubr.o $(PLCYOBJ)
46 DRVCOMMONSRC = $(DRVCOMMONOBJ:%.o=../%.c)
47
48 OBJECTS = $(MODCOMMONOBJ) $(DRVCOMMONOBJ) $(PROG:%=%.o)
49 SRCS = $(OBJECTS:%.o=../%.c)
50
51 COMMONSRC = $(DRVCOMMONSRC) $(MODCOMMONSRC)
52
53 CLOBBERFILES = $(PROG)
54
55 # lint is complicated here by the fact that we
56 # build multiple commands and with differing
57 # common source, drvsubr vs modsubr/plcysubr
58 #
59 LINT_PROG= $(PROG:%=lint_%.c)
60 LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2
61
62 CERRWARN += -_gcc=-Wno-parentheses
63
64 # install specifics
65
66 $(ROOTDRVPROG) := FILEMODE = 0555
67
68 add_drv := LDLIBS += -ldevinfo -lelf
69 rem_drv := LDLIBS += -ldevinfo
70 update_drv := LDLIBS += -ldevinfo
71
72 lint_add_drv.c := LDLIBS += -ldevinfo -lelf
73 lint_rem_drv.c := LDLIBS += -ldevinfo
74 lint_update_drv.c := LDLIBS += -ldevinfo
75
76 .KEEP_STATE:
77
78 %.o: ../%.c
79 $(COMPILE.c) $<
80
81 all: $(PROG)
82
83 add_drv: add_drv.o $(DRVCOMMONOBJ)
|
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 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 #
25 # Copyright (c) 2018, Joyent, Inc.
26 #
27 # makefile for loadable module utilities
28
29 DRVPROG = add_drv rem_drv update_drv
30 MODPROG = modinfo modunload modload
31 PROG = $(MODPROG) $(DRVPROG)
32
33 include ../../Makefile.cmd
34
35 MODCOMMONOBJ = modsubr.o
36 MODCOMMONSRC = $(MODCOMMONOBJ:%.o=../%.c)
37
38 PLCYOBJ = plcysubr.o
39 PLCYSRC = $(PLCYOBJ:%.o=../%.c)
40
41 $(PLCYOBJ) := CPPFLAGS += -D_REENTRANT
42
43 ROOTDRVPROG = $(DRVPROG:%=$(ROOTUSRSBIN)/%)
44
45 DRVCOMMONOBJ = drvsubr.o $(PLCYOBJ)
46 DRVCOMMONSRC = $(DRVCOMMONOBJ:%.o=../%.c)
47
48 OBJECTS = $(MODCOMMONOBJ) $(DRVCOMMONOBJ) $(PROG:%=%.o)
49 SRCS = $(OBJECTS:%.o=../%.c)
50
51 COMMONSRC = $(DRVCOMMONSRC) $(MODCOMMONSRC)
52
53 CLOBBERFILES = $(PROG)
54
55 # lint is complicated here by the fact that we
56 # build multiple commands and with differing
57 # common source, drvsubr vs modsubr/plcysubr
58 #
59 LINT_PROG= $(PROG:%=lint_%.c)
60 LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2
61
62 CERRWARN += -_gcc=-Wno-parentheses
63
64 # not linted
65 SMATCH=off
66
67 # install specifics
68
69 $(ROOTDRVPROG) := FILEMODE = 0555
70
71 add_drv := LDLIBS += -ldevinfo -lelf
72 rem_drv := LDLIBS += -ldevinfo
73 update_drv := LDLIBS += -ldevinfo
74
75 lint_add_drv.c := LDLIBS += -ldevinfo -lelf
76 lint_rem_drv.c := LDLIBS += -ldevinfo
77 lint_update_drv.c := LDLIBS += -ldevinfo
78
79 .KEEP_STATE:
80
81 %.o: ../%.c
82 $(COMPILE.c) $<
83
84 all: $(PROG)
85
86 add_drv: add_drv.o $(DRVCOMMONOBJ)
|