| 1 | #
|
|---|
| 2 | # Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
|---|
| 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|---|
| 4 | #
|
|---|
| 5 | # This code is free software; you can redistribute it and/or modify it
|
|---|
| 6 | # under the terms of the GNU General Public License version 2 only, as
|
|---|
| 7 | # published by the Free Software Foundation. Oracle designates this
|
|---|
| 8 | # particular file as subject to the "Classpath" exception as provided
|
|---|
| 9 | # by Oracle in the LICENSE file that accompanied this code.
|
|---|
| 10 | #
|
|---|
| 11 | # This code is distributed in the hope that it will be useful, but WITHOUT
|
|---|
| 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|---|
| 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|---|
| 14 | # version 2 for more details (a copy is included in the LICENSE file that
|
|---|
| 15 | # accompanied this code).
|
|---|
| 16 | #
|
|---|
| 17 | # You should have received a copy of the GNU General Public License version
|
|---|
| 18 | # 2 along with this work; if not, write to the Free Software Foundation,
|
|---|
| 19 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|---|
| 20 | #
|
|---|
| 21 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|---|
| 22 | # or visit www.oracle.com if you need additional information or have any
|
|---|
| 23 | # questions.
|
|---|
| 24 | #
|
|---|
| 25 |
|
|---|
| 26 | BUILDDIR = ../..
|
|---|
| 27 | PACKAGE = javax.sound
|
|---|
| 28 | LIBRARY = jsound
|
|---|
| 29 | PRODUCT = sun
|
|---|
| 30 | include $(BUILDDIR)/common/Defs.gmk
|
|---|
| 31 |
|
|---|
| 32 | # include defines for sound
|
|---|
| 33 | include SoundDefs.gmk
|
|---|
| 34 |
|
|---|
| 35 | # support for different mixer provider files on different platforms
|
|---|
| 36 | #MXSP = javax.sound.sampled.spi.MixerProvider
|
|---|
| 37 | # Mixer Service Provider Additional path
|
|---|
| 38 | #MXSPP_ADD =
|
|---|
| 39 |
|
|---|
| 40 | #
|
|---|
| 41 | # Add use of mapfile
|
|---|
| 42 | #
|
|---|
| 43 | FILES_m = mapfile-vers
|
|---|
| 44 | include $(BUILDDIR)/common/Mapfile-vers.gmk
|
|---|
| 45 |
|
|---|
| 46 | #
|
|---|
| 47 | # Files
|
|---|
| 48 | #
|
|---|
| 49 | include FILES_c.gmk
|
|---|
| 50 |
|
|---|
| 51 | # add java files
|
|---|
| 52 | AUTO_FILES_JAVA_DIRS = javax/sound com/sun/media/sound
|
|---|
| 53 |
|
|---|
| 54 | #
|
|---|
| 55 | # Files that just need cp.
|
|---|
| 56 | #
|
|---|
| 57 | SERVICEDIR = $(CLASSBINDIR)/META-INF/services
|
|---|
| 58 |
|
|---|
| 59 | FILES_copy = \
|
|---|
| 60 | $(SERVICEDIR)/javax.sound.midi.spi.MidiDeviceProvider \
|
|---|
| 61 | $(SERVICEDIR)/javax.sound.midi.spi.MidiFileWriter \
|
|---|
| 62 | $(SERVICEDIR)/javax.sound.midi.spi.MidiFileReader \
|
|---|
| 63 | $(SERVICEDIR)/javax.sound.midi.spi.SoundbankReader \
|
|---|
| 64 | $(SERVICEDIR)/javax.sound.sampled.spi.AudioFileWriter \
|
|---|
| 65 | $(SERVICEDIR)/javax.sound.sampled.spi.AudioFileReader \
|
|---|
| 66 | $(SERVICEDIR)/javax.sound.sampled.spi.FormatConversionProvider \
|
|---|
| 67 | $(SERVICEDIR)/javax.sound.sampled.spi.MixerProvider \
|
|---|
| 68 | $(LIBDIR)/sound.properties
|
|---|
| 69 |
|
|---|
| 70 | FILES_mkdirs = \
|
|---|
| 71 | $(CLASSBINDIR)/META-INF \
|
|---|
| 72 | $(CLASSBINDIR)/META-INF/services
|
|---|
| 73 |
|
|---|
| 74 | FILES_copydirs = \
|
|---|
| 75 | $(CLASSBINDIR) \
|
|---|
| 76 | $(LIBDIR) \
|
|---|
| 77 | $(FILES_mkdirs)
|
|---|
| 78 |
|
|---|
| 79 | FILES_c += $(FILES_$(PLATFORM))
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 | #
|
|---|
| 83 | # system dependent flags
|
|---|
| 84 | #
|
|---|
| 85 | ifeq ($(PLATFORM), windows)
|
|---|
| 86 | CPPFLAGS += -DUSE_PLATFORM_MIDI_OUT=TRUE \
|
|---|
| 87 | -DUSE_PLATFORM_MIDI_IN=TRUE \
|
|---|
| 88 | -DUSE_PORTS=TRUE
|
|---|
| 89 | LDLIBS += winmm.lib
|
|---|
| 90 |
|
|---|
| 91 | # Windows always provides MIDI and ports
|
|---|
| 92 | INCLUDE_MIDI = TRUE
|
|---|
| 93 | INCLUDE_PORTS = TRUE
|
|---|
| 94 |
|
|---|
| 95 | # DirectSound handles directaudio (both i586 and amd64)
|
|---|
| 96 | SUBDIRS += jsoundds
|
|---|
| 97 | EXTRA_SOUND_JNI_LIBS += jsoundds
|
|---|
| 98 | #MXSPP_ADD = $(PLATFORM)-$(ARCH)/
|
|---|
| 99 | endif # PLATFORM win32
|
|---|
| 100 |
|
|---|
| 101 | ifeq ($(PLATFORM), os2)
|
|---|
| 102 | CPPFLAGS += -DUSE_PLATFORM_MIDI_OUT=TRUE \
|
|---|
| 103 | -DUSE_PLATFORM_MIDI_IN=TRUE \
|
|---|
| 104 | -DUSE_PORTS=TRUE
|
|---|
| 105 | LDLIBS += -lwinmm.lib
|
|---|
| 106 |
|
|---|
| 107 | # Odin32 always provides MIDI and ports
|
|---|
| 108 | INCLUDE_MIDI = TRUE
|
|---|
| 109 | INCLUDE_PORTS = TRUE
|
|---|
| 110 |
|
|---|
| 111 | # DirectSound handles directaudio (both i586 and amd64)
|
|---|
| 112 | SUBDIRS += jsoundds
|
|---|
| 113 | EXTRA_SOUND_JNI_LIBS += jsoundds
|
|---|
| 114 | #MXSPP_ADD = $(PLATFORM)-$(ARCH)/
|
|---|
| 115 | endif # PLATFORM os2
|
|---|
| 116 |
|
|---|
| 117 | ifeq ($(PLATFORM), linux)
|
|---|
| 118 | # ALSA handles directaudio, ports, and MIDI
|
|---|
| 119 | SUBDIRS += jsoundalsa
|
|---|
| 120 | EXTRA_SOUND_JNI_LIBS += jsoundalsa
|
|---|
| 121 | #MXSPP_ADD = $(PLATFORM)-$(ARCH)/
|
|---|
| 122 | endif # PLATFORM linux
|
|---|
| 123 |
|
|---|
| 124 | ifeq ($(PLATFORM), solaris)
|
|---|
| 125 | ifneq ($(ARCH), amd64)
|
|---|
| 126 | # build with ports and direct audio
|
|---|
| 127 | CPPFLAGS += -DUSE_PORTS=TRUE \
|
|---|
| 128 | -DUSE_DAUDIO=TRUE
|
|---|
| 129 |
|
|---|
| 130 | INCLUDE_PORTS = TRUE
|
|---|
| 131 | INCLUDE_DAUDIO = TRUE
|
|---|
| 132 | INCLUDE_MIDI = TRUE
|
|---|
| 133 | else
|
|---|
| 134 | # build with empty MIDI i/o
|
|---|
| 135 | INCLUDE_MIDI = TRUE
|
|---|
| 136 | # build with empty ports
|
|---|
| 137 | INCLUDE_PORTS = TRUE
|
|---|
| 138 | # build with empty direct audio
|
|---|
| 139 | INCLUDE_DAUDIO = TRUE
|
|---|
| 140 | endif
|
|---|
| 141 | endif # PLATFORM solaris
|
|---|
| 142 |
|
|---|
| 143 | # for dynamic inclusion of extra sound libs: these
|
|---|
| 144 | # JNI libs will be loaded from Platform.java
|
|---|
| 145 | CPPFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
|
|---|
| 146 |
|
|---|
| 147 | # integrate MIDI i/o in jsound lib
|
|---|
| 148 | ifeq ($(INCLUDE_MIDI),TRUE)
|
|---|
| 149 | FILES_c += $(MIDIFILES_c)
|
|---|
| 150 | FILES_export += $(MIDIFILES_export)
|
|---|
| 151 | endif
|
|---|
| 152 |
|
|---|
| 153 | # integrate port files in jsound lib
|
|---|
| 154 | ifeq ($(INCLUDE_PORTS),TRUE)
|
|---|
| 155 | FILES_c += $(PORTFILES_c)
|
|---|
| 156 | FILES_export += $(PORTFILES_export)
|
|---|
| 157 | endif
|
|---|
| 158 |
|
|---|
| 159 | # integrate port files in jsound lib
|
|---|
| 160 | ifeq ($(INCLUDE_DAUDIO),TRUE)
|
|---|
| 161 | FILES_c += $(DAUDIOFILES_c)
|
|---|
| 162 | FILES_export += $(DAUDIOFILES_export)
|
|---|
| 163 | endif
|
|---|
| 164 |
|
|---|
| 165 | #
|
|---|
| 166 | # Extra cc/linker flags.
|
|---|
| 167 | #
|
|---|
| 168 | CPPFLAGS += \
|
|---|
| 169 | -I$(SHARE_SRC)/native/com/sun/media/sound
|
|---|
| 170 |
|
|---|
| 171 | #
|
|---|
| 172 | # Add to the ambient VPATH.
|
|---|
| 173 | #
|
|---|
| 174 | vpath %.c $(SHARE_SRC)/native/com/sun/media/sound
|
|---|
| 175 | vpath %.c $(PLATFORM_SRC)/native/com/sun/media/sound
|
|---|
| 176 | vpath %.cpp $(PLATFORM_SRC)/native/com/sun/media/sound
|
|---|
| 177 |
|
|---|
| 178 |
|
|---|
| 179 | #
|
|---|
| 180 | # Include rules
|
|---|
| 181 | #
|
|---|
| 182 | include $(BUILDDIR)/common/Library.gmk
|
|---|
| 183 |
|
|---|
| 184 | #
|
|---|
| 185 | # Rules that copy files.
|
|---|
| 186 | #
|
|---|
| 187 |
|
|---|
| 188 | build: copy-files
|
|---|
| 189 | $(SUBDIRS-loop)
|
|---|
| 190 |
|
|---|
| 191 | copy-files: $(FILES_copy)
|
|---|
| 192 |
|
|---|
| 193 | #$(SERVICEDIR)/$(MXSP): $(SHARE_SRC)/classes/com/sun/media/sound/services/$(MXSPP_ADD)$(MXSP)
|
|---|
| 194 | # $(install-file)
|
|---|
| 195 |
|
|---|
| 196 | $(SERVICEDIR)/%: $(SHARE_SRC)/classes/com/sun/media/sound/services/%
|
|---|
| 197 | $(install-file)
|
|---|
| 198 |
|
|---|
| 199 | $(LIBDIR)/audio/%: $(SHARE_SRC)/lib/audio/%
|
|---|
| 200 | $(install-file)
|
|---|
| 201 |
|
|---|
| 202 | $(LIBDIR)/%: $(SHARE_SRC)/lib/%
|
|---|
| 203 | $(install-file)
|
|---|
| 204 |
|
|---|
| 205 | #
|
|---|
| 206 | # Since we build more than the javax.sound (as stated in the
|
|---|
| 207 | # PACKAGE variable), we need to nuke the extra packages explicitly.
|
|---|
| 208 | #
|
|---|
| 209 | clean clobber::
|
|---|
| 210 | $(SUBDIRS-loop)
|
|---|
| 211 |
|
|---|
| 212 | clean clobber::
|
|---|
| 213 | $(RM) -r $(CLASSBINDIR)/com/sun/media/sound $(LIBDIR)/audio
|
|---|
| 214 | $(RM) $(FILES_copy)
|
|---|
| 215 |
|
|---|
| 216 | #
|
|---|
| 217 | # Declare extra phony targets.
|
|---|
| 218 | #
|
|---|
| 219 | .PHONY: copy-files
|
|---|