xref: /illumos-gate/usr/src/cmd/picl/plugins/sun4u/mpxu/frudr/Makefile (revision 069e6b7e31ba5dcbc5441b98af272714d9a5455c)
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 -lkstat
93LDLIBS +=	-lpiclevent -lpiclenvmon -lpiclfrutree
94
95.KEEP_STATE:
96
97SUBDIRS =
98
99POFILE = piclfrudr.po
100
101all :=		TARGET= all
102install :=	TARGET= install
103clean :=	TARGET= clean
104clobber :=	TARGET= clobber
105_msg :=		TARGET= _msg
106
107all: $(LIBS) $(LIBLINKS) $(CONFS)
108
109install:	$(ROOTLIBDIR) all $(ROOTLIBS) $(ROOTLINKS) $(ROOTCONF) \
110		$(PLAT_PLATFORM) $(PLAT_LIB_DIR) $(PLAT_PICL_DIR) \
111		$(USR_PLAT_PLUGINS_DYNLIBS) $(USR_PLAT_PLUGINS_LIBLINKS)
112
113$(CONFS): $(MAININFO) $(OTHERINFOS)
114	@$(RM) -f $@
115	@echo "# Copyright 2003 Sun Microsystems, Inc. " \
116	"All rights reserved." > $@
117	@echo "# This is a generated file. #ident lines identify sources" >> $@
118	$(CPP) -P $(@:%.conf=%.info) | \
119	$(SED) -e '/^[  ]*$$/d' >> $@
120	@$(CHMOD) 644 $@
121
122_msg:	$(MSGDOMAIN) $(POFILE)
123	$(RM) $(MSGDOMAIN)/$(POFILE)
124	$(CP) $(POFILE) $(MSGDOMAIN)/mpxu_$(POFILE)
125
126$(MSGDOMAIN):
127	$(INS.dir)
128
129$(LIBLINKS):	FRC
130	$(RM) $@; $(SYMLINK) $(DYNLIB) $@
131
132# include library targets
133include $(SRC)/lib/Makefile.targ
134include	$(SRC)/cmd/picl/plugins/Makefile.targ
135
136$(ROOT_PLAT_PLUGINDIR)/%: % $(ROOT_PLAT_PLUGINDIR)
137	$(INS.file) ;\
138	$(RM) -r $(ROOT_PLAT_PLUGINDIR)/$(LIBLINKS) ;\
139	$(SYMLINK) ./$(DYNLIB) $(ROOT_PLAT_PLUGINDIR)/$(LIBLINKS)
140
141$(PLAT_PLATFORM):
142	$(INS.dir)
143$(PLAT_LIB_DIR):
144	$(INS.dir)
145$(PLAT_PICL_DIR):
146	$(INS.dir)
147
148$(PLAT_PLUGINS_DIRS):
149	$(INS.dir)
150
151$(USR_PLAT_PLUGINS_DYNLIBS): $(PLAT_PLUGINS_DIRS)
152	$(RM) -r $@ ;\
153	$(SYMLINK) $(MPXU_DYNLIB_DIR)/$(DYNLIB) $@
154
155$(USR_PLAT_PLUGINS_LIBLINKS): $(PLAT_PLUGINS_DIRS)
156	$(RM) -r $@ ;\
157	$(SYMLINK) $(MPXU_DYNLIB_DIR)/$(DYNLIB) $@
158
159lint:
160
161$(SUBDIRS): FRC
162	@cd $@; pwd; $(MAKE) $(TARGET)
163
164FRC:
165