xref: /illumos-gate/usr/src/cmd/picl/plugins/sun4u/mpxu/frudr/Makefile (revision 16b76d3cb933ff92018a2a75594449010192eacb)
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
72CPPFLAGS +=	-D_REENTRANT
73CPPFLAGS +=	-I$(SRC)/cmd/picl/plugins/lib/picld_pluginutil
74CPPFLAGS +=	-I$(SRC)/uts/sun4u/mpxu
75CPPFLAGS +=	-I$(SRC)/uts/sun4u/ -I$(SRC)/uts/common/
76CPPFLAGS +=	-I$(SRC)/uts/sun4u/sys/i2c/clients
77
78CFLAGS +=	$(CCVERBOSE)
79
80DYNFLAGS +=	-R/usr/platform/\$$PLATFORM/lib/picl/plugins
81DYNFLAGS +=	-R/usr/platform/sun4u/lib/picl/plugins:/usr/lib/picl/plugins
82LDLIBS +=	-L$(SRC)/cmd/picl/plugins/lib/picld_pluginutil/$(MACH)
83LDLIBS +=	-L$(DEVTREE_SRC_DIR)
84LDLIBS +=	-L$(SRC)/lib/libpicltree/$(MACH)
85LDLIBS +=	-L$(SRC)/cmd/picl/plugins/common/memcfg
86LDLIBS +=	-L$(SRC)/cmd/picl/plugins/common/devtree
87LDLIBS +=	-L$(SRC)/cmd/picl/plugins/common/piclevent
88LDLIBS +=	-L$(SRC)/cmd/picl/plugins/sun4u/envmon
89LDLIBS +=	-L$(SRC)/cmd/picl/plugins/common/frutree
90LDLIBS +=	-L$(ROOT)/usr/lib/picl/plugins
91LDLIBS +=	-lc -ldevinfo -ldevice
92LDLIBS +=	-lpicltree -lpicld_pluginutil -lnvpair
93
94.KEEP_STATE:
95
96SUBDIRS =
97
98POFILE = piclfrudr.po
99
100all :=		TARGET= all
101install :=	TARGET= install
102clean :=	TARGET= clean
103clobber :=	TARGET= clobber
104_msg :=		TARGET= _msg
105
106all: $(LIBS) $(LIBLINKS) $(CONFS)
107
108install:	$(ROOTLIBDIR) all $(ROOTLIBS) $(ROOTLINKS) $(ROOTCONF) \
109		$(PLAT_PLATFORM) $(PLAT_LIB_DIR) $(PLAT_PICL_DIR) \
110		$(USR_PLAT_PLUGINS_DYNLIBS) $(USR_PLAT_PLUGINS_LIBLINKS)
111
112$(CONFS): $(MAININFO) $(OTHERINFOS)
113	@$(RM) -f $@
114	@echo "# Copyright 2003 Sun Microsystems, Inc. " \
115	"All rights reserved." > $@
116	@echo "# This is a generated file. #ident lines identify sources" >> $@
117	$(CPP) -P $(@:%.conf=%.info) | \
118	$(SED) -e '/^[  ]*$$/d' >> $@
119	@$(CHMOD) 644 $@
120
121_msg:	$(MSGDOMAIN) $(POFILE)
122	$(RM) $(MSGDOMAIN)/$(POFILE)
123	$(CP) $(POFILE) $(MSGDOMAIN)/mpxu_$(POFILE)
124
125$(MSGDOMAIN):
126	$(INS.dir)
127
128$(LIBLINKS):	FRC
129	$(RM) $@; $(SYMLINK) $(DYNLIB) $@
130
131# include library targets
132include $(SRC)/lib/Makefile.targ
133include	$(SRC)/cmd/picl/plugins/Makefile.targ
134
135$(ROOT_PLAT_PLUGINDIR)/%: % $(ROOT_PLAT_PLUGINDIR)
136	$(INS.file) ;\
137	$(RM) -r $(ROOT_PLAT_PLUGINDIR)/$(LIBLINKS) ;\
138	$(SYMLINK) ./$(DYNLIB) $(ROOT_PLAT_PLUGINDIR)/$(LIBLINKS)
139
140$(PLAT_PLATFORM):
141	$(INS.dir)
142$(PLAT_LIB_DIR):
143	$(INS.dir)
144$(PLAT_PICL_DIR):
145	$(INS.dir)
146
147$(PLAT_PLUGINS_DIRS):
148	$(INS.dir)
149
150$(USR_PLAT_PLUGINS_DYNLIBS): $(PLAT_PLUGINS_DIRS)
151	$(RM) -r $@ ;\
152	$(SYMLINK) $(MPXU_DYNLIB_DIR)/$(DYNLIB) $@
153
154$(USR_PLAT_PLUGINS_LIBLINKS): $(PLAT_PLUGINS_DIRS)
155	$(RM) -r $@ ;\
156	$(SYMLINK) $(MPXU_DYNLIB_DIR)/$(DYNLIB) $@
157
158lint:
159
160$(SUBDIRS): FRC
161	@cd $@; pwd; $(MAKE) $(TARGET)
162
163FRC:
164