Makefile 31.2 KB
Newer Older
D
duke 已提交
1
#
2
# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
D
duke 已提交
3 4 5 6
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
7
# published by the Free Software Foundation.  Oracle designates this
D
duke 已提交
8
# particular file as subject to the "Classpath" exception as provided
9
# by Oracle in the LICENSE file that accompanied this code.
D
duke 已提交
10 11 12 13 14 15 16 17 18 19 20
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
21 22 23
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
D
duke 已提交
24 25 26 27 28 29 30 31 32 33
#

#
# Makefile for java.nio
#

BUILDDIR = ../..
PACKAGE = java.nio
LIBRARY = nio
PRODUCT = java
34 35
JAVAC_MAX_WARNINGS = true
JAVAC_WARNINGS_FATAL = true
D
duke 已提交
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
include $(BUILDDIR)/common/Defs.gmk

NIO_SRC = $(SHARE_SRC)/classes/java/nio
NIO_GEN = $(GENSRCDIR)/java/nio

SNIO_SRC = $(SHARE_SRC)/classes/sun/nio
SNIO_GEN = $(GENSRCDIR)/sun/nio

#
# Files to compile
#

include FILES_java.gmk
include FILES_c.gmk
include Exportedfiles.gmk

ifeq ($(PLATFORM), solaris)
FILES_java += \
        sun/nio/ch/AbstractPollSelectorImpl.java \
	sun/nio/ch/DevPollArrayWrapper.java \
	sun/nio/ch/DevPollSelectorImpl.java \
        sun/nio/ch/DevPollSelectorProvider.java \
58 59 60
	sun/nio/ch/EventPortSelectorImpl.java \
	sun/nio/ch/EventPortSelectorProvider.java \
	sun/nio/ch/EventPortWrapper.java \
D
duke 已提交
61 62
	sun/nio/ch/InheritedChannel.java \
        sun/nio/ch/PollSelectorProvider.java \
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
        sun/nio/ch/PollSelectorImpl.java \
	sun/nio/ch/Port.java \
	sun/nio/ch/SimpleAsynchronousFileChannelImpl.java \
	sun/nio/ch/SolarisAsynchronousChannelProvider.java \
	sun/nio/ch/SolarisEventPort.java \
	sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \
	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \
	\
	sun/nio/fs/GnomeFileTypeDetector.java \
	sun/nio/fs/PollingWatchService.java \
	sun/nio/fs/SolarisAclFileAttributeView.java \
	sun/nio/fs/SolarisFileStore.java \
	sun/nio/fs/SolarisFileSystem.java \
	sun/nio/fs/SolarisFileSystemProvider.java \
	sun/nio/fs/SolarisUserDefinedFileAttributeView.java \
	sun/nio/fs/SolarisNativeDispatcher.java \
	sun/nio/fs/SolarisWatchService.java \
	sun/nio/fs/UnixChannelFactory.java \
	sun/nio/fs/UnixCopyFile.java \
	sun/nio/fs/UnixDirectoryStream.java \
	sun/nio/fs/UnixException.java \
	sun/nio/fs/UnixFileAttributeViews.java \
	sun/nio/fs/UnixFileAttributes.java \
	sun/nio/fs/UnixFileKey.java \
	sun/nio/fs/UnixFileModeAttribute.java \
	sun/nio/fs/UnixFileStore.java \
	sun/nio/fs/UnixFileStoreAttributes.java \
	sun/nio/fs/UnixFileSystem.java \
	sun/nio/fs/UnixFileSystemProvider.java \
	sun/nio/fs/UnixMountEntry.java \
	sun/nio/fs/UnixNativeDispatcher.java \
	sun/nio/fs/UnixPath.java \
	sun/nio/fs/UnixSecureDirectoryStream.java \
	sun/nio/fs/UnixUriUtils.java \
	sun/nio/fs/UnixUserPrincipals.java
D
duke 已提交
98 99 100 101

FILES_c += \
        DevPollArrayWrapper.c \
	InheritedChannel.c \
102
	NativeThread.c \
103 104 105 106 107 108 109 110 111 112
        PollArrayWrapper.c \
	SolarisEventPort.c \
	UnixAsynchronousServerSocketChannelImpl.c \
	UnixAsynchronousSocketChannelImpl.c \
	\
	GnomeFileTypeDetector.c \
	SolarisNativeDispatcher.c \
	SolarisWatchService.c \
	UnixCopyFile.c \
	UnixNativeDispatcher.c
D
duke 已提交
113 114 115 116

FILES_export += \
	sun/nio/ch/DevPollArrayWrapper.java \
	sun/nio/ch/InheritedChannel.java \
117 118 119 120 121 122 123 124 125 126 127 128 129 130
	sun/nio/ch/NativeThread.java \
	sun/nio/ch/SolarisEventPort.java \
	sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \
	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \
	\
	sun/nio/fs/GnomeFileTypeDetector.java \
	sun/nio/fs/SolarisNativeDispatcher.java \
	sun/nio/fs/SolarisWatchService.java \
	sun/nio/fs/UnixCopyFile.java \
	sun/nio/fs/UnixNativeDispatcher.java

FILES_gen += \
	sun/nio/fs/SolarisConstants.java \
	sun/nio/fs/UnixConstants.java
D
duke 已提交
131 132 133 134
endif # PLATFORM = solaris

