modules/media/src/main/native/jfxmedia/projects/mac/Makefile

Print this page
rev 7591 : RT-38074: [macosx] Separate QTKit platform code from core media code so it can be removed for MAS
Reviewed-by:
   1 #
   2 # MacOs jfxmedia makefile
   3 #
   4 


   5 BUILD_DIR = $(OUTPUT_DIR)/$(BUILD_TYPE)
   6 TARGET_DIRS = $(BUILD_DIR)
   7 
   8 SRCBASE_DIR = ../..
   9 OBJBASE_DIR = $(BUILD_DIR)/obj/jfxmedia
  10 
  11 BASE_DIR = ../../..
  12 GSTREAMER_LITE_DIR = $(BASE_DIR)/gstreamer/gstreamer-lite
  13 GLIB_LITE_DIR = $(BASE_DIR)/gstreamer/3rd_party/glib/glib-2.28.8
  14 
  15 DIRLIST = MediaManagement    \
  16           Locator            \
  17           PipelineManagement \
  18           jni                \
  19           Utils              \
  20           Utils/posix        \
  21           platform/gstreamer \
  22           platform/osx       \
  23           Projects/utils
  24 
  25 TARGET_NAME = lib$(BASE_NAME).dylib
  26 TARGET = $(BUILD_DIR)/$(TARGET_NAME)
  27 


  28 CFLAGS = -arch x86_64 \

  29          -fPIC                     \
  30          -Werror=implicit-function-declaration \
  31          -DTARGET_OS_MAC=1         \
  32          -D_GNU_SOURCE             \
  33          -DGST_REMOVE_DEPRECATED   \
  34          -DGST_DISABLE_GST_DEBUG   \
  35          -DGST_DISABLE_LOADSAVE    \
  36          -DGST_DISABLE_XML         \
  37          -DHAVE_CONFIG_H           \
  38          -DJFXMEDIA_JNI_EXPORTS    \
  39          -DGSTREAMER_LITE          \
  40          -msse2                    \
  41          -mmacosx-version-min=10.7
  42 
  43 ifeq ($(BUILD_TYPE), release)
  44     CFLAGS += -Os
  45 else
  46     CFLAGS += -O0 -g -Wall
  47 endif
  48 
  49 BASE_INCLUDES = -I$(JAVA_HOME)/include \
  50                 -I$(JAVA_HOME)/include/darwin \
  51                 -I$(SRCBASE_DIR) \
  52                 -I$(SRCBASE_DIR)/jni \
  53                 -I$(GENERATED_HEADERS_DIR)
  54 
  55 INCLUDES = $(BASE_INCLUDES) \
  56            -I$(GLIB_LITE_DIR)/ \
  57            -I$(GLIB_LITE_DIR)/glib \
  58            -I$(GLIB_LITE_DIR)/gmodule \
  59            -I$(GLIB_LITE_DIR)/build/osx \
  60            -I$(GSTREAMER_LITE_DIR)/gstreamer \
  61            -I$(GSTREAMER_LITE_DIR)/gst-plugins-base/gst-libs \
  62            -I$(GSTREAMER_LITE_DIR)/gstreamer/libs
  63 
  64 LDFLAGS = -mmacosx-version-min=10.7 -arch x86_64 \
  65           -L$(BUILD_DIR) -Wl,-install_name,@rpath/$(TARGET_NAME) \
  66           -lgstreamer-lite -lglib-lite -lobjc \
  67           -framework CoreVideo -framework CoreAudio -framework QTKit \
  68           -framework Cocoa -framework Carbon -framework CoreServices -framework JavaVM




  69 
  70 CPP_SOURCES =                                                  \
  71               MediaManagement/Media.cpp                        \
  72               MediaManagement/MediaManager.cpp                 \
  73               Locator/Locator.cpp                              \
  74               Locator/LocatorStream.cpp                        \
  75               PipelineManagement/Pipeline.cpp                  \
  76               PipelineManagement/PipelineFactory.cpp           \
  77               PipelineManagement/VideoFrame.cpp                \
  78               PipelineManagement/Track.cpp                     \
  79               PipelineManagement/AudioTrack.cpp                \
  80               PipelineManagement/VideoTrack.cpp                \
  81               PipelineManagement/SubtitleTrack.cpp             \
  82               jni/JavaPlayerEventDispatcher.cpp                \
  83               jni/JniUtils.cpp                                 \
  84               jni/com_sun_media_jfxmedia_logging_Logger.cpp    \
  85               jni/Logger.cpp                                   \
  86               jni/JavaMediaWarningListener.cpp                 \
  87               jni/JavaInputStreamCallbacks.cpp                 \
  88               jni/JavaBandsHolder.cpp                          \
  89               jni/NativeVideoBuffer.cpp                        \
  90               Utils/MediaWarningDispatcher.cpp                 \
  91               Utils/LowLevelPerf.cpp                           \
  92               Utils/posix/posix_critical_section.cpp           \
  93               platform/gstreamer/GstAudioEqualizer.cpp         \
  94               platform/gstreamer/GstAudioPlaybackPipeline.cpp  \
  95               platform/gstreamer/GstAudioSpectrum.cpp          \
  96               platform/gstreamer/GstAVPlaybackPipeline.cpp     \
  97               platform/gstreamer/GstElementContainer.cpp       \
  98               platform/gstreamer/GstJniUtils.cpp               \
  99               platform/gstreamer/GstMediaManager.cpp           \
 100               platform/gstreamer/GstPipelineFactory.cpp        \
 101               platform/gstreamer/GstVideoFrame.cpp             \
 102               platform/gstreamer/GstPlatform.cpp               \
 103               platform/gstreamer/GstEqualizerBand.cpp          \
 104               platform/gstreamer/GstMedia.cpp                  \
 105               platform/gstreamer/GstMediaPlayer.cpp            \
 106 
 107 C_SOURCES =   Utils/ColorConverter.c
 108 
 109 OBJCMM_SOURCES =                                               \
 110               platform/osx/OSXPlatform.mm                      \
 111               platform/osx/OSXMediaPlayer.mm                   \
 112               platform/osx/QTKMediaPlayer.mm                   \
 113               platform/osx/CVVideoFrame.mm
 114 
 115 OBJCM_SOURCES =                                                \
 116               Utils/JObjectPeers.m                             \
 117               Utils/JavaUtils.m                                \
 118               Utils/MTObjectProxy.m
 119 




 120 OBJ_DIRS = $(addprefix $(OBJBASE_DIR)/,$(DIRLIST))


 121 OBJECTS  = $(patsubst %.cpp,$(OBJBASE_DIR)/%.o,$(CPP_SOURCES)) \
 122            $(patsubst %.c,$(OBJBASE_DIR)/%.o,$(C_SOURCES)) \
 123            $(patsubst %.mm,$(OBJBASE_DIR)/%.o,$(OBJCMM_SOURCES)) \
 124            $(patsubst %.m,$(OBJBASE_DIR)/%.o,$(OBJCM_SOURCES))
 125 
 126 .PHONY: default

 127 
 128 default: $(TARGET)
 129 




 130 $(OBJBASE_DIR)/%.o: $(SRCBASE_DIR)/%.cpp
 131         $(CC) $(CFLAGS) $(INCLUDES) -x c++ -c $< -o $@
 132 
 133 $(OBJBASE_DIR)/%.o: $(SRCBASE_DIR)/%.c
 134         $(CC) $(CFLAGS) $(INCLUDES) -x c -c $< -o $@
 135 
 136 $(OBJBASE_DIR)/%.o: $(SRCBASE_DIR)/%.mm
 137         $(CC) $(CFLAGS) $(INCLUDES) -x objective-c++ -c $< -o $@
 138 
 139 $(OBJBASE_DIR)/%.o: $(SRCBASE_DIR)/%.m
 140         $(CC) $(CFLAGS) $(INCLUDES) -x objective-c -c $< -o $@
 141 
 142 $(OBJECTS): | $(OBJ_DIRS) $(TARGET_DIRS)
 143 
 144 $(OBJ_DIRS):
 145         mkdir -p $(OBJ_DIRS)
 146 
 147 $(TARGET_DIRS):
 148         mkdir -p $(TARGET_DIRS)
 149 
 150 $(TARGET): $(OBJECTS)
 151         $(LINK) -dynamiclib $(OBJECTS) $(LDFLAGS) -o $@
 152 
   1 #
   2 # Mac OS X jfxmedia makefile
   3 #
   4 
   5 # OUTPUT_DIR, BUILD_TYPE and BASE_NAME are passed on the command line or from the 
   6 # parent make process
   7 BUILD_DIR = $(OUTPUT_DIR)/$(BUILD_TYPE)
   8 TARGET_DIRS = $(BUILD_DIR)
   9 
  10 SRCBASE_DIR = ../..
  11 OBJBASE_DIR = $(BUILD_DIR)/obj/jfxmedia
  12 
  13 BASE_DIR = ../../..
  14 GSTREAMER_LITE_DIR = $(BASE_DIR)/gstreamer/gstreamer-lite
  15 GLIB_LITE_DIR = $(BASE_DIR)/gstreamer/3rd_party/glib/glib-2.28.8
  16 
  17 DIRLIST = MediaManagement    \
  18           Locator            \
  19           PipelineManagement \
  20           jni                \
  21           Utils              \
  22           Utils/posix        \
  23           platform/gstreamer \
  24           platform/osx       \
  25           Projects/utils
  26 
  27 TARGET_NAME = lib$(BASE_NAME).dylib
  28 TARGET = $(BUILD_DIR)/$(TARGET_NAME)
  29 
  30 QTMEDIA = $(BUILD_DIR)/lib$(TARGET_NAME)_qtkit.dylib
  31 
  32 CFLAGS = -arch x86_64 \
  33          -pipe \
  34          -fPIC                     \
  35          -Werror=implicit-function-declaration \
  36          -DTARGET_OS_MAC=1         \
  37          -D_GNU_SOURCE             \
  38          -DGST_REMOVE_DEPRECATED   \
  39          -DGST_DISABLE_GST_DEBUG   \
  40          -DGST_DISABLE_LOADSAVE    \
  41          -DGST_DISABLE_XML         \
  42          -DHAVE_CONFIG_H           \
  43          -DJFXMEDIA_JNI_EXPORTS    \
  44          -DGSTREAMER_LITE          \
  45          -msse2                    \
  46          -mmacosx-version-min=10.7
  47 
  48 ifeq ($(BUILD_TYPE), release)
  49     CFLAGS += -Os
  50 else
  51     CFLAGS += -O0 -g -Wall
  52 endif
  53 
  54 BASE_INCLUDES = -I$(JAVA_HOME)/include \
  55                 -I$(JAVA_HOME)/include/darwin \
  56                 -I$(SRCBASE_DIR) \
  57                 -I$(SRCBASE_DIR)/jni \
  58                 -I$(GENERATED_HEADERS_DIR)
  59 
  60 INCLUDES = $(BASE_INCLUDES) \
  61            -I$(GLIB_LITE_DIR)/ \
  62            -I$(GLIB_LITE_DIR)/glib \
  63            -I$(GLIB_LITE_DIR)/gmodule \
  64            -I$(GLIB_LITE_DIR)/build/osx \
  65            -I$(GSTREAMER_LITE_DIR)/gstreamer \
  66            -I$(GSTREAMER_LITE_DIR)/gst-plugins-base/gst-libs \
  67            -I$(GSTREAMER_LITE_DIR)/gstreamer/libs
  68 
  69 LDFLAGS = -mmacosx-version-min=10.7 \
  70           -arch x86_64 \
  71           -L$(BUILD_DIR) \
  72           -Wl,-install_name,@rpath/$(TARGET_NAME) \
  73           -lobjc \
  74           -framework Cocoa \
  75           -framework CoreVideo \
  76           -lgstreamer-lite \
  77           -lglib-lite
  78 
  79 CPP_SOURCES =                                                  \
  80               MediaManagement/Media.cpp                        \
  81               MediaManagement/MediaManager.cpp                 \
  82               Locator/Locator.cpp                              \
  83               Locator/LocatorStream.cpp                        \
  84               PipelineManagement/Pipeline.cpp                  \
  85               PipelineManagement/PipelineFactory.cpp           \
  86               PipelineManagement/VideoFrame.cpp                \
  87               PipelineManagement/Track.cpp                     \
  88               PipelineManagement/AudioTrack.cpp                \
  89               PipelineManagement/VideoTrack.cpp                \
  90               PipelineManagement/SubtitleTrack.cpp             \
  91               jni/JavaPlayerEventDispatcher.cpp                \
  92               jni/JniUtils.cpp                                 \
  93               jni/com_sun_media_jfxmedia_logging_Logger.cpp    \
  94               jni/Logger.cpp                                   \
  95               jni/JavaMediaWarningListener.cpp                 \
  96               jni/JavaInputStreamCallbacks.cpp                 \
  97               jni/JavaBandsHolder.cpp                          \
  98               jni/NativeVideoBuffer.cpp                        \
  99               Utils/MediaWarningDispatcher.cpp                 \
 100               Utils/LowLevelPerf.cpp                           \
 101               Utils/posix/posix_critical_section.cpp           \
 102               platform/gstreamer/GstAudioEqualizer.cpp         \
 103               platform/gstreamer/GstAudioPlaybackPipeline.cpp  \
 104               platform/gstreamer/GstAudioSpectrum.cpp          \
 105               platform/gstreamer/GstAVPlaybackPipeline.cpp     \
 106               platform/gstreamer/GstElementContainer.cpp       \
 107               platform/gstreamer/GstJniUtils.cpp               \
 108               platform/gstreamer/GstMediaManager.cpp           \
 109               platform/gstreamer/GstPipelineFactory.cpp        \
 110               platform/gstreamer/GstVideoFrame.cpp             \
 111               platform/gstreamer/GstPlatform.cpp               \
 112               platform/gstreamer/GstEqualizerBand.cpp          \
 113               platform/gstreamer/GstMedia.cpp                  \
 114               platform/gstreamer/GstMediaPlayer.cpp            \
 115 
 116 C_SOURCES =   Utils/ColorConverter.c
 117 






 118 OBJCM_SOURCES =                                                \
 119               Utils/JObjectPeers.m                             \
 120               Utils/JavaUtils.m                                \
 121               Utils/MTObjectProxy.m
 122 
 123 OBJCMM_SOURCES = platform/osx/OSXPlatform.mm    \
 124                  platform/osx/OSXMediaPlayer.mm \
 125                  platform/osx/CVVideoFrame.mm
 126           
 127 OBJ_DIRS = $(addprefix $(OBJBASE_DIR)/,$(DIRLIST))
 128 
 129 
 130 OBJECTS  = $(patsubst %.cpp,$(OBJBASE_DIR)/%.o,$(CPP_SOURCES)) \
 131            $(patsubst %.c,$(OBJBASE_DIR)/%.o,$(C_SOURCES)) \
 132            $(patsubst %.mm,$(OBJBASE_DIR)/%.o,$(OBJCMM_SOURCES)) \
 133            $(patsubst %.m,$(OBJBASE_DIR)/%.o,$(OBJCM_SOURCES))
 134 
 135 # Always force jfxmedia_qtkit through it's own makefile
 136 .PHONY: default $(QTMEDIA)
 137 
 138 default: $(TARGET) $(QTMEDIA)
 139 
 140 $(QTMEDIA): $(TARGET)
 141         $(MAKE) -f qtmedia.mk OUTPUT_DIR=$(OUTPUT_DIR) BUILD_TYPE=$(BUILD_TYPE) BASE_NAME=$(BASE_NAME)
 142 
 143 # jfxmedia objects
 144 $(OBJBASE_DIR)/%.o: $(SRCBASE_DIR)/%.cpp
 145         $(CC) $(CFLAGS) $(INCLUDES) -x c++ -c $< -o $@
 146 
 147 $(OBJBASE_DIR)/%.o: $(SRCBASE_DIR)/%.c
 148         $(CC) $(CFLAGS) $(INCLUDES) -x c -c $< -o $@
 149 
 150 $(OBJBASE_DIR)/%.o: $(SRCBASE_DIR)/%.mm
 151         $(CC) $(CFLAGS) $(INCLUDES) -x objective-c++ -c $< -o $@
 152 
 153 $(OBJBASE_DIR)/%.o: $(SRCBASE_DIR)/%.m
 154         $(CC) $(CFLAGS) $(INCLUDES) -x objective-c -c $< -o $@
 155 
 156 $(OBJECTS): | $(OBJ_DIRS) $(TARGET_DIRS)
 157 
 158 $(OBJ_DIRS):
 159         mkdir -p $(OBJ_DIRS)
 160 
 161 $(TARGET_DIRS):
 162         mkdir -p $(TARGET_DIRS)
 163 
 164 $(TARGET): $(OBJECTS)
 165         $(LINK) -dynamiclib $(OBJECTS) $(LDFLAGS) -o $@