xref: /illumos-gate/usr/src/cmd/pools/poold/Makefile (revision a92282e44f968185a6bba094d1e5fece2da819cf)
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# Copyright (c) 2018, Joyent, Inc.
26# Copyright 2020 Peter Tribble
27#
28
29PROG =		poold
30OBJS =		poold.o
31SRCS =		$(OBJS:%.o=%.c)
32
33MANIFEST=	poold.xml
34SVCMETHOD=	svc-poold
35
36include $(SRC)/cmd/Makefile.cmd
37include $(SRC)/cmd/Makefile.cmd.64
38
39JAVA_SUBDIRS =	com/sun/solaris/service/exception \
40		com/sun/solaris/service/kstat \
41		com/sun/solaris/service/locality \
42		com/sun/solaris/service/logging \
43		com/sun/solaris/service/pools \
44		com/sun/solaris/service/timer \
45		com/sun/solaris/domain/pools
46
47SUBDIRS =	libjkstat \
48		libjlgrp \
49		libjpool \
50		libjsyslog
51
52ROOTMANIFESTDIR=	$(ROOTSVCSYSTEM)
53
54all :=		TARGET = all
55install :=	TARGET = install
56clean :=	TARGET = clean
57clobber :=	TARGET = clobber
58msg :=		TARGET = msg
59
60$(ROOTMANIFEST):=	FILEMODE= 444
61JARFILE =	JPool.jar
62
63JAVA_LIB_PATH =	$(JAVA_ROOT)/jre/lib/$(MACH64)/server
64$(BLD_JAVA_11)JAVA_LIB_PATH =	$(JAVA_ROOT)/lib/server
65LIBPOOL_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
86# not linted
87SMATCH=off
88
89CPPFLAGS +=	$(INCS)
90ROOTCMDDIR =	$(ROOT)/usr/lib/pool
91
92CLOBBERFILES +=	$(JARFILE)
93
94#
95# Definitions for message catalogue
96#
97POFILES =	$(OBJS:.o=.po)
98
99#
100# Definitions for Java installs
101#
102
103JFILES =	poold.properties $(JARFILE)
104ROOTJAVA =	$(JFILES:%=$(ROOTUSRLIBDRP)/%)
105
106$(ROOTJAVA) :=	FILEMODE = 444
107
108all:	$(PROG) $(JAVA_SUBDIRS) $(JARFILE) \
109		    .WAIT $(SUBDIRS)
110
111clean :	$(JAVA_SUBDIRS) $(SUBDIRS) clean_local
112clean_local:
113	$(RM) $(OBJS)
114
115clobber : $(JAVA_SUBDIRS) $(SUBDIRS) clobber_local
116clobber_local: clean_local
117	$(RM) $(CLOBBERFILES)
118
119msg: $(POFILES)
120
121install: $(ROOTCMD) $(JAVA_SUBDIRS) $(JARFILE) \
122		    .WAIT $(SUBDIRS) $(ROOTJAVA) $(ROOTMANIFEST) \
123		    $(ROOTSVCMETHOD)
124
125check:	$(CHKMANIFEST)
126
127$(JAVA_SUBDIRS): FRC
128	@cd $@; pwd; $(MAKE) $(TARGET)
129	if [ "$(TARGET)" != "clean" ] && [ "$(TARGET)" != "clobber" ]; \
130	then \
131		if [ ! -f $(JARFILE) ]; \
132		then \
133			$(JAR) -cf $(JARFILE) $@/*class; \
134		else \
135			$(JAR) -uf $(JARFILE) $@/*class; \
136		fi \
137	fi
138
139$(SUBDIRS): FRC
140	@cd $@; pwd; $(MAKE) $(TARGET)
141
142doc:	all
143	$(JAVADOC) -private -classpath $(JARFILE): -sourcepath . \
144	    -source 7 -d $(DOCDIR) $(PACKAGEDOCS)
145
146$(PROG):	$(OBJS)
147	$(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS)
148	$(POST_PROCESS)
149
150$(ROOTUSRLIBDRP)/%: %
151	$(INS.file)
152
153FRC:
154
155include $(SRC)/cmd/Makefile.targ
156