xref: /illumos-gate/usr/src/cmd/picl/plugins/sun4u/psvc/psvcplugin/Makefile (revision 2a6e99a0f1f7d22c0396e8b2ce9b9babbd1056cf)
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# cmd/picl/plugins/sun4u/psvc/psvcplugin/Makefile
26#
27LIBRARY=	libpsvcplugin.a
28VERS=		.1
29
30OBJECTS=	psvcplugin.o
31
32# include library definitions
33include $(SRC)/lib/Makefile.lib
34include $(SRC)/Makefile.psm
35
36include $(SRC)/cmd/picl/plugins/Makefile.com
37
38SRCS=		$(OBJECTS:%.o=%.c)
39
40LIBS =		$(DYNLIB)
41
42ROOT_PLATFORM = $(USR_PLAT_DIR)/SUNW,Sun-Fire-280R
43
44USR_PLAT_PLUGINS_LNECK = $(LIBS:%=$(ROOT_PLAT_PLUGINDIR)/%)
45
46PLAT_PLATFORM = $(USR_PLAT_DIR)/SUNW,Sun-Fire-880
47PLAT_PLATFORM += $(USR_PLAT_DIR)/SUNW,Sun-Fire-480R
48PLAT_PLATFORM += $(USR_PLAT_DIR)/SUNW,Sun-Fire-V490
49PLAT_PLATFORM += $(USR_PLAT_DIR)/SUNW,Sun-Fire-V890
50
51PLAT_LIB_DIR = $(PLAT_PLATFORM:%=%/lib)
52
53PLAT_PICL_DIR = $(PLAT_LIB_DIR:%=%/picl)
54
55PLAT_PLUGINS_DIRS = $(PLAT_PICL_DIR:%=%/plugins)
56
57USR_PLAT_PLUGINS_DYNLIBS = $(PLAT_PLUGINS_DIRS:%=%/$(DYNLIB))
58USR_PLAT_PLUGINS_LIBLINKS = $(PLAT_PLUGINS_DIRS:%=%/$(LIBLINKS))
59LNECK_DYNLIB_DIR = ../../../../SUNW,Sun-Fire-280R/lib/picl/plugins
60
61CLEANFILES=	$(LINTOUT) $(LINTLIB)
62
63CPPFLAGS +=	-I$(SRC)/uts/sun4u
64CPPFLAGS +=	-I$(SRC)/cmd/picl/plugins/sun4u/psvc/psvcobj
65
66CFLAGS +=	$(CCVERBOSE)
67LDLIBS +=	-L$(SRC)/lib/libpicl/$(MACH) -L$(SRC)/lib/libpicltree/$(MACH)
68LDLIBS +=	-L $(ROOT)/usr/platform/$(PLATFORM)/lib
69LDLIBS +=	-L$(SRC)/cmd/picl/plugins/sun4u/psvc/psvcobj
70LDLIBS +=	-R/usr/platform/sun4u/lib
71LDLIBS +=	-lc -lpicltree -lpicl -lpsvcobj
72
73DYNFLAGS +=	-Wl,-f/usr/platform/\$$PLATFORM/lib/$(DYNLIBPSR)
74LINTFLAGS +=
75
76.KEEP_STATE:
77
78SUBDIRS=
79
80POFILE=	psvcplugin.po
81
82all :=		TARGET= all
83install :=	TARGET= install
84clean :=	TARGET= clean
85clobber :=	TARGET= clobber
86lint :=		TARGET= lint
87_msg :=		TARGET= _msg
88
89all: $(LIBS) $(LIBLINKS)
90
91install:	all $(USR_PLAT_PLUGINS_LNECK) \
92	$(PLAT_PLATFORM) $(PLAT_LIB_DIR) $(PLAT_PICL_DIR) \
93	$(USR_PLAT_PLUGINS_DYNLIBS) $(USR_PLAT_PLUGINS_LIBLINKS)
94
95$(LIBLINKS):	FRC
96	$(RM) $(LIBLINKS); $(SYMLINK) $(DYNLIB) $(LIBLINKS)
97
98_msg:	$(MSGDOMAIN) $(POFILE)
99	$(RM) $(MSGDOMAIN)/$(POFILE)
100	$(CP) $(POFILE) $(MSGDOMAIN)/$(POFILE)
101
102$(MSGDOMAIN):
103	$(INS.dir)
104
105
106# include library targets
107include $(SRC)/cmd/picl/plugins/Makefile.targ
108include $(SRC)/lib/Makefile.targ
109
110$(ROOT_PLAT_PLUGINDIR)/%: % $(ROOT_PLAT_PLUGINDIR)
111	$(INS.file) ;\
112	$(RM) -r $(ROOT_PLAT_PLUGINDIR)/$(LIBLINKS) ;\
113	$(SYMLINK) ./$(DYNLIB) $(ROOT_PLAT_PLUGINDIR)/$(LIBLINKS)
114
115$(PLAT_PLATFORM):
116	$(INS.dir)
117$(PLAT_LIB_DIR):
118	$(INS.dir)
119$(PLAT_PICL_DIR):
120	$(INS.dir)
121
122$(PLAT_PLUGINS_DIRS):
123	$(INS.dir)
124
125$(USR_PLAT_PLUGINS_DYNLIBS): $(PLAT_PLUGINS_DIRS)
126	$(RM) -r $@ ;\
127	$(SYMLINK) $(LNECK_DYNLIB_DIR)/$(DYNLIB) $@
128
129$(USR_PLAT_PLUGINS_LIBLINKS): $(PLAT_PLUGINS_DIRS)
130	$(RM) -r $@ ;\
131	$(SYMLINK) $(LNECK_DYNLIB_DIR)/$(DYNLIB) $@
132
133lint :
134	$(LINT.c) $(SRCS)
135
136$(SUBDIRS): FRC
137	@cd $@; pwd; $(MAKE) $(TARGET)
138
139FRC:
140