ifeq ($(PLATFORM), windows)
FILES_java += \
135 136 137 138 139 140
	sun/nio/ch/Iocp.java \
	sun/nio/ch/PendingIoCache.java \
	sun/nio/ch/WindowsAsynchronousChannelProvider.java \
	sun/nio/ch/WindowsAsynchronousFileChannelImpl.java \
	sun/nio/ch/WindowsAsynchronousServerSocketChannelImpl.java \
	sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java \
D
duke 已提交
141
        sun/nio/ch/WindowsSelectorImpl.java \
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
        sun/nio/ch/WindowsSelectorProvider.java \
	\
	sun/nio/fs/RegistryFileTypeDetector.java \
	sun/nio/fs/WindowsAclFileAttributeView.java \
	sun/nio/fs/WindowsChannelFactory.java \
	sun/nio/fs/WindowsConstants.java \
	sun/nio/fs/WindowsDirectoryStream.java \
	sun/nio/fs/WindowsException.java \
	sun/nio/fs/WindowsFileAttributeViews.java \
	sun/nio/fs/WindowsFileAttributes.java \
	sun/nio/fs/WindowsFileCopy.java \
	sun/nio/fs/WindowsFileStore.java \
	sun/nio/fs/WindowsFileSystem.java \
	sun/nio/fs/WindowsFileSystemProvider.java \
	sun/nio/fs/WindowsLinkSupport.java \
	sun/nio/fs/WindowsUserDefinedFileAttributeView.java \
	sun/nio/fs/WindowsNativeDispatcher.java \
	sun/nio/fs/WindowsPath.java \
	sun/nio/fs/WindowsPathParser.java \
	sun/nio/fs/WindowsPathType.java \
	sun/nio/fs/WindowsSecurity.java \
	sun/nio/fs/WindowsSecurityDescriptor.java \
	sun/nio/fs/WindowsUriSupport.java \
	sun/nio/fs/WindowsUserPrincipals.java \
	sun/nio/fs/WindowsWatchService.java
D
duke 已提交
167 168

FILES_c += \
169 170 171 172 173 174
	Iocp.c \
	RegistryFileTypeDetector.c \
	WindowsAsynchronousFileChannelImpl.c \
	WindowsAsynchronousServerSocketChannelImpl.c \
	WindowsAsynchronousSocketChannelImpl.c \
	WindowsNativeDispatcher.c \
D
duke 已提交
175 176 177
        WindowsSelectorImpl.c

FILES_export += \
178 179 180 181 182 183 184
	sun/nio/ch/Iocp.java \
	sun/nio/ch/WindowsAsynchronousFileChannelImpl.java \
	sun/nio/ch/WindowsAsynchronousServerSocketChannelImpl.java \
	sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java \
	sun/nio/ch/WindowsSelectorImpl.java \
	sun/nio/fs/WindowsNativeDispatcher.java \
	sun/nio/fs/RegistryFileTypeDetector.java
D
duke 已提交
185 186 187 188 189
endif # PLATFORM = windows

ifeq ($(PLATFORM), linux)
FILES_java += \
        sun/nio/ch/AbstractPollSelectorImpl.java \
190
	sun/nio/ch/EPoll.java \
D
duke 已提交
191
	sun/nio/ch/EPollArrayWrapper.java \
192
	sun/nio/ch/EPollPort.java \
D
duke 已提交
193 194 195
	sun/nio/ch/EPollSelectorProvider.java \
	sun/nio/ch/EPollSelectorImpl.java \
	sun/nio/ch/InheritedChannel.java \
196
	sun/nio/ch/LinuxAsynchronousChannelProvider.java \
D
duke 已提交
197
        sun/nio/ch/PollSelectorProvider.java \
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
        sun/nio/ch/PollSelectorImpl.java \
	sun/nio/ch/Port.java \
	sun/nio/ch/SimpleAsynchronousFileChannelImpl.java \
	sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \
	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \
	\
	sun/nio/fs/GnomeFileTypeDetector.java \
	sun/nio/fs/LinuxDosFileAttributeView.java \
	sun/nio/fs/LinuxFileStore.java \
	sun/nio/fs/LinuxFileSystem.java \
	sun/nio/fs/LinuxFileSystemProvider.java \
	sun/nio/fs/LinuxUserDefinedFileAttributeView.java \
	sun/nio/fs/LinuxNativeDispatcher.java \
	sun/nio/fs/LinuxWatchService.java \
	sun/nio/fs/UnixChannelFactory.java \
	sun/nio/fs/UnixCopyFile.java \
	sun/nio/fs/UnixDirectoryStream.java \
	sun/nio/fs/UnixException.java \
	sun/nio/fs/UnixFileAttributeViews.java \
	sun/nio/fs/UnixFileAttributes.java \
	sun/nio/fs/UnixFileKey.java \
	sun/nio/fs/UnixFileModeAttribute.java \
	sun/nio/fs/UnixFileStore.java \
	sun/nio/fs/UnixFileStoreAttributes.java \
	sun/nio/fs/UnixFileSystem.java \
	sun/nio/fs/UnixFileSystemProvider.java \
	sun/nio/fs/UnixMountEntry.java \
	sun/nio/fs/UnixNativeDispatcher.java \
	sun/nio/fs/UnixPath.java \
	sun/nio/fs/UnixSecureDirectoryStream.java \
	sun/nio/fs/UnixUriUtils.java \
	sun/nio/fs/UnixUserPrincipals.java
