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