xref: /titanic_41/usr/src/lib/cfgadm_plugins/sbd/Makefile.com (revision 8eea8e29cc4374d1ee24c25a07f45af132db3499)
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# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# lib/sbd/Makefile.com
29#
30
31PLATFORM=	sun4u
32LIBRARY= sbd.a
33VERS= .1
34
35OBJECTS= ap.o ap_msg.o ap_rcm.o ap_sbd.o ap_seq.o cfga.o ap_err.o
36
37# include library definitions
38include ../../../Makefile.lib
39
40INS.dir.root.sys=	$(INS) -s -d -m $(DIRMODE) $@
41$(CH)INS.dir.root.sys=	$(INS) -s -d -m $(DIRMODE) -u root -g sys $@
42INS.dir.root.bin=	$(INS) -s -d -m $(DIRMODE) $@
43$(CH)INS.dir.root.bin=	$(INS) -s -d -m $(DIRMODE) -u root -g bin $@
44
45USR_PLAT_DIR		= $(ROOT)/usr/platform
46USR_PSM_DIR		= $(USR_PLAT_DIR)/sun4u
47USR_PSM_LIB_DIR		= $(USR_PSM_DIR)/lib
48USR_PSM_LIB_CFG_DIR	= $(USR_PSM_LIB_DIR)/cfgadm
49USR_PSM_LIB_CFG_DIR_64	= $(USR_PSM_LIB_CFG_DIR)/$(MACH64)
50
51ROOTLIBDIR=     $(USR_PSM_LIB_CFG_DIR)
52ROOTLIBDIR64=   $(USR_PSM_LIB_CFG_DIR_64)
53
54MAPFILE=	../common/mapfile-vers
55SRCS=		$(OBJECTS:%.o=../common/%.c)
56
57LIBS = $(DYNLIB)
58
59CFLAGS +=	$(CCVERBOSE)
60DYNFLAGS +=	-M $(MAPFILE)
61LDLIBS +=	-lc -lkstat -lnvpair
62
63CPPFLAGS +=	-I$(ROOT)/usr/platform/$(PLATFORM)/include -DSBD_DEBUG
64#
65#	Generate the error messages form sbd_ioctl.h
66#
67GENERRDIR=	$(SRC)/lib/cfgadm_plugins/sbd
68GENERR=		$(GENERRDIR)/sbdgenerr
69ERRSRC=		$(ROOT)/usr/platform/sun4u/include/sys/sbd_ioctl.h
70
71.KEEP_STATE:
72
73all: $(LIBS)
74
75lint:   lintcheck
76
77$(DYNLIB):	$(MAPFILE)
78
79# Create target directories
80$(USR_PSM_DIR):
81	-$(INS.dir.root.sys)
82
83$(USR_PSM_LIB_DIR):	$(USR_PSM_DIR)
84	-$(INS.dir.root.bin)
85
86$(USR_PSM_LIB_CFG_DIR):	$(USR_PSM_LIB_DIR)
87	-$(INS.dir.root.bin)
88
89$(USR_PSM_LIB_CFG_DIR_64):	$(USR_PSM_LIB_CFG_DIR)
90	-$(INS.dir.root.bin)
91
92$(USR_PSM_LIB_CFG_DIR)/%: % $(USR_PSM_LIB_CFG_DIR)
93	-$(INS.file)
94
95$(USR_PSM_LIB_CFG_DIR_64)/%: % $(USR_PSM_LIB_CFG_DIR_64)
96	-$(INS.file)
97
98# include library targets
99include ../../../Makefile.targ
100
101pics/%.o: ../common/%.c
102	$(COMPILE.c) -o $@ $<
103	$(POST_PROCESS_O)
104
105../common/ap_err.c: sbdgenerr $(ERRSRC)
106	$(GENERRDIR)/sbdgenerr < $(ERRSRC) > ../common/ap_err.c
107
108sbdgenerr: $(GENERRDIR)/sbdgenerr.pl
109	$(RM) $(GENERRDIR)/sbdgenerr
110	cat $(GENERRDIR)/sbdgenerr.pl > $(GENERRDIR)/sbdgenerr
111	$(CHMOD) +x $(GENERRDIR)/sbdgenerr
112