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