1 #
   2 # Copyright (c) 1999, 2007, 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 MODULE  = sound
  28 PACKAGE = javax.sound
  29 LIBRARY = jsound
  30 PRODUCT = sun
  31 include $(BUILDDIR)/common/Defs.gmk
  32 
  33 # include defines for sound
  34 include SoundDefs.gmk
  35 
  36 # support for different mixer provider files on different platforms
  37 #MXSP = javax.sound.sampled.spi.MixerProvider
  38 # Mixer Service Provider Additional path
  39 #MXSPP_ADD =
  40 
  41 #
  42 # Add use of mapfile
  43 #
  44 FILES_m = mapfile-vers
  45 include $(BUILDDIR)/common/Mapfile-vers.gmk
  46 
  47 #
  48 # Files
  49 #
  50 include FILES_c.gmk
  51 
  52 # add java files
  53 AUTO_FILES_JAVA_DIRS = javax/sound com/sun/media/sound
  54 
  55 #
  56 # Files that just need cp.
  57 #
  58 SERVICEDIR = $(CLASSBINDIR)/META-INF/services
  59 
  60 FILES_copy = \
  61         $(SERVICEDIR)/javax.sound.midi.spi.MidiDeviceProvider \
  62         $(SERVICEDIR)/javax.sound.midi.spi.MidiFileWriter \
  63         $(SERVICEDIR)/javax.sound.midi.spi.MidiFileReader \
  64         $(SERVICEDIR)/javax.sound.midi.spi.SoundbankReader \
  65         $(SERVICEDIR)/javax.sound.sampled.spi.AudioFileWriter \
  66         $(SERVICEDIR)/javax.sound.sampled.spi.AudioFileReader \
  67         $(SERVICEDIR)/javax.sound.sampled.spi.FormatConversionProvider \
  68         $(SERVICEDIR)/javax.sound.sampled.spi.MixerProvider \
  69         $(LIBDIR)/sound.properties
  70 
  71 FILES_mkdirs = \
  72         $(CLASSBINDIR)/META-INF \
  73         $(CLASSBINDIR)/META-INF/services
  74 
  75 FILES_copydirs = \
  76         $(CLASSBINDIR) \
  77         $(LIBDIR) \
  78         $(FILES_mkdirs)
  79 
  80 FILES_c += $(FILES_$(PLATFORM))
  81 
  82 
  83 #
  84 # system dependent flags
  85 #
  86 ifeq ($(PLATFORM), windows)
  87   CPPFLAGS +=   -DUSE_PLATFORM_MIDI_OUT=TRUE \
  88                 -DUSE_PLATFORM_MIDI_IN=TRUE \
  89                 -DUSE_PORTS=TRUE
  90   LDLIBS += winmm.lib
  91 
  92   # Windows always provides MIDI and ports
  93   INCLUDE_MIDI  = TRUE
  94   INCLUDE_PORTS = TRUE
  95 
  96   # DirectSound handles directaudio (both i586 and amd64)
  97   SUBDIRS += jsoundds
  98   EXTRA_SOUND_JNI_LIBS += jsoundds
  99   #MXSPP_ADD = $(PLATFORM)-$(ARCH)/
 100 endif # PLATFORM win32
 101 
 102 ifeq ($(PLATFORM), linux)
 103   # ALSA handles directaudio, ports, and MIDI
 104   SUBDIRS += jsoundalsa
 105   EXTRA_SOUND_JNI_LIBS += jsoundalsa
 106   #MXSPP_ADD = $(PLATFORM)-$(ARCH)/
 107 endif # PLATFORM linux
 108 
 109 ifeq ($(PLATFORM), solaris)
 110   # build with ports and direct audio
 111   CPPFLAGS += -DUSE_PORTS=TRUE  \
 112               -DUSE_DAUDIO=TRUE
 113 
 114   INCLUDE_PORTS = TRUE
 115   INCLUDE_DAUDIO = TRUE
 116   # build with empty MIDI i/o
 117   INCLUDE_MIDI = TRUE
 118 endif # PLATFORM solaris
 119 
 120 # for dynamic inclusion of extra sound libs: these
 121 # JNI libs will be loaded from Platform.java
 122 CPPFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
 123 
 124 # integrate MIDI i/o in jsound lib
 125 ifeq ($(INCLUDE_MIDI),TRUE)
 126   FILES_c += $(MIDIFILES_c)
 127   FILES_export += $(MIDIFILES_export)
 128 endif
 129 
 130 # integrate port files in jsound lib
 131 ifeq ($(INCLUDE_PORTS),TRUE)
 132   FILES_c += $(PORTFILES_c)
 133   FILES_export += $(PORTFILES_export)
 134 endif
 135 
 136 # integrate port files in jsound lib
 137 ifeq ($(INCLUDE_DAUDIO),TRUE)
 138   FILES_c += $(DAUDIOFILES_c)
 139   FILES_export += $(DAUDIOFILES_export)
 140 endif
 141 
 142 #
 143 # Extra cc/linker flags.
 144 #
 145 CPPFLAGS += \
 146         -I$(SHARE_SRC)/native/com/sun/media/sound
 147 
 148 #
 149 # Add to the ambient VPATH.
 150 #
 151 vpath %.c $(SHARE_SRC)/native/com/sun/media/sound
 152 vpath %.c $(PLATFORM_SRC)/native/com/sun/media/sound
 153 vpath %.cpp $(PLATFORM_SRC)/native/com/sun/media/sound
 154 
 155 
 156 #
 157 # Include rules
 158 #
 159 include $(BUILDDIR)/common/Library.gmk
 160 include $(BUILDDIR)/common/Subdirs.gmk
 161 
 162 #
 163 # Rules that copy files.
 164 #
 165 
 166 build: copy-files
 167         $(SUBDIRS-loop)
 168 
 169 copy-files: $(FILES_copy)
 170 
 171 #$(SERVICEDIR)/$(MXSP): $(SHARE_SRC)/classes/com/sun/media/sound/services/$(MXSPP_ADD)$(MXSP)
 172 #       $(install-file)
 173 
 174 $(SERVICEDIR)/%: $(SHARE_SRC)/classes/com/sun/media/sound/services/%
 175         $(install-file)
 176 
 177 $(LIBDIR)/audio/%: $(SHARE_SRC)/lib/audio/%
 178         $(install-file)
 179 
 180 $(LIBDIR)/%: $(SHARE_SRC)/lib/%
 181         $(install-file)
 182 
 183 #
 184 # Since we build more than the javax.sound (as stated in the
 185 # PACKAGE variable), we need to nuke the extra packages explicitly.
 186 #
 187 clean clobber::
 188         $(SUBDIRS-loop)
 189 
 190 clean clobber::
 191         $(RM) -r $(CLASSBINDIR)/com/sun/media/sound $(LIBDIR)/audio
 192         $(RM) $(FILES_copy)
 193 
 194 #
 195 # Declare extra phony targets.
 196 #
 197 .PHONY: copy-files