xref: /titanic_44/usr/src/cmd/modload/Makefile.com (revision b1dd958f54f8bfa984d306bb8ca8264855761d7b)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23#ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28# cmd/modload/Makefile.com
29#
30# makefile for loadable module utilities
31
32DRVPROG = add_drv rem_drv update_drv
33MODPROG = modinfo modunload modload
34PROG = $(MODPROG) $(DRVPROG)
35
36include ../../Makefile.cmd
37
38MODCOMMONOBJ = modsubr.o
39MODCOMMONSRC = $(MODCOMMONOBJ:%.o=../%.c)
40
41PLCYOBJ = plcysubr.o
42PLCYSRC = $(PLCYOBJ:%.o=../%.c)
43
44$(PLCYOBJ) := CPPFLAGS += -D_REENTRANT
45
46ROOTDRVPROG = $(DRVPROG:%=$(ROOTUSRSBIN)/%)
47
48DRVCOMMONOBJ = drvsubr.o $(PLCYOBJ)
49DRVCOMMONSRC = $(DRVCOMMONOBJ:%.o=../%.c)
50
51OBJECTS = $(MODCOMMONOBJ) $(DRVCOMMONOBJ) $(PROG:%=%.o)
52SRCS = $(OBJECTS:%.o=../%.c)
53
54CLOBBERFILES = $(PROG)
55
56# install specifics
57
58$(ROOTDRVPROG) := FILEMODE = 0555
59
60add_drv		:= LDLIBS += -ldevinfo -lelf
61rem_drv		:= LDLIBS += -ldevinfo
62update_drv	:= LDLIBS += -ldevinfo
63
64.KEEP_STATE:
65
66%.o:	../%.c
67	$(COMPILE.c) $<
68
69all: $(PROG)
70
71add_drv:	add_drv.o $(DRVCOMMONOBJ)
72	$(LINK.c)  -o $@ add_drv.o $(DRVCOMMONOBJ) $(LDLIBS)
73	$(POST_PROCESS)
74
75rem_drv:	rem_drv.o $(DRVCOMMONOBJ)
76	$(LINK.c)  -o $@ rem_drv.o $(DRVCOMMONOBJ) $(LDLIBS)
77	$(POST_PROCESS)
78
79update_drv:	update_drv.o $(DRVCOMMONOBJ)
80	$(LINK.c)  -o $@ update_drv.o $(DRVCOMMONOBJ) $(LDLIBS)
81	$(POST_PROCESS)
82
83modload:	modload.o $(MODCOMMONOBJ)
84	 $(LINK.c)  -o $@ modload.o $(MODCOMMONOBJ) $(LDLIBS)
85	$(POST_PROCESS)
86
87modunload:	modunload.o $(MODCOMMONOBJ)
88	 $(LINK.c)  -o $@ modunload.o $(MODCOMMONOBJ) $(LDLIBS)
89	$(POST_PROCESS)
90
91modinfo:	modinfo.o $(MODCOMMONOBJ)
92	 $(LINK.c)  -o $@ modinfo.o $(MODCOMMONOBJ) $(LDLIBS)
93	$(POST_PROCESS)
94
95clean:
96	$(RM) $(OBJECTS) core
97
98lint: lint_SRCS
99
100include ../../Makefile.targ
101