D
duke 已提交
230 231

FILES_c += \
232
	EPoll.c \
D
duke 已提交
233
	EPollArrayWrapper.c \
234
	EPollPort.c \
D
duke 已提交
235
	InheritedChannel.c \
236
	NativeThread.c \
237 238 239 240 241 242 243 244 245
        PollArrayWrapper.c \
	UnixAsynchronousServerSocketChannelImpl.c \
	UnixAsynchronousSocketChannelImpl.c \
	\
	GnomeFileTypeDetector.c \
	LinuxNativeDispatcher.c \
	LinuxWatchService.c \
	UnixCopyFile.c \
	UnixNativeDispatcher.c
D
duke 已提交
246 247

FILES_export += \
248
	sun/nio/ch/EPoll.java \
D
duke 已提交
249
        sun/nio/ch/EPollArrayWrapper.java \
250
	sun/nio/ch/EPollPort.java \
D
duke 已提交
251
	sun/nio/ch/InheritedChannel.java \
252 253 254 255 256 257 258 259 260
	sun/nio/ch/NativeThread.java \
	sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \
	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \
	\
	sun/nio/fs/GnomeFileTypeDetector.java \
	sun/nio/fs/LinuxNativeDispatcher.java \
	sun/nio/fs/LinuxWatchService.java \
	sun/nio/fs/UnixCopyFile.java \
	sun/nio/fs/UnixNativeDispatcher.java
261

262 263
FILES_gen += \
	sun/nio/fs/UnixConstants.java
D
duke 已提交
264 265
endif # PLATFORM = linux

266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
ifeq ($(PLATFORM), macosx)
FILES_java += \
        sun/nio/ch/AbstractPollSelectorImpl.java \
	sun/nio/ch/BsdAsynchronousChannelProvider.java \
	sun/nio/ch/InheritedChannel.java \
	sun/nio/ch/KQueue.java \
	sun/nio/ch/KQueuePort.java \
        sun/nio/ch/PollSelectorProvider.java \
        sun/nio/ch/PollSelectorImpl.java \
	sun/nio/ch/Port.java \
	sun/nio/ch/SimpleAsynchronousFileChannelImpl.java \
	sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \
	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \
	\
	sun/nio/fs/BsdFileStore.java \
	sun/nio/fs/BsdFileSystem.java \
	sun/nio/fs/BsdFileSystemProvider.java \
	sun/nio/fs/BsdNativeDispatcher.java \
284 285 286
	sun/nio/fs/MacOSXFileSystemProvider.java \
	sun/nio/fs/MacOSXFileSystem.java \
	sun/nio/fs/MacOSXNativeDispatcher.java \
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
	sun/nio/fs/PollingWatchService.java \
	sun/nio/fs/UnixChannelFactory.java \
	sun/nio/fs/UnixCopyFile.java \
	sun/nio/fs/UnixDirectoryStream.java \
	sun/nio/fs/UnixException.java \
	sun/nio/fs/UnixFileAttributeViews.java \
	sun/nio/fs/UnixFileAttributes.java \
	sun/nio/fs/UnixFileKey.java \
	sun/nio/fs/UnixFileModeAttribute.java \
	sun/nio/fs/UnixFileStore.java \
	sun/nio/fs/UnixFileStoreAttributes.java \
	sun/nio/fs/UnixFileSystem.java \
	sun/nio/fs/UnixFileSystemProvider.java \
	sun/nio/fs/UnixMountEntry.java \
	sun/nio/fs/UnixNativeDispatcher.java \
	sun/nio/fs/UnixPath.java \
	sun/nio/fs/UnixSecureDirectoryStream.java \
	sun/nio/fs/UnixUriUtils.java \
	sun/nio/fs/UnixUserPrincipals.java

FILES_c += \
	InheritedChannel.c \
	NativeThread.c \
        PollArrayWrapper.c \
	UnixAsynchronousServerSocketChannelImpl.c \
	UnixAsynchronousSocketChannelImpl.c \
	\
	BsdNativeDispatcher.c \
315
	MacOSXNativeDispatcher.c \
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351
	UnixCopyFile.c \
	UnixNativeDispatcher.c \
	\
	KQueue.c \
	KQueuePort.c

FILES_export += \
	sun/nio/ch/InheritedChannel.java \
	sun/nio/ch/KQueue.java \
	sun/nio/ch/KQueuePort.java \
	sun/nio/ch/NativeThread.java \
	sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \
	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \
	\
	sun/nio/fs/BsdNativeDispatcher.java \
	sun/nio/fs/UnixCopyFile.java \
	sun/nio/fs/UnixNativeDispatcher.java
	
FILES_gen += \
	sun/nio/fs/UnixConstants.java
endif # PLATFORM = bsd, macosx

ifeq ($(PLATFORM), macosx)
FILES_java += \
    sun/nio/ch/KQueueSelectorProvider.java \
    sun/nio/ch/KQueueSelectorImpl.java \
    sun/nio/ch/KQueueArrayWrapper.java

FILES_c += \
    KQueueArrayWrapper.c

vpath %.c $(call NativeSrcDirList,,native/sun/nio/fs)
vpath %.c $(call NativeSrcDirList,,native/sun/nio/ch)

