usr/src/lib/libUnixDomainSocket_jni/Makefile.com
author David Powell <david.e.powell@oracle.com>
Thu, 11 Aug 2011 15:41:42 -0700
changeset 764 ebb25c1dac73
parent 754 d0a995fd0c9c
child 846 0a2af4721353
permissions -rw-r--r--
18812 Support building with alternate java implementations
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     1
#
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     2
# CDDL HEADER START
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     3
#
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     4
# The contents of this file are subject to the terms of the
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     5
# Common Development and Distribution License (the "License").
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     6
# You may not use this file except in compliance with the License.
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     7
#
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     8
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
     9
# or http://www.opensolaris.org/os/licensing.
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    10
# See the License for the specific language governing permissions
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    11
# and limitations under the License.
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    12
#
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    13
# When distributing Covered Code, include this CDDL HEADER in each
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    14
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    15
# If applicable, add the following below this CDDL HEADER, with the
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    16
# fields enclosed by brackets "[]" replaced with your own identifying
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    17
# information: Portions Copyright [yyyy] [name of copyright owner]
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    18
#
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    19
# CDDL HEADER END
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    20
#
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    21
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    22
#
711
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    23
# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    24
#
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    25
711
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    26
LIBRARY = libUnixDomainSocket_jni.a
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    27
VERS = .1
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    28
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    29
# Jars that must be built prior (added automatically to CLASSPATH)
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    30
DEPENDENCY_JARS = \
754
d0a995fd0c9c 15126 debug setting not inherited by slave daemons
David Powell <david.e.powell@oracle.com>
parents: 717
diff changeset
    31
	$(SRC)/java/afunix/afunix.jar
711
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    32
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    33
NATIVES = \
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    34
	UnixSocket \
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    35
	UnixSocketServer \
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    36
	UnixDomainSocket
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    37
JHEADERS = $(NATIVES:%=%.h)
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    38
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    39
SRCDIR = ..
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    40
OBJS = $(NATIVES:%=%.o)
711
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    41
SRCS = $(OBJS:%.o=$(SRCDIR)/%.c)
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    42
711
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    43
CPPFLAGS += -D_REENTRANT -I. -I$(ROOT)/usr/include -I/usr/java/include \
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    44
	-I/usr/java/include/solaris
717
7f7fc966a88f 18481 More rigorous module build
David Powell <david.e.powell@oracle.com>
parents: 711
diff changeset
    45
LDLIBS += -L$(ROOTLIBDIR) -ljniutil -lsocket -lbsm
711
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    46
LIBS = $(DYNLIB)
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    47
711
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    48
CLEAN_FILES += $(JHEADERS) $(OBJS)
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    49
CLOBBER_FILES += $(DYNLIB)
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    50
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    51
all: $(CLASSES) $(DYNLIB)
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    52
717
7f7fc966a88f 18481 More rigorous module build
David Powell <david.e.powell@oracle.com>
parents: 711
diff changeset
    53
$(LNFILES) $(OBJS): $(JHEADERS)
711
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    54
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    55
lint: lintcheck 
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    56
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    57
install: $(ROOTLIBS)
0
62ac12e07fc0 Initial integration.
David Powell <David.Powell@sun.com>
parents:
diff changeset
    58
711
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    59
$(JHEADERS): $(DEPENDENCY_JARS)
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    60
	@for f in $(DEPENDENCY_JARS); \
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    61
	do \
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    62
		jar tf "$$f"; \
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    63
	done | $(GREP) '/$(@:%.h=%).class' | \
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    64
	$(SED) 's/\.class$$//; s#/#.#g' | \
764
ebb25c1dac73 18812 Support building with alternate java implementations
David Powell <david.e.powell@oracle.com>
parents: 754
diff changeset
    65
	$(XARGS) echo $(JAVAH) -classpath $(CLASS_PATH) -o $@ | \
711
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    66
	while read line; \
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    67
	do \
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    68
		echo "$$line"; \
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    69
		$$line; \
1ffc0db7d2e5 18444 lint libraries and lintlibraries
David Powell <david.e.powell@oracle.com>
parents: 589
diff changeset
    70
	done