xref: /illumos-gate/usr/src/cmd/pools/poold/Makefile (revision 51396a8e)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
524fe0b3bSjmcp# Common Development and Distribution License (the "License").
624fe0b3bSjmcp# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
2224fe0b3bSjmcp# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
255661bb76SJohn Levon# Copyright (c) 2018, Joyent, Inc.
26*51396a8eSPeter Tribble# Copyright 2020 Peter Tribble
27*51396a8eSPeter Tribble#
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gatePROG =		poold
307c478bd9Sstevel@tonic-gateOBJS =		poold.o
317c478bd9Sstevel@tonic-gateSRCS =		$(OBJS:%.o=%.c)
327c478bd9Sstevel@tonic-gate
3326d8ba22SgarypenMANIFEST=	poold.xml
3426d8ba22SgarypenSVCMETHOD=	svc-poold
3526d8ba22Sgarypen
367c478bd9Sstevel@tonic-gateinclude $(SRC)/cmd/Makefile.cmd
37*51396a8eSPeter Tribbleinclude $(SRC)/cmd/Makefile.cmd.64
387c478bd9Sstevel@tonic-gate
397c478bd9Sstevel@tonic-gateJAVA_SUBDIRS =	com/sun/solaris/service/exception \
407c478bd9Sstevel@tonic-gate		com/sun/solaris/service/kstat \
417c478bd9Sstevel@tonic-gate		com/sun/solaris/service/locality \
427c478bd9Sstevel@tonic-gate		com/sun/solaris/service/logging \
437c478bd9Sstevel@tonic-gate		com/sun/solaris/service/pools \
447c478bd9Sstevel@tonic-gate		com/sun/solaris/service/timer \
457c478bd9Sstevel@tonic-gate		com/sun/solaris/domain/pools
467c478bd9Sstevel@tonic-gate
477c478bd9Sstevel@tonic-gateSUBDIRS =	libjkstat \
487c478bd9Sstevel@tonic-gate		libjlgrp \
497c478bd9Sstevel@tonic-gate		libjpool \
507c478bd9Sstevel@tonic-gate		libjsyslog
517c478bd9Sstevel@tonic-gate
5226d8ba22SgarypenROOTMANIFESTDIR=	$(ROOTSVCSYSTEM)
5326d8ba22Sgarypen
547c478bd9Sstevel@tonic-gateall :=		TARGET = all
557c478bd9Sstevel@tonic-gateinstall :=	TARGET = install
567c478bd9Sstevel@tonic-gateclean :=	TARGET = clean
577c478bd9Sstevel@tonic-gateclobber :=	TARGET = clobber
587c478bd9Sstevel@tonic-gatemsg :=		TARGET = msg
597c478bd9Sstevel@tonic-gate
6026d8ba22Sgarypen$(ROOTMANIFEST):=	FILEMODE= 444
617c478bd9Sstevel@tonic-gateJARFILE =	JPool.jar
627c478bd9Sstevel@tonic-gate
63*51396a8eSPeter TribbleJAVA_LIB_PATH =	$(JAVA_ROOT)/jre/lib/$(MACH64)/server
64*51396a8eSPeter Tribble$(BLD_JAVA_11)JAVA_LIB_PATH =	$(JAVA_ROOT)/lib/server
65*51396a8eSPeter TribbleLIBPOOL_PATH = $(ROOTLIB64)
66cb159270SAlexander Pyhalov
67*51396a8eSPeter Tribble# JAVA_SUBDIRS and PACKAGEDOCS must be synchronized to ensure
687c478bd9Sstevel@tonic-gate# javadoc documentation is generated for all packages.
697c478bd9Sstevel@tonic-gate
707c478bd9Sstevel@tonic-gatePACKAGEDOCS =	com.sun.solaris.service.exception \
717c478bd9Sstevel@tonic-gate		com.sun.solaris.service.kstat \
727c478bd9Sstevel@tonic-gate		com.sun.solaris.service.locality \
737c478bd9Sstevel@tonic-gate		com.sun.solaris.service.logging \
747c478bd9Sstevel@tonic-gate		com.sun.solaris.service.pools \
757c478bd9Sstevel@tonic-gate		com.sun.solaris.service.timer \
767c478bd9Sstevel@tonic-gate		com.sun.solaris.domain.pools
777c478bd9Sstevel@tonic-gateDOCDIR =	doc
787c478bd9Sstevel@tonic-gateROOTUSRLIBDRP = $(ROOTLIB)/pool
797c478bd9Sstevel@tonic-gateINCS =		-I../common \
807c478bd9Sstevel@tonic-gate		-I$(JAVA_ROOT)/include \
817c478bd9Sstevel@tonic-gate		-I$(JAVA_ROOT)/include/solaris
82cb159270SAlexander PyhalovLDLIBS +=	-lpool -L$(JAVA_LIB_PATH) -ljvm
83e53cbaa9SRichard PALO# runpath should point to runtime JAVA_HOME
84cb159270SAlexander PyhalovLDFLAGS +=	-R$(JAVA_LIB_PATH)
85cb159270SAlexander Pyhalov
865661bb76SJohn Levon# not linted
875661bb76SJohn LevonSMATCH=off
885661bb76SJohn Levon
897c478bd9Sstevel@tonic-gateCPPFLAGS +=	$(INCS)
907c478bd9Sstevel@tonic-gateROOTCMDDIR =	$(ROOT)/usr/lib/pool
917c478bd9Sstevel@tonic-gate
927c478bd9Sstevel@tonic-gateCLOBBERFILES +=	$(JARFILE)
937c478bd9Sstevel@tonic-gate
947c478bd9Sstevel@tonic-gate#
957c478bd9Sstevel@tonic-gate# Definitions for message catalogue
967c478bd9Sstevel@tonic-gate#
977c478bd9Sstevel@tonic-gatePOFILES =	$(OBJS:.o=.po)
987c478bd9Sstevel@tonic-gate
997c478bd9Sstevel@tonic-gate#
1007c478bd9Sstevel@tonic-gate# Definitions for Java installs
1017c478bd9Sstevel@tonic-gate#
1027c478bd9Sstevel@tonic-gate
1037c478bd9Sstevel@tonic-gateJFILES =	poold.properties $(JARFILE)
1047c478bd9Sstevel@tonic-gateROOTJAVA =	$(JFILES:%=$(ROOTUSRLIBDRP)/%)
1057c478bd9Sstevel@tonic-gate
1067c478bd9Sstevel@tonic-gate$(ROOTJAVA) :=	FILEMODE = 444
1077c478bd9Sstevel@tonic-gate
1087c478bd9Sstevel@tonic-gateall:	$(PROG) $(JAVA_SUBDIRS) $(JARFILE) \
1097c478bd9Sstevel@tonic-gate		    .WAIT $(SUBDIRS)
1107c478bd9Sstevel@tonic-gate
111b6805bf7SGordon Rossclean :	$(JAVA_SUBDIRS) $(SUBDIRS) clean_local
112b6805bf7SGordon Rossclean_local:
113b6805bf7SGordon Ross	$(RM) $(OBJS)
114b6805bf7SGordon Ross
115b6805bf7SGordon Rossclobber : $(JAVA_SUBDIRS) $(SUBDIRS) clobber_local
116b6805bf7SGordon Rossclobber_local: clean_local
117b6805bf7SGordon Ross	$(RM) $(CLOBBERFILES)
1187c478bd9Sstevel@tonic-gate
1197c478bd9Sstevel@tonic-gatemsg: $(POFILES)
1207c478bd9Sstevel@tonic-gate
1217c478bd9Sstevel@tonic-gateinstall: $(ROOTCMD) $(JAVA_SUBDIRS) $(JARFILE) \
12226d8ba22Sgarypen		    .WAIT $(SUBDIRS) $(ROOTJAVA) $(ROOTMANIFEST) \
12326d8ba22Sgarypen		    $(ROOTSVCMETHOD)
12426d8ba22Sgarypen
12526d8ba22Sgarypencheck:	$(CHKMANIFEST)
1267c478bd9Sstevel@tonic-gate
1277c478bd9Sstevel@tonic-gate$(JAVA_SUBDIRS): FRC
1287c478bd9Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
1297c478bd9Sstevel@tonic-gate	if [ "$(TARGET)" != "clean" ] && [ "$(TARGET)" != "clobber" ]; \
1307c478bd9Sstevel@tonic-gate	then \
1317c478bd9Sstevel@tonic-gate		if [ ! -f $(JARFILE) ]; \
1327c478bd9Sstevel@tonic-gate		then \
1337c478bd9Sstevel@tonic-gate			$(JAR) -cf $(JARFILE) $@/*class; \
1347c478bd9Sstevel@tonic-gate		else \
1357c478bd9Sstevel@tonic-gate			$(JAR) -uf $(JARFILE) $@/*class; \
1367c478bd9Sstevel@tonic-gate		fi \
1377c478bd9Sstevel@tonic-gate	fi
1387c478bd9Sstevel@tonic-gate
1397c478bd9Sstevel@tonic-gate$(SUBDIRS): FRC
1407c478bd9Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
1417c478bd9Sstevel@tonic-gate
1427c478bd9Sstevel@tonic-gatedoc:	all
1437c478bd9Sstevel@tonic-gate	$(JAVADOC) -private -classpath $(JARFILE): -sourcepath . \
144*51396a8eSPeter Tribble	    -source 7 -d $(DOCDIR) $(PACKAGEDOCS)
1457c478bd9Sstevel@tonic-gate
1467c478bd9Sstevel@tonic-gate$(PROG):	$(OBJS)
1477c478bd9Sstevel@tonic-gate	$(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS)
1487c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1497c478bd9Sstevel@tonic-gate
1507c478bd9Sstevel@tonic-gate$(ROOTUSRLIBDRP)/%: %
1517c478bd9Sstevel@tonic-gate	$(INS.file)
1527c478bd9Sstevel@tonic-gate
1537c478bd9Sstevel@tonic-gateFRC:
1547c478bd9Sstevel@tonic-gate
1557c478bd9Sstevel@tonic-gateinclude $(SRC)/cmd/Makefile.targ
156