else

352
#
D
duke 已提交
353 354
# Find platform-specific C source files
#
355
vpath %.c $(PLATFORM_SRC)/native/sun/nio/fs
D
duke 已提交
356 357 358
vpath %.c $(PLATFORM_SRC)/native/sun/nio/ch
vpath %.c $(SHARE_SRC)/native/sun/nio/ch

359 360
endif # PLATFORM = macosx

D
duke 已提交
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385
#
# Various variables
#

JAVALIB = 		# Don't self-link

#
# Access to io_util.c and net_util.c
#

OTHER_INCLUDES += \
  -I$(SHARE_SRC)/native/sun/nio/ch \
  -I$(SHARE_SRC)/native/java/io \
  -I$(SHARE_SRC)/native/java/net \
  -I$(PLATFORM_SRC)/native/java/net \
  -I$(CLASSHDRDIR)/../../../java.lang/java/CClassHeaders

ifeq ($(PLATFORM),windows)
  OTHER_LDLIBS += $(JVMLIB) ws2_32.lib \
     -libpath:$(LIBDIR) java.lib \
     $(OBJDIR)/../../../../sun/java.net/net/$(OBJDIRNAME)/net.lib \
     $(OBJDIR)/../../../java.lang/java/$(OBJDIRNAME)/io_util.obj \
     $(OBJDIR)/../../../java.lang/java/$(OBJDIRNAME)/FileDescriptor_md.obj
endif
ifeq ($(PLATFORM), linux)
386 387 388
OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread $(LIBDL)
endif
ifeq ($(PLATFORM), macosx)
389
OTHER_LDLIBS += -L$(LIBDIR) -ljava -lnet -pthread -framework CoreFoundation
D
duke 已提交
390 391
endif
ifeq ($(PLATFORM), solaris)
392
OTHER_LDLIBS += $(JVMLIB) $(LIBSOCKET) -lposix4 $(LIBDL) -lsendfile \
D
duke 已提交
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412
		-L$(LIBDIR)/$(LIBARCH) -ljava -lnet
endif # PLATFORM

#
# Rules
#

build: sources

clean clobber::
	$(RM) -r $(NIO_GEN) $(SNIO_GEN)
	$(RM) -r $(CLASSDESTDIR)/java/nio
	$(RM) -r $(CLASSDESTDIR)/sun/nio

ifeq ($(PLATFORM), solaris)
FILES_m = mapfile-solaris
endif
ifeq ($(PLATFORM), linux)
FILES_m = mapfile-linux
endif
413 414 415
ifeq ($(PLATFORM), macosx)
FILES_m = mapfile-bsd
endif
D
duke 已提交
416 417 418 419 420 421 422
include $(BUILDDIR)/common/Mapfile-vers.gmk
include $(BUILDDIR)/common/Library.gmk

#
# Generate source files
#

423 424
SPP_JARFILE = $(BUILDTOOLJARDIR)/spp.jar
SPP_CMD = $(BOOT_JAVA_CMD) -jar $(SPP_JARFILE)
D
duke 已提交
425 426 427 428 429 430 431 432

FILES_genout = $(FILES_gen:%.java=$(GENSRCDIR)/%.java)

BUF_SRC=$(NIO_SRC)
CH_SRC=$(NIO_SRC)/channels
CS_SRC=$(NIO_SRC)/charset
SCH_SRC=$(SNIO_SRC)/ch
SCS_SRC=$(SNIO_SRC)/cs
433
SFS_SRC=$(SNIO_SRC)/fs
D
duke 已提交
434

435 436 437 438 439 440 441 442 443
# Template files
HEAP_X_BUF_TEMPLATE=$(BUF_SRC)/Heap-X-Buffer.java.template
BYTE_X_BUF_TEMPLATE=$(BUF_SRC)/ByteBufferAs-X-Buffer.java.template
X_BUF_TEMPLATE=$(BUF_SRC)/X-Buffer.java.template
X_BUF_BIN_TEMPLATE=$(BUF_SRC)/X-Buffer-bin.java.template
DIRECT_X_BUF_TEMPLATE=$(BUF_SRC)/Direct-X-Buffer.java.template
DIRECT_X_BUF_BIN_TEMPLATE=$(BUF_SRC)/Direct-X-Buffer-bin.java.template
CHARSET_X_CODER_TEMPLATE=$(CS_SRC)/Charset-X-Coder.java.template

D
duke 已提交
444 445 446 447 448
BUF_GEN=$(NIO_GEN)
CH_GEN=$(NIO_GEN)/channels
CS_GEN=$(NIO_GEN)/charset
SCH_GEN=$(SNIO_GEN)/ch
SCS_GEN=$(SNIO_GEN)/cs
449
SFS_GEN=$(SNIO_GEN)/fs
D
duke 已提交
450

451 452 453
FILES_gensbcs_out = $(FILES_gen_sbcs:%.java=$(GENSRCDIR)/%.java)

sources: $(SPP_JARFILE) $(FILES_genout) $(FILES_gensbcs_out)
D
duke 已提交
454 455 456 457 458 459 460

#
# Generated buffer classes
#

GEN_BUFFER_SH = genBuffer.sh

