File: Makefile.am

package info (click to toggle)
openmpi 3.1.3-11
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 118,572 kB
  • sloc: ansic: 628,972; f90: 17,993; makefile: 13,761; sh: 7,051; java: 6,360; perl: 3,215; cpp: 2,225; python: 1,350; lex: 988; fortran: 52; tcl: 12
file content (218 lines) | stat: -rw-r--r-- 6,814 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# -*- makefile -*-
#
# Copyright (c) 2011-2014 Cisco Systems, Inc.  All rights reserved.
# Copyright (c) 2015      Los Alamos National Security, LLC. All rights
#                         reserved.
# Copyright (c) 2017      FUJITSU LIMITED.  All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#

include $(top_srcdir)/Makefile.ompi-rules

#
# We generate three general things in this directory:
#
# 1. *.java files get compiled into mpi/*.class files.
# 2. The mpi/*.class files are then assembled into an mpi.jar file.
# 3. The mpi/*.class files are analyzed to make *.h JNI files.
#

# These are the Java source files.  However, Automake doesn't directly
# know about them, and we compile them via *.java below (ick!).  So we
# just list them here in EXTRA_DIST so that they get picked up by
# "make dist".
JAVA_SRC_FILES = \
	CartComm.java     \
	CartParms.java    \
	Comm.java         \
	Constant.java     \
	Count.java	  \
	Datatype.java     \
	DistGraphNeighbors.java \
	DoubleInt.java    \
	DoubleComplex.java \
	Errhandler.java   \
	FloatComplex.java \
	FloatInt.java     \
	File.java         \
	FileView.java     \
	Freeable.java     \
	GraphComm.java    \
	GraphParms.java   \
	Group.java        \
	Info.java	  \
	Int2.java         \
	Intercomm.java    \
	Intracomm.java    \
	LongInt.java      \
	Message.java      \
	MPI.java          \
	MPIException.java \
	Op.java           \
	Prequest.java     \
	Request.java      \
	ShiftParms.java   \
	ShortInt.java     \
	Status.java       \
	Struct.java       \
	UserFunction.java \
	Version.java	  \
	Win.java

EXTRA_DIST = $(JAVA_SRC_FILES)

# Only do this stuff if we want the Java bindings
if OMPI_WANT_JAVA_BINDINGS

# These files get generated.  They have a 1:1 correspondence to .java
# files, but there is not a .h file for every .java file.  That's why
# we have a specific list of files here, as opposed to deriving them
# from JAVA_SRC_FILES.
JAVA_H = \
	mpi_MPI.h          \
	mpi_CartComm.h     \
	mpi_Comm.h         \
	mpi_Constant.h     \
	mpi_Count.h        \
	mpi_Datatype.h     \
	mpi_Errhandler.h   \
	mpi_File.h         \
	mpi_GraphComm.h    \
	mpi_Group.h        \
	mpi_Info.h         \
	mpi_Intercomm.h    \
	mpi_Intracomm.h    \
	mpi_Message.h      \
	mpi_Op.h           \
	mpi_Prequest.h     \
	mpi_Request.h      \
	mpi_Status.h       \
	mpi_Win.h

# A little verbosity magic; see Makefile.ompi-rules for an explanation.
OMPI_V_JAVAC = $(ompi__v_JAVAC_$V)
ompi__v_JAVAC_ = $(ompi__v_JAVAC_$AM_DEFAULT_VERBOSITY)
ompi__v_JAVAC_0 = @echo "  JAVAC   " `basename $@`;

OMPI_V_JAVAH = $(ompi__v_JAVAH_$V)
ompi__v_JAVAH_ = $(ompi__v_JAVAH_$AM_DEFAULT_VERBOSITY)
ompi__v_JAVAH_0 = @echo "  JAVAH   " `basename $@`;

OMPI_V_JAR = $(ompi__v_JAR_$V)
ompi__v_JAR_ = $(ompi__v_JAR_$AM_DEFAULT_VERBOSITY)
ompi__v_JAR_0 = @echo "    JAR   " `basename $@`;

OMPI_V_JAVADOC = $(ompi__v_JAVADOC_$V)
ompi__v_JAVADOC_ = $(ompi__v_JAVADOC_$AM_DEFAULT_VERBOSITY)
ompi__v_JAVADOC_0 = @echo "JAVADOC   " `basename $@`;

OMPI_V_JAVADOC_QUIET = $(ompi__v_JAVADOC_QUIET_$V)
ompi__v_JAVADOC_QUIET_ = $(ompi__v_JAVADOC_QUIET_$AM_DEFAULT_VERBOSITY)
ompi__v_JAVADOC_QUIET_0 = -quiet

