xref: /illumos-gate/usr/src/cmd/picl/plugins/sun4u/mpxu/frudr/Makefile (revision 69a119caa6570c7077699161b7c28b6ee9f8b0f4)
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 (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
26include	$(SRC)/Makefile.psm
27
28LIBRARY =	libpiclfrudr.a
29VERS =		.1
30
31OBJECTS =	piclfrudr.o
32
33# include library definitions
34include $(SRC)/lib/Makefile.lib
35
36ROOT_PLATFORM = $(USR_PLAT_DIR)/SUNW,Sun-Fire-V240
37
38include	$(SRC)/cmd/picl/plugins/Makefile.com
39
40SRCS =		$(OBJECTS:%.o=%.c)
41
42LIBS =		$(DYNLIB)
43
44ROOTLIBDIR	= $(ROOT_PLAT_PLUGINDIR)
45
46PLAT_PLATFORM = $(USR_PLAT_DIR)/SUNW,Sun-Fire-V440
47
48PLAT_LIB_DIR = $(PLAT_PLATFORM:%=%/lib)
49
50PLAT_PICL_DIR = $(PLAT_LIB_DIR:%=%/picl)
51
52PLAT_PLUGINS_DIRS = $(PLAT_PICL_DIR:%=%/plugins)
53
54USR_PLAT_PLUGINS_DYNLIBS = $(PLAT_PLUGINS_DIRS:%=%/$(DYNLIB))
55USR_PLAT_PLUGINS_LIBLINKS = $(PLAT_PLUGINS_DIRS:%=%/$(LIBLINKS))
56MPXU_DYNLIB_DIR = ../../../../SUNW,Sun-Fire-V240/lib/picl/plugins
57
58CONFS		= fru_PS0.conf fru_PS1.conf
59CONFS		+= fru_HDD0.conf fru_HDD1.conf fru_HDD2.conf
60CONFS		+= fru_HDD3.conf
61CONFS		+= fru_SC.conf
62CONFS		+= fru_usb-a-1.conf fru_usb-a-2.conf
63ROOTCONF=	$(CONFS:%=$(ROOTLIBDIR)/%)
64$(ROOTCONF)	:= FILEMODE = 0644
65MAININFO=	$(CONFS:%.conf=%.info)
66OTHERINFOS	= fru_PS0_data.info fru_PS1_data.info
67OTHERINFOS	+= fru_HDD0_data.info fru_HDD1_data.info
68OTHERINFOS	+= fru_HDD2_data.info fru_HDD3_data.info
69OTHERINFOS	+= fru_SC_data.info SB-tables.info
70OTHERINFOS	+= fru_usb-a-1_data.info fru_usb-a-2_data.info
71
72LINTSRC =	$(LINTLIB:%.ln=%)
73ROOTLINTDIR =	$(ROOTLIBDIR)
74ROOTLINT =	$(LINTSRC:%=$(ROOTLINTDIR)/%)
75
76CLEANFILES =	$(LINTOUT) $(LINTLIB)
77
78CPPFLAGS +=	-D_REENTRANT
79CPPFLAGS +=	-I$(SRC)/cmd/picl/plugins/lib/picld_pluginutil
80CPPFLAGS +=	-I$(SRC)/uts/sun4u/mpxu
81CPPFLAGS +=	-I$(SRC)/uts/sun4u/ -I$(SRC)/uts/common/
82CPPFLAGS +=	-I$(SRC)/uts/sun4u/sys/i2c/clients
83
84CFLAGS +=	$(CCVERBOSE)
85
86DYNFLAGS +=	-R/usr/platform/\$$PLATFORM/lib/picl/plugins
87DYNFLAGS +=	-R/usr/platform/sun4u/lib/picl/plugins:/usr/lib/picl/plugins
88LDLIBS +=	-L$(SRC)/cmd/picl/plugins/lib/picld_pluginutil/$(MACH)
89LDLIBS +=	-L$(DEVTREE_SRC_DIR)
90LDLIBS +=	-L$(SRC)/lib/libpicltree/$(MACH)
91LDLIBS +=	-L$(SRC)/cmd/picl/plugins/common/memcfg
92LDLIBS +=	-L$(SRC)/cmd/picl/plugins/common/devtree
93LDLIBS +=	-L$(SRC)/cmd/picl/plugins/common/piclevent
94LDLIBS +=	-L$(SRC)/cmd/picl/plugins/sun4u/envmon
95LDLIBS +=	-L$(SRC)/cmd/picl/plugins/common/frutree
96LDLIBS +=	-L$(ROOT)/usr/lib/picl/plugins
97LDLIBS +=	-lc -ldevinfo -ldevice
98LDLIBS +=	-lpicltree -lpicld_pluginutil -lnvpair -lkstat
99LDLIBS +=	-lpiclevent -lpiclenvmon -lpiclfrutree
100
101.KEEP_STATE:
102
103SUBDIRS =
104
105POFILE = piclfrudr.po
106
107all :=		TARGET= all
108install :=	TARGET= install
109clean :=	TARGET= clean
110clobber :=	TARGET= clobber
111lint :=		TARGET= lint
112_msg :=		TARGET= _msg
113
114all: $(LIBS) $(LIBLINKS) $(CONFS)
115
116install:	$(ROOTLIBDIR) all $(ROOTLIBS) $(ROOTLINKS) $(ROOTCONF) \
117		$(PLAT_PLATFORM) $(PLAT_LIB_DIR) $(PLAT_PICL_DIR) \
118		$(USR_PLAT_PLUGINS_DYNLIBS) $(USR_PLAT_PLUGINS_LIBLINKS)
119
120$(CONFS): $(MAININFO) $(OTHERINFOS)
121	@$(RM) -f $@
122	@echo "# Copyright 2003 Sun Microsystems, Inc. " \
123	"All rights reserved." > $@
124	@echo "# This is a generated file. #ident lines identify sources" >> $@
125	$(CPP) -P $(@:%.conf=%.info) | \
126	$(SED) -e '/^[  ]*$$/d' >> $@
127	@$(CHMOD) 644 $@
128
129_msg:	$(MSGDOMAIN) $(POFILE)
130	$(RM) $(MSGDOMAIN)/$(POFILE)
131	$(CP) $(POFILE) $(MSGDOMAIN)/mpxu_$(POFILE)
132
133$(MSGDOMAIN):
134	$(INS.dir)
135
136$(LIBLINKS):	FRC
137	$(RM) $@; $(SYMLINK) $(DYNLIB) $@
138
139# include library targets
140include $(SRC)/lib/Makefile.targ
141include	$(SRC)/cmd/picl/plugins/Makefile.targ
142
143$(ROOT_PLAT_PLUGINDIR)/%: % $(ROOT_PLAT_PLUGINDIR)
144	$(INS.file) ;\
145	$(RM) -r $(ROOT_PLAT_PLUGINDIR)/$(LIBLINKS) ;\
146	$(SYMLINK) ./$(DYNLIB) $(ROOT_PLAT_PLUGINDIR)/$(LIBLINKS)
147
148$(PLAT_PLATFORM):
149	$(INS.dir)
150$(PLAT_LIB_DIR):
151	$(INS.dir)
152$(PLAT_PICL_DIR):
153	$(INS.dir)
154
155$(PLAT_PLUGINS_DIRS):
156	$(INS.dir)
157
158$(USR_PLAT_PLUGINS_DYNLIBS): $(PLAT_PLUGINS_DIRS)
159	$(RM) -r $@ ;\
160	$(SYMLINK) $(MPXU_DYNLIB_DIR)/$(DYNLIB) $@
161
162$(USR_PLAT_PLUGINS_LIBLINKS): $(PLAT_PLUGINS_DIRS)
163	$(RM) -r $@ ;\
164	$(SYMLINK) $(MPXU_DYNLIB_DIR)/$(DYNLIB) $@
165
166$(ROOTLINTDIR)/%: ../%
167	$(INS.file)
168
169lint:
170	$(LINT.c) $(SRCS)
171
172$(SUBDIRS): FRC
173	@cd $@; pwd; $(MAKE) $(TARGET)
174
175FRC:
176