461
GEN_BUFFER_CMD = SPP="$(SPP_CMD)" NAWK="$(NAWK)" SED="$(SED)" SH="$(SH)" \
D
duke 已提交
462 463 464 465
                 $(SH) $(GEN_BUFFER_SH)

# Public abstract buffer classes
#
466 467
$(BUF_GEN)/ByteBuffer.java: $(X_BUF_TEMPLATE) \
			    $(X_BUF_BIN_TEMPLATE) \
D
duke 已提交
468 469 470 471 472
			    $(GEN_BUFFER_SH)
	$(prep-target)
	@$(RM) $@.temp
	TYPE=byte BIN=1 SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
473
$(BUF_GEN)/CharBuffer.java: $(X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
474 475 476 477
	$(prep-target)
	@$(RM) $@.temp
	TYPE=char SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
478
$(BUF_GEN)/ShortBuffer.java: $(X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
479 480 481 482
	$(prep-target)
	@$(RM) $@.temp
	TYPE=short SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
483
$(BUF_GEN)/IntBuffer.java: $(X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
484 485 486 487
	$(prep-target)
	@$(RM) $@.temp
	TYPE=int SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
488
$(BUF_GEN)/LongBuffer.java: $(X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
489 490 491 492
	$(prep-target)
	@$(RM) $@.temp
	TYPE=long SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
493
$(BUF_GEN)/FloatBuffer.java: $(X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
494 495 496 497
	$(prep-target)
	@$(RM) $@.temp
	TYPE=float SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
498
$(BUF_GEN)/DoubleBuffer.java: $(X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
499 500 501 502 503 504 505
	$(prep-target)
	@$(RM) $@.temp
	TYPE=double SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@

# Buffers whose contents are heap-allocated
# 
506
$(BUF_GEN)/HeapByteBuffer.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
507 508 509 510
	$(prep-target)
	@$(RM) $@.temp
	TYPE=byte SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
511
$(BUF_GEN)/HeapByteBuffer%.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
512 513 514 515
	$(prep-target)
	@$(RM) $@.temp
	TYPE=byte RW=$* SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
516
$(BUF_GEN)/HeapCharBuffer.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
517 518 519 520
	$(prep-target)
	@$(RM) $@.temp
	TYPE=char SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
521
$(BUF_GEN)/HeapCharBuffer%.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
522 523 524 525
	$(prep-target)
	@$(RM) $@.temp
	TYPE=char RW=$* SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
526
$(BUF_GEN)/HeapShortBuffer.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
527 528 529 530
	$(prep-target)
	@$(RM) $@.temp
	TYPE=short SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
531
$(BUF_GEN)/HeapShortBuffer%.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
532 533 534 535
	$(prep-target)
	@$(RM) $@.temp
	TYPE=short RW=$* SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
536
$(BUF_GEN)/HeapIntBuffer.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
537 538 539 540
	$(prep-target)
	@$(RM) $@.temp
	TYPE=int SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
541
$(BUF_GEN)/HeapIntBuffer%.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
542 543 544 545
	$(prep-target)
	@$(RM) $@.temp
	TYPE=int RW=$* SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
546
$(BUF_GEN)/HeapLongBuffer.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
547 548 549 550
	$(prep-target)
	@$(RM) $@.temp
	TYPE=long SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
551
$(BUF_GEN)/HeapLongBuffer%.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
552 553 554 555
	$(prep-target)
	@$(RM) $@.temp
	TYPE=long RW=$* SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
556
$(BUF_GEN)/HeapFloatBuffer.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
557 558 559 560
	$(prep-target)
	@$(RM) $@.temp
	TYPE=float SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
561
$(BUF_GEN)/HeapFloatBuffer%.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
562 563 564 565
	$(prep-target)
	@$(RM) $@.temp
	TYPE=float RW=$* SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
566
$(BUF_GEN)/HeapDoubleBuffer.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
567 568 569 570
	$(prep-target)
	@$(RM) $@.temp
	TYPE=double SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
571
$(BUF_GEN)/HeapDoubleBuffer%.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
572 573 574 575 576 577 578
	$(prep-target)
	@$(RM) $@.temp
	TYPE=double RW=$* SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@

# Direct byte buffer
# 
579 580
$(BUF_GEN)/DirectByteBuffer.java: $(DIRECT_X_BUF_TEMPLATE) \
				  $(DIRECT_X_BUF_TEMPLATE) \
D
duke 已提交
581 582 583 584 585
				  $(GEN_BUFFER_SH)
	$(prep-target)
	@$(RM) $@.temp
	TYPE=byte BIN=1 SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
586 587
$(BUF_GEN)/DirectByteBuffer%.java: $(DIRECT_X_BUF_TEMPLATE) \
				   $(DIRECT_X_BUF_TEMPLATE) \
D
duke 已提交
588 589 590 591 592 593 594 595
				   $(GEN_BUFFER_SH)
	$(prep-target)
	@$(RM) $@.temp
	TYPE=byte RW=$* BIN=1 SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@

# Unswapped views of direct byte buffers
#
596
$(BUF_GEN)/DirectCharBufferU.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
597 598 599 600
	$(prep-target)
	@$(RM) $@.temp
	TYPE=char BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
601
$(BUF_GEN)/DirectCharBuffer%U.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
602 603 604 605
	$(prep-target)
	@$(RM) $@.temp
	TYPE=char RW=$* BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
606
$(BUF_GEN)/DirectShortBufferU.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
607 608 609 610
	$(prep-target)
	@$(RM) $@.temp
	TYPE=short BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
611
$(BUF_GEN)/DirectShortBuffer%U.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
612 613 614 615
	$(prep-target)
	@$(RM) $@.temp
	TYPE=short RW=$* BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
616
$(BUF_GEN)/DirectIntBufferU.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
617 618 619 620
	$(prep-target)
	@$(RM) $@.temp
	TYPE=int BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
621
$(BUF_GEN)/DirectIntBuffer%U.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
622 623 624 625
	$(prep-target)
	@$(RM) $@.temp
	TYPE=int RW=$* BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
626
$(BUF_GEN)/DirectLongBufferU.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
627 628 629 630
	$(prep-target)
	@$(RM) $@.temp
	TYPE=long BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
631
$(BUF_GEN)/DirectLongBuffer%U.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
632 633 634 635
	$(prep-target)
	@$(RM) $@.temp
	TYPE=long RW=$* BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
636
$(BUF_GEN)/DirectFloatBufferU.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
637 638 639 640
	$(prep-target)
	@$(RM) $@.temp
	TYPE=float BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
641
$(BUF_GEN)/DirectFloatBuffer%U.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
642 643 644 645
	$(prep-target)
	@$(RM) $@.temp
	TYPE=float RW=$* BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
646
$(BUF_GEN)/DirectDoubleBufferU.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
647 648 649 650
	$(prep-target)
	@$(RM) $@.temp
	TYPE=double BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
651
$(BUF_GEN)/DirectDoubleBuffer%U.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
652 653 654 655 656 657 658
	$(prep-target)
	@$(RM) $@.temp
	TYPE=double RW=$* BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@

# Swapped views of direct byte buffers
#
659
$(BUF_GEN)/DirectCharBufferS.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
660 661 662 663
	$(prep-target)
	@$(RM) $@.temp
	TYPE=char BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
664
$(BUF_GEN)/DirectCharBuffer%S.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
665 666 667 668
	$(prep-target)
	@$(RM) $@.temp
	TYPE=char RW=$* BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
669
$(BUF_GEN)/DirectShortBufferS.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
670 671 672 673
	$(prep-target)
	@$(RM) $@.temp
	TYPE=short BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
674
$(BUF_GEN)/DirectShortBuffer%S.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
675 676 677 678
	$(prep-target)
	@$(RM) $@.temp
	TYPE=short RW=$* BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
679
$(BUF_GEN)/DirectIntBufferS.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
680 681 682 683
	$(prep-target)
	@$(RM) $@.temp
	TYPE=int BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
684
$(BUF_GEN)/DirectIntBuffer%S.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
685 686 687 688
	$(prep-target)
	@$(RM) $@.temp
	TYPE=int RW=$* BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
689
$(BUF_GEN)/DirectLongBufferS.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
690 691 692 693
	$(prep-target)
	@$(RM) $@.temp
	TYPE=long BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
694
$(BUF_GEN)/DirectLongBuffer%S.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
695 696 697 698
	$(prep-target)
	@$(RM) $@.temp
	TYPE=long RW=$* BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
699
$(BUF_GEN)/DirectFloatBufferS.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
700 701 702 703
	$(prep-target)
	@$(RM) $@.temp
	TYPE=float BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
704
$(BUF_GEN)/DirectFloatBuffer%S.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
705 706 707 708
	$(prep-target)
	@$(RM) $@.temp
	TYPE=float RW=$* BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
709
$(BUF_GEN)/DirectDoubleBufferS.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
710 711 712 713
	$(prep-target)
	@$(RM) $@.temp
	TYPE=double BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
714
$(BUF_GEN)/DirectDoubleBuffer%S.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
715 716 717 718 719 720 721
	$(prep-target)
	@$(RM) $@.temp
	TYPE=double RW=$* BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@

# Big-endian views of byte buffers
#
722
$(BUF_GEN)/ByteBufferAsCharBufferB.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
723 724 725 726
	$(prep-target)
	@$(RM) $@.temp
	TYPE=char BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
727
$(BUF_GEN)/ByteBufferAsCharBuffer%B.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
728 729 730 731
	$(prep-target)
	@$(RM) $@.temp
	TYPE=char RW=$* BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
732
$(BUF_GEN)/ByteBufferAsShortBufferB.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
733 734 735 736
	$(prep-target)
	@$(RM) $@.temp
	TYPE=short BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
737
$(BUF_GEN)/ByteBufferAsShortBuffer%B.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
738 739 740 741
	$(prep-target)
	@$(RM) $@.temp
	TYPE=short RW=$* BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
742
$(BUF_GEN)/ByteBufferAsIntBufferB.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
743 744 745 746
	$(prep-target)
	@$(RM) $@.temp
	TYPE=int BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
747
$(BUF_GEN)/ByteBufferAsIntBuffer%B.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
748 749 750 751
	$(prep-target)
	@$(RM) $@.temp
	TYPE=int RW=$* BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
752
$(BUF_GEN)/ByteBufferAsLongBufferB.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
753 754 755 756
	$(prep-target)
	@$(RM) $@.temp
	TYPE=long BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
757
$(BUF_GEN)/ByteBufferAsLongBuffer%B.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
758 759 760 761
	$(prep-target)
	@$(RM) $@.temp
	TYPE=long RW=$* BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
762
$(BUF_GEN)/ByteBufferAsFloatBufferB.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
763 764 765 766
	$(prep-target)
	@$(RM) $@.temp
	TYPE=float BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
767
$(BUF_GEN)/ByteBufferAsFloatBuffer%B.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
768 769 770 771
	$(prep-target)
	@$(RM) $@.temp
	TYPE=float RW=$* BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
772
$(BUF_GEN)/ByteBufferAsDoubleBufferB.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
773 774 775 776
	$(prep-target)
	@$(RM) $@.temp
	TYPE=double BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
777
$(BUF_GEN)/ByteBufferAsDoubleBuffer%B.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
778 779 780 781 782 783 784
	$(prep-target)
	@$(RM) $@.temp
	TYPE=double RW=$* BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@

# Little-endian views of byte buffers
#
785
$(BUF_GEN)/ByteBufferAsCharBufferL.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
786 787 788 789
	$(prep-target)
	@$(RM) $@.temp
	TYPE=char BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
790
$(BUF_GEN)/ByteBufferAsCharBuffer%L.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
791 792 793 794
	$(prep-target)
	@$(RM) $@.temp
	TYPE=char RW=$* BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
795
$(BUF_GEN)/ByteBufferAsShortBufferL.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
796 797 798 799
	$(prep-target)
	@$(RM) $@.temp
	TYPE=short BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
800
$(BUF_GEN)/ByteBufferAsShortBuffer%L.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
801 802 803 804
	$(prep-target)
	@$(RM) $@.temp
	TYPE=short RW=$* BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
805
$(BUF_GEN)/ByteBufferAsIntBufferL.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
806 807 808 809
	$(prep-target)
	@$(RM) $@.temp
	TYPE=int BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
810
$(BUF_GEN)/ByteBufferAsIntBuffer%L.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
811 812 813 814
	$(prep-target)
	@$(RM) $@.temp
	TYPE=int RW=$* BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
815
$(BUF_GEN)/ByteBufferAsLongBufferL.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
816 817 818 819
	$(prep-target)
	@$(RM) $@.temp
	TYPE=long BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
820
$(BUF_GEN)/ByteBufferAsLongBuffer%L.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
821 822 823 824
	$(prep-target)
	@$(RM) $@.temp
	TYPE=long RW=$* BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
825
$(BUF_GEN)/ByteBufferAsFloatBufferL.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
826 827 828 829
	$(prep-target)
	@$(RM) $@.temp
	TYPE=float BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
830
$(BUF_GEN)/ByteBufferAsFloatBuffer%L.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
831 832 833 834
	$(prep-target)
	@$(RM) $@.temp
	TYPE=float RW=$* BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
835
$(BUF_GEN)/ByteBufferAsDoubleBufferL.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
836 837 838 839
	$(prep-target)
	@$(RM) $@.temp
	TYPE=double BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@
840
$(BUF_GEN)/ByteBufferAsDoubleBuffer%L.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
D
duke 已提交
841 842 843 844 845 846 847 848 849 850 851
	$(prep-target)
	@$(RM) $@.temp
	TYPE=double RW=$* BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
	$(MV) $@.temp $@

#
# Generated coder classes
#

GEN_CODER_SH = genCoder.sh

852
GEN_CODER_CMD = SPP="$(SPP_CMD)" SED="$(SED)" NAWK="$(NAWK)" SH="$(SH)" $(SH) $(GEN_CODER_SH)
D
duke 已提交
853

854
$(CS_GEN)/CharsetDecoder.java: $(CHARSET_X_CODER_TEMPLATE) $(GEN_CODER_SH)
D
duke 已提交
855 856 857 858 859
	$(prep-target)
	@$(RM) $@.temp
	$(GEN_CODER_CMD) decoder $< $@.temp
	$(MV) $@.temp $@

860
$(CS_GEN)/CharsetEncoder.java: $(CHARSET_X_CODER_TEMPLATE) $(GEN_CODER_SH)
D
duke 已提交
861 862 863 864 865 866 867 868 869 870
	$(prep-target)
	@$(RM) $@.temp
	$(GEN_CODER_CMD) encoder $< $@.temp
	$(MV) $@.temp $@

#
# Generated exception classes
#

GEN_EX_SH = genExceptions.sh
871

872
GEN_EX_CMD = NAWK="$(NAWK)" SH="$(SH)" $(SH) $(GEN_EX_SH)
D
duke 已提交
873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898

$(CH_GEN)/%Exception.java: genExceptions.sh $(CH_SRC)/exceptions
	$(prep-target)
	@$(RM) $@.temp
	$(GEN_EX_CMD) $(CH_SRC)/exceptions $(CH_GEN)

$(CS_GEN)/%Exception.java: genExceptions.sh $(CS_SRC)/exceptions
	$(prep-target)
	@$(RM) $@.temp
	$(GEN_EX_CMD) $(CS_SRC)/exceptions $(CS_GEN)

$(BUF_GEN)/%Exception.java: genExceptions.sh $(BUF_SRC)/exceptions
	$(prep-target)
	@$(RM) $@.temp
	$(GEN_EX_CMD) $(BUF_SRC)/exceptions $(BUF_GEN)

#
# Generated charset-provider classes
#

HASHER_JARFILE = $(BUILDTOOLJARDIR)/hasher.jar

$(SCS_GEN)/StandardCharsets.java: genCharsetProvider.sh \
    $(HASHER_JARFILE) $(SCS_SRC)/standard-charsets
	$(prep-target)
	@$(RM) $@.temp
899
	NAWK="$(NAWK)" TEMPDIR="$(TEMPDIR)" SH="$(SH)" \
D
duke 已提交
900
	  HASHER="$(BOOT_JAVA_CMD) -jar $(HASHER_JARFILE)" \
901
	  $(SH) -e genCharsetProvider.sh $(SCS_SRC)/standard-charsets $(SCS_GEN)
D
duke 已提交
902

903 904 905 906 907 908 909 910 911 912
#
# Generated channel implementation classes.
# C source is compiled in TEMPDIR to avoid turds left by Windows compilers.
#

GENSOR_SRC = $(SHARE_SRC)/native/sun/nio/ch/genSocketOptionRegistry.c

GENSOR_EXE = $(TEMPDIR)/genSocketOptionRegistry$(EXE_SUFFIX)

SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSOR_SRC) | \
913
	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 
914 915

$(TEMPDIR)/$(GENSOR_SRC) : $(GENSOR_SRC)
916
	$(install-file)
917

918 919 920 921 922 923
ifeq ($(PLATFORM), macosx)
  NIO_CC=$(HOST_CC)
else
  NIO_CC=$(CC)
endif

924 925
$(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC)
	$(prep-target)
926
	($(CD) $(TEMPDIR); $(NIO_CC) $(CPPFLAGS) $(LDDFLAGS) \
927 928
	   -o genSocketOptionRegistry$(EXE_SUFFIX) $(GENSOR_SRC))

929 930 931 932 933
ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
$(SCH_GEN)/SocketOptionRegistry.java: $(NIO_PLATFORM_CLASSES_ROOT_DIR)/sun/nio/ch/SocketOptionRegistry-$(PLATFORM)-$(ARCH).java
	$(prep-target)
	$(CP) $< $@
else 
934 935
$(SCH_GEN)/SocketOptionRegistry.java: $(GENSOR_EXE)
	$(prep-target)
936
	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@
937
	$(GENSOR_EXE) >> $@
938
endif
939 940 941 942 943 944
#
# Generated sun.nio.cs SingleByte classes
#
GENCSSRC = $(BUILDDIR)/tools/CharsetMapping
CHARSETMAPPING_JARFILE = $(BUILDTOOLJARDIR)/charsetmapping.jar

945
$(FILES_gensbcs_out): $(GENCSSRC)/SingleByte-X.java.template $(GENCSSRC)/sbcs
946
	@$(prep-target)
947
	$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSSRC) $(SCS_GEN) sbcs
948

949 950 951 952 953 954
# 
# Generated file system implementation classes (Unix only)
#

GENUC_SRC = $(PLATFORM_SRC)/native/sun/nio/fs/genUnixConstants.c

955
GENUC_OBJ = $(TEMPDIR)/genUnixConstants.o
956 957 958
GENUC_EXE = $(TEMPDIR)/genUnixConstants

GENUC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENUC_SRC) | \
959
	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
960 961 962

$(GENUC_EXE) : $(GENUC_SRC)
	$(prep-target)
963 964
	$(CC) $(CPPFLAGS) -c -o $(GENUC_OBJ) $(GENUC_SRC)
	$(CC) $(CPPFLAGS) -o $@ $(GENUC_OBJ)
965

966 967 968 969 970
ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
$(SFS_GEN)/UnixConstants.java: $(NIO_PLATFORM_CLASSES_ROOT_DIR)/sun/nio/fs/UnixConstants-$(PLATFORM)-$(ARCH).java
	$(prep-target)
	$(CP) $< $@
else
971 972
$(SFS_GEN)/UnixConstants.java: $(GENUC_EXE)
	$(prep-target)
973
	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh "$(GENUC_COPYRIGHT_YEARS)" > $@
974
	$(GENUC_EXE) >> $@
975
endif
976 977 978

GENSC_SRC = $(PLATFORM_SRC)/native/sun/nio/fs/genSolarisConstants.c

979
GENSC_OBJ = $(TEMPDIR)/genSolarisConstants.o
980 981 982
GENSC_EXE = $(TEMPDIR)/genSolarisConstants

GENSC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSC_SRC) | \
983
	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
984 985 986

$(GENSC_EXE) : $(GENSC_SRC)
	$(prep-target)
987 988
	$(CC) $(CPPFLAGS) -c -o $(GENSC_OBJ) $(GENSC_SRC)
	$(CC) $(CPPFLAGS) -o $@ $(GENSC_OBJ)
989

990 991 992 993 994
ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
$(SFS_GEN)/SolarisConstants.java: $(NIO_PLATFORM_CLASSES_ROOT_DIR)/sun/nio/fs/SolarisConstants-$(PLATFORM)-$(ARCH).java
	$(prep-target)
	$(CP) $< $@
else
995 996
$(SFS_GEN)/SolarisConstants.java: $(GENSC_EXE)
	$(prep-target)
997
	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh "$(GENSC_COPYRIGHT_YEARS)" > $@
998
	$(GENSC_EXE) >> $@
999
endif
1000

D
duke 已提交
1001
.PHONY: sources