xref: /illumos-gate/usr/src/cmd/picl/plugins/sun4u/grover/memcfg/Makefile (revision 45d3dd981abb9025d8ac994cf4cc8ce8cb1a9480)
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=	libpiclmemcfg.a
29VERS=		.1
30
31OBJECTS=	piclmemcfg.o
32
33# include library definitions
34include	$(SRC)/lib/Makefile.lib
35
36ROOT_PLATFORM = $(USR_PLAT_DIR)/SUNW,Sun-Blade-100
37
38include	$(SRC)/cmd/picl/plugins/Makefile.com
39
40SRCS=		$(OBJECTS:%.o=%.c)
41
42LIBS =		$(DYNLIB)
43
44ROOTLIBDIR	= $(ROOT_PLAT_PLUGINDIR)
45
46LINTSRC =       $(LINTLIB:%.ln=%)
47ROOTLINTDIR =   $(ROOTLIBDIR)
48ROOTLINT =      $(LINTSRC:%=$(ROOTLINTDIR)/%)
49
50CLEANFILES=	$(LINTOUT) $(LINTLIB)
51
52CPPFLAGS +=	-I$(SRC)/cmd/picl/plugins/common/memcfg
53CFLAGS +=	$(CCVERBOSE)
54LDLIBS +=	-L$(SRC)/lib/libpicltree/$(MACH)
55LDLIBS +=	-L$(SRC)/cmd/picl/plugins/common/devtree
56LDLIBS +=	-L$(ROOT)/usr/lib/picl/plugins
57LDLIBS +=	-lc -lpicltree -lpicldevtree
58LDLIBS +=	-R/usr/platform/\$$PLATFORM/lib/picl/plugins:/usr/platform/sun4u/lib/picl/plugins:/usr/lib/picl/plugins
59
60
61LINKED_PLATFORMS	= SUNW,Serverblade1
62
63LINKED_DIRS		= $(LINKED_PLATFORMS:%=$(USR_PLAT_DIR)/%)
64LINKED_LIB_DIRS		= $(LINKED_PLATFORMS:%=$(USR_PLAT_DIR)/%/lib)
65LINKED_PICL_DIRS	= $(LINKED_PLATFORMS:%=$(USR_PLAT_DIR)/%/lib/picl)
66LINKED_PLUGIN_DIRS	= $(LINKED_PLATFORMS:%=$(USR_PLAT_DIR)/%/lib/picl/plugins)
67
68LINKED_PLUGINS_DYNLIBS = $(LINKED_PLUGIN_DIRS:%=%/$(DYNLIB))
69LINKED_PLUGINS_LIBLINKS = $(LINKED_PLUGIN_DIRS:%=%/$(LIBLINKS))
70
71GROVER_DYNLIB_DIR = ../../../../SUNW,Sun-Blade-100/lib/picl/plugins
72
73PLATFORM=	SUNW,Sun-Blade-100
74
75.KEEP_STATE:
76
77SUBDIRS=
78
79all :=		TARGET= all
80install :=	TARGET= install
81clean :=	TARGET= clean
82clobber :=	TARGET= clobber
83lint :=		TARGET= lint
84_msg :=		TARGET= _msg
85
86POFILE=	piclmemcfg.po
87
88all: $(LIBS) $(LIBLINKS)
89
90install:	$(ROOTLIBDIR) all $(ROOTLIBS) $(ROOTLINKS) \
91	$(LINKED_PLUGIN_DIRS) $(LINKED_PLUGINS_DYNLIBS) \
92	$(LINKED_PLUGINS_LIBLINKS)
93
94_msg:	$(MSGDOMAIN) $(POFILE)
95	$(RM) $(MSGDOMAIN)/$(POFILE)
96	$(CP) $(POFILE) $(MSGDOMAIN)
97
98$(MSGDOMAIN):
99	$(INS.dir)
100
101$(LIBLINKS):	FRC
102	$(RM) $@; $(SYMLINK) $(DYNLIB) $@
103
104# Linked platforms directory hierarchy
105$(LINKED_DIRS):
106	$(INS.dir)
107$(LINKED_LIB_DIRS): $(LINKED_DIRS)
108	$(INS.dir)
109$(LINKED_PICL_DIRS): $(LINKED_LIB_DIRS)
110	$(INS.dir)
111$(LINKED_PLUGIN_DIRS): $(LINKED_PICL_DIRS)
112	$(INS.dir)
113
114# Linked platforms links
115$(LINKED_PLUGINS_DYNLIBS): $(LINKED_PLUGIN_DIRS)
116	$(RM) -r $@ ;\
117	$(SYMLINK) $(GROVER_DYNLIB_DIR)/$(DYNLIB) $@
118
119$(LINKED_PLUGINS_LIBLINKS): $(LINKED_PLUGIN_DIRS)
120	$(RM) -r $@ ;\
121	$(SYMLINK) $(GROVER_DYNLIB_DIR)/$(DYNLIB) $@
122
123# include library targets
124include	$(SRC)/cmd/picl/plugins/Makefile.targ
125include	$(SRC)/lib/Makefile.targ
126
127$(ROOTLINTDIR)/%: ../%
128	$(INS.file)
129
130lint :
131	$(LINT.c) $(SRCS)
132
133$(SUBDIRS): FRC
134	@cd $@; pwd; $(MAKE) $(TARGET)
135
136FRC:
137