# All the .java files seem to have circular references, such that I
# can't figure out a linear order in which to compile them
# sequentially that does not generate dependency errors.  Hence, the
# only way I can figure out how to compile them is via *.java -- this
# could well be due to my own misunderstanding of Java or the
# compiler.  Shrug.
#
# So instead of listing all the .class files, since the rule below
# will generate *all* the .class files simulanteously, just use
# mpi/MPI.class as a token class file for both the rule and all the
# dependencies below.
#
# Note too, that all of them will be recompiled if any of them change,
# since Automake doesn't know how to automatically generate
# dependencies for Java source files.  So I made the token MPI.class
# file dependent upon *all* the .java source files.
#
# Note that the javac compile will generate all the .class files in
# the "mpi" subdirectory, because that's the java package that they're
# in.  This, along with the fact that the .java files seem to have
# circular references, prevents us from using a .foo.bar: generic
# Makefile rule. :-(
if OPAL_HAVE_JAVAH_SUPPORT
mpi/MPI.class: $(JAVA_SRC_FILES)
	$(OMPI_V_JAVAC) CLASSPATH=. ; \
	export CLASSPATH ; \
	$(JAVAC) -d . $(top_srcdir)/ompi/mpi/java/java/*.java

# Similar to above, all the generated .h files are dependent upon the
# token mpi/MPI.class file.  Hence, all the classes will be generated
# first, then we'll individually generate each of the .h files.

$(JAVA_H): mpi/MPI.class
	$(OMPI_V_JAVAH) sourcename=mpi.`echo $@ | sed -e s/^mpi_// -e s/.h$$//`; \
	CLASSPATH=. ; \
	export CLASSPATH ; \
	$(JAVAH) -d . -jni $$sourcename
else
mpi/MPI.class: $(JAVA_SRC_FILES)
	$(OMPI_V_JAVAC) CLASSPATH=. ; \
	export CLASSPATH ; \
	$(JAVAC) -h . -d . $(top_srcdir)/ompi/mpi/java/java/*.java
endif # OPAL_HAVE_JAVAH_SUPPORT

# Generate the .jar file from all the class files.  List mpi/MPI.class
# as a dependency so that it fires the rule above that will generate
# *all* the mpi/*.class files.
mpi.jar: mpi/MPI.class
	$(OMPI_V_JAR) $(JAR) cf mpi.jar mpi/*.class

# Install the jar file into libdir.  Use the DATA Automake primary,
# because Automake will complain if you try to use LIBRARIES with a
# filename that doesn't fit the lib<foo>.* format.  Also use an
# indirection to get to the libdir -- Automake does not allow putting
# libdir for the DATA primary.
javadir = $(libdir)
java_DATA = mpi.jar

# List all the header files in BUILT_SOURCES so that Automake's "all"
# target will build them.  This will also force the building of the
# mpi/*.class files (for the jar file).
if OPAL_HAVE_JAVAH_SUPPORT
BUILT_SOURCES = $(JAVA_H) doc
else
BUILT_SOURCES = mpi/MPI.class doc
endif

# Convenience for building Javadoc docs
jdoc: doc

# Make the "doc" target (and subdir) dependent upon mpi/MPI.class; if
# mpi.jar is ever rebuilt, then also make the docs eligible to be
# rebuilt.
doc: mpi/MPI.class
	$(OMPI_V_JAVADOC) $(JAVADOC) $(OMPI_V_JAVADOC_QUIET) -d doc $(srcdir)/*.java
	@touch doc

jdoc-install: doc
	-$(MKDIR_P) $(DESTDIR)$(docdir)/javadoc-openmpi
	cp -rp doc/* $(DESTDIR)$(docdir)/javadoc-openmpi

jdoc-uninstall:
	-rm -rf $(DESTDIR)$(docdir)/javadoc

install-data-hook: jdoc-install
uninstall-local: jdoc-uninstall

# Clean up all the things that this Makefile.am generates.
CLEANFILES += $(JAVA_H) mpi.jar

# Can only put *files* in CLEANFILES; need to remove the generated doc
# and mpi directories separately.
clean-local:
	-rm -rf doc mpi

# Conditionally install the header files
if WANT_INSTALL_HEADERS
ompihdir = $(ompiincludedir)/$(subdir)
nobase_nodist_ompih_HEADERS = $(JAVA_H)
endif

endif