xref: /illumos-gate/usr/src/cmd/pools/poold/Makefile (revision 03270635d68df6a0392fb8f4b7c04acad764648b)
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/pools/poold/Makefile
26
27PROG =		poold
28OBJS =		poold.o
29SRCS =		$(OBJS:%.o=%.c)
30
31MANIFEST=	poold.xml
32SVCMETHOD=	svc-poold
33
34include $(SRC)/cmd/Makefile.cmd
35$(BLD_JAVA_8)include $(SRC)/cmd/Makefile.cmd.64
36
37JAVA_SUBDIRS =	com/sun/solaris/service/exception \
38		com/sun/solaris/service/kstat \
39		com/sun/solaris/service/locality \
40		com/sun/solaris/service/logging \
41		com/sun/solaris/service/pools \
42		com/sun/solaris/service/timer \
43		com/sun/solaris/domain/pools
44
45SUBDIRS =	libjkstat \
46		libjlgrp \
47		libjpool \
48		libjsyslog
49
50ROOTMANIFESTDIR=	$(ROOTSVCSYSTEM)
51
52all :=		TARGET = all
53install :=	TARGET = install
54clean :=	TARGET = clean
55clobber :=	TARGET = clobber
56lint :=		TARGET = lint
57msg :=		TARGET = msg
58
59$(ROOTMANIFEST):=	FILEMODE= 444
60JARFILE =	JPool.jar
61
62JAVA_LIB_PATH =	$(JAVA_ROOT)/jre/lib/$(MACH)/client
63LIBPOOL_PATH = $(ROOTLIB)
64$(BLD_JAVA_8)JAVA_LIB_PATH =	$(JAVA_ROOT)/jre/lib/$(MACH64)/server
65$(BLD_JAVA_8)LIBPOOL_PATH = $(ROOTLIB64)
66
67# JAVA_SUBDIRS and PACKAGEDOCS must be synchronized to ensure
68# javadoc documentation is generated for all packages.
69
70PACKAGEDOCS =	com.sun.solaris.service.exception \
71		com.sun.solaris.service.kstat \
72		com.sun.solaris.service.locality \
73		com.sun.solaris.service.logging \
74		com.sun.solaris.service.pools \
75		com.sun.solaris.service.timer \
76		com.sun.solaris.domain.pools
77DOCDIR =	doc
78ROOTUSRLIBDRP = $(ROOTLIB)/pool
79INCS =		-I../common \
80		-I$(JAVA_ROOT)/include \
81		-I$(JAVA_ROOT)/include/solaris
82LDLIBS +=	-lpool -L$(JAVA_LIB_PATH) -ljvm
83# runpath should point to runtime JAVA_HOME
84LDFLAGS +=	-R$(JAVA_LIB_PATH)
85
86LINTFLAGS +=	-erroff=E_NAME_USED_NOT_DEF2
87$(BLD_JAVA_8)LINTFLAGS64 += -erroff=E_NAME_USED_NOT_DEF2
88LINTLIBS +=	-L$(LIBPOOL_PATH) -lpool
89
90CPPFLAGS +=	$(INCS)
91ROOTCMDDIR =	$(ROOT)/usr/lib/pool
92
93CLOBBERFILES +=	$(JARFILE)
94
95#
96# Definitions for message catalogue
97#
98POFILES =	$(OBJS:.o=.po)
99
100#
101# Definitions for Java installs
102#
103
104JFILES =	poold.properties $(JARFILE)
105ROOTJAVA =	$(JFILES:%=$(ROOTUSRLIBDRP)/%)
106
107$(ROOTJAVA) :=	FILEMODE = 444
108
109all:	$(PROG) $(JAVA_SUBDIRS) $(JARFILE) \
110		    .WAIT $(SUBDIRS)
111
112clean :	$(JAVA_SUBDIRS) $(SUBDIRS) clean_local
113clean_local:
114	$(RM) $(OBJS)
115
116clobber : $(JAVA_SUBDIRS) $(SUBDIRS) clobber_local
117clobber_local: clean_local
118	$(RM) $(CLOBBERFILES)
119
120lint: $(SUBDIRS)
121
122msg: $(POFILES)
123
124install: $(ROOTCMD) $(JAVA_SUBDIRS) $(JARFILE) \
125		    .WAIT $(SUBDIRS) $(ROOTJAVA) $(ROOTMANIFEST) \
126		    $(ROOTSVCMETHOD)
127
128check:	$(CHKMANIFEST)
129
130$(JAVA_SUBDIRS): FRC
131	@cd $@; pwd; $(MAKE) $(TARGET)
132	if [ "$(TARGET)" != "clean" ] && [ "$(TARGET)" != "clobber" ]; \
133	then \
134		if [ ! -f $(JARFILE) ]; \
135		then \
136			$(JAR) -cf $(JARFILE) $@/*class; \
137		else \
138			$(JAR) -uf $(JARFILE) $@/*class; \
139		fi \
140	fi
141
142$(SUBDIRS): FRC
143	@cd $@; pwd; $(MAKE) $(TARGET)
144
145doc:	all
146	$(JAVADOC) -private -classpath $(JARFILE): -sourcepath . \
147	    -source 1.4 -d $(DOCDIR) $(PACKAGEDOCS)
148
149$(PROG):	$(OBJS)
150	$(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS)
151	$(POST_PROCESS)
152
153$(ROOTUSRLIBDRP)/%: %
154	$(INS.file)
155
156FRC:
157
158lint:
159	$(LINT.c) $(PROG).c $(LINTLIBS)
160
161include $(SRC)/cmd/Makefile.targ
162