1 #
   2 # MacOs gstreamer-lite Makefile
   3 #
   4 
   5 BUILD_DIR = $(OUTPUT_DIR)/$(BUILD_TYPE)
   6 TARGET_DIRS = $(BUILD_DIR)
   7 
   8 BASE_DIR = ../../..
   9 
  10 GLIB_VERSION = 2.28.8
  11 GLIB_DIR = $(BASE_DIR)/3rd_party/glib/glib-$(GLIB_VERSION)
  12 
  13 SRCBASE_DIR = $(BASE_DIR)/gstreamer-lite
  14 OBJBASE_DIR = $(BUILD_DIR)/obj/gstreamer-lite
  15 
  16 DIRLIST = gstreamer/gst                     \
  17           gstreamer/libs/gst/base \
  18           gstreamer/libs/gst/controller \
  19           gst-plugins-base/gst-libs/gst/audio \
  20           gst-plugins-base/gst-libs/gst/interfaces \
  21           gst-plugins-base/gst-libs/gst/video \
  22           gst-plugins-base/gst-libs/gst/pbutils \
  23           gst-plugins-base/gst-libs/gst/tag \
  24           gst-plugins-base/gst-libs/gst/riff \
  25           gst-plugins-base/gst-libs/gst/fft \
  26           gst-plugins-base/gst-libs/gst/app \
  27           projects/plugins                  \
  28           gstreamer/plugins/elements \
  29           gst-plugins-base/gst/typefind \
  30           gst-plugins-base/gst/audioconvert \
  31           gst-plugins-good/gst/audioparsers \
  32           gst-plugins-good/gst/isomp4 \
  33           gst-plugins-good/gst/audiofx \
  34           gst-plugins-good/gst/equalizer \
  35           gst-plugins-good/gst/spectrum \
  36           gst-plugins-good/gst/wavparse \
  37           gst-plugins-bad/gst/aiff \
  38           gst-plugins-base/gst/app \
  39           gst-plugins-good/sys/osxaudio
  40 
  41 TARGET_NAME = lib$(BASE_NAME).dylib
  42 TARGET = $(BUILD_DIR)/$(TARGET_NAME)
  43 
  44 CFLAGS += -fPIC \
  45          -Werror=implicit-function-declaration \
  46          -D_GNU_SOURCE \
  47          -DGST_REMOVE_DEPRECATED \
  48          -DGST_DISABLE_GST_DEBUG \
  49          -DGST_DISABLE_LOADSAVE \
  50          -DG_DISABLE_DEPRECATED \
  51          -DG_DISABLE_ASSERT \
  52          -DHAVE_CONFIG_H \
  53          -DGSTREAMER_LITE \
  54          -DGST_REMOVE_DISABLED \
  55          -DOSX \
  56          -msse2
  57 
  58 ifeq ($(BUILD_TYPE), Release)
  59     CFLAGS += -Os
  60 else
  61     CFLAGS += -O0 -g -Wall
  62 endif
  63 
  64 INCLUDES = $(addprefix -I$(SRCBASE_DIR)/,$(DIRLIST)) \
  65            -I$(BASE_DIR)/plugins/ \
  66            -I$(SRCBASE_DIR)/projects/plugins \
  67            -I$(SRCBASE_DIR)/gstreamer \
  68            -I$(SRCBASE_DIR)/gstreamer/libs \
  69            -I$(SRCBASE_DIR)/gst-plugins-base \
  70            -I$(SRCBASE_DIR)/gst-plugins-base/gst-libs \
  71            -I$(GLIB_DIR) \
  72            -I$(GLIB_DIR)/glib \
  73            -I$(GLIB_DIR)/gmodule \
  74            -I$(GLIB_DIR)/build/osx
  75 
  76 LDFLAGS += -L$(BUILD_DIR) \
  77            -Wl,-install_name,@rpath/$(TARGET_NAME) \
  78            -lglib-lite \
  79            -framework CoreAudio \
  80            -framework AudioUnit \
  81            -framework CoreServices
  82 
  83 C_SOURCES = gstreamer/libs/gst/base/gstbytereader.c \
  84             gstreamer/gst/gst.c                                                \
  85             gstreamer/gst/gstbin.c                                             \
  86             gstreamer/gst/gstbuffer.c                                          \
  87             gstreamer/gst/gstbufferlist.c                                      \
  88             gstreamer/gst/gstbus.c                                             \
  89             gstreamer/gst/gstcaps.c                                            \
  90             gstreamer/gst/gstchildproxy.c                                      \
  91             gstreamer/gst/gstclock.c                                           \
  92             gstreamer/gst/gstdebugutils.c                                      \
  93             gstreamer/gst/gstelement.c                                         \
  94             gstreamer/gst/gstelementfactory.c                                  \
  95             gstreamer/gst/gsterror.c                                           \
  96             gstreamer/gst/gstevent.c                                           \
  97             gstreamer/gst/gstfilter.c                                          \
  98             gstreamer/gst/gstformat.c                                          \
  99             gstreamer/gst/gstghostpad.c                                        \
 100             gstreamer/gst/gstindex.c                                           \
 101             gstreamer/gst/gstindexfactory.c                                    \
 102             gstreamer/gst/gstinfo.c                                            \
 103             gstreamer/gst/gstinterface.c                                       \
 104             gstreamer/gst/gstiterator.c                                        \
 105             gstreamer/gst/gstmessage.c                                         \
 106             gstreamer/gst/gstminiobject.c                                      \
 107             gstreamer/gst/gstobject.c                                          \
 108             gstreamer/gst/gstpad.c                                             \
 109             gstreamer/gst/gstpadtemplate.c                                     \
 110             gstreamer/gst/gstparamspecs.c                                      \
 111             gstreamer/gst/gstpipeline.c                                        \
 112             gstreamer/gst/gstplugin.c                                          \
 113             gstreamer/gst/gstpluginfeature.c                                   \
 114             gstreamer/gst/gstpoll.c                                            \
 115             gstreamer/gst/gstpreset.c                                          \
 116             gstreamer/gst/gstquark.c                                           \
 117             gstreamer/gst/gstquery.c                                           \
 118             gstreamer/gst/gstregistry.c                                        \
 119             gstreamer/gst/gstregistrybinary.c                                  \
 120             gstreamer/gst/gstsegment.c                                         \
 121             gstreamer/gst/gststructure.c                                       \
 122             gstreamer/gst/gstsystemclock.c                                     \
 123             gstreamer/gst/gsttaglist.c                                         \
 124             gstreamer/gst/gsttagsetter.c                                       \
 125             gstreamer/gst/gsttask.c                                            \
 126             gstreamer/gst/gsttaskpool.c                                        \
 127             gstreamer/gst/gsttrace.c                                           \
 128             gstreamer/gst/gsttypefind.c                                        \
 129             gstreamer/gst/gsttypefindfactory.c                                 \
 130             gstreamer/gst/gsturi.c                                             \
 131             gstreamer/gst/gstutils.c                                           \
 132             gstreamer/gst/gstvalue.c                                           \
 133             gstreamer/libs/gst/base/gstadapter.c                               \
 134             gstreamer/libs/gst/base/gstbasesink.c                              \
 135             gstreamer/libs/gst/base/gstbasesrc.c                               \
 136             gstreamer/libs/gst/base/gstbasetransform.c                         \
 137             gstreamer/libs/gst/base/gstcollectpads.c                           \
 138             gstreamer/libs/gst/base/gstpushsrc.c                               \
 139             gstreamer/libs/gst/base/gsttypefindhelper.c                        \
 140             gstreamer/libs/gst/controller/gstcontroller.c                      \
 141             gstreamer/libs/gst/controller/gstcontrolsource.c                   \
 142             gstreamer/libs/gst/controller/gsthelper.c                          \
 143             gstreamer/libs/gst/controller/gstinterpolation.c                   \
 144             gstreamer/libs/gst/controller/gstinterpolationcontrolsource.c      \
 145             gstreamer/libs/gst/controller/gstlfocontrolsource.c                \
 146             gstreamer/libs/gst/controller/lib.c                                \
 147             gst-plugins-base/gst-libs/gst/audio/audio-enumtypes.c              \
 148             gst-plugins-base/gst-libs/gst/audio/audio.c                        \
 149             gst-plugins-base/gst-libs/gst/audio/gstaudioclock.c                \
 150             gst-plugins-base/gst-libs/gst/audio/gstaudiofilter.c               \
 151             gst-plugins-base/gst-libs/gst/audio/gstaudiosink.c                 \
 152             gst-plugins-base/gst-libs/gst/audio/gstaudiosrc.c                  \
 153             gst-plugins-base/gst-libs/gst/audio/gstbaseaudiosink.c             \
 154             gst-plugins-base/gst-libs/gst/audio/gstbaseaudiosrc.c              \
 155             gst-plugins-base/gst-libs/gst/audio/gstringbuffer.c                \
 156             gst-plugins-base/gst-libs/gst/audio/mixerutils.c                   \
 157             gst-plugins-base/gst-libs/gst/audio/multichannel.c                 \
 158             gst-plugins-base/gst-libs/gst/interfaces/interfaces-enumtypes.c    \
 159             gst-plugins-base/gst-libs/gst/interfaces/interfaces-marshal.c      \
 160             gst-plugins-base/gst-libs/gst/interfaces/mixer.c                   \
 161             gst-plugins-base/gst-libs/gst/interfaces/mixeroptions.c            \
 162             gst-plugins-base/gst-libs/gst/interfaces/mixertrack.c              \
 163             gst-plugins-base/gst-libs/gst/interfaces/navigation.c              \
 164             gst-plugins-base/gst-libs/gst/interfaces/propertyprobe.c           \
 165             gst-plugins-base/gst-libs/gst/interfaces/videoorientation.c        \
 166             gst-plugins-base/gst-libs/gst/interfaces/xoverlay.c                \
 167             gst-plugins-base/gst-libs/gst/video/gstvideofilter.c               \
 168             gst-plugins-base/gst-libs/gst/video/gstvideosink.c                 \
 169             gst-plugins-base/gst-libs/gst/video/video-enumtypes.c              \
 170             gst-plugins-base/gst-libs/gst/video/video.c                        \
 171             gst-plugins-base/gst-libs/gst/pbutils/descriptions.c               \
 172             gst-plugins-base/gst-libs/gst/pbutils/missing-plugins.c            \
 173             gst-plugins-base/gst-libs/gst/pbutils/pbutils-enumtypes.c          \
 174             gst-plugins-base/gst-libs/gst/pbutils/pbutils.c                    \
 175             gst-plugins-base/gst-libs/gst/tag/gstid3tag.c                      \
 176             gst-plugins-base/gst-libs/gst/tag/gsttagdemux.c                    \
 177             gst-plugins-base/gst-libs/gst/tag/gstvorbistag.c                   \
 178             gst-plugins-base/gst-libs/gst/tag/tags.c                           \
 179             gst-plugins-base/gst-libs/gst/riff/riff-media.c                    \
 180             gst-plugins-base/gst-libs/gst/riff/riff-read.c                     \
 181             gst-plugins-base/gst-libs/gst/riff/riff.c                          \
 182             gst-plugins-base/gst-libs/gst/app/gstappbuffer.c                   \
 183             gst-plugins-base/gst-libs/gst/app/gstappsink.c                     \
 184             gst-plugins-base/gst-libs/gst/fft/gstfft.c                         \
 185             gst-plugins-base/gst-libs/gst/fft/gstfftf32.c                      \
 186             gst-plugins-base/gst-libs/gst/fft/gstfftf64.c                      \
 187             gst-plugins-base/gst-libs/gst/fft/gstffts16.c                      \
 188             gst-plugins-base/gst-libs/gst/fft/gstffts32.c                      \
 189             gst-plugins-base/gst-libs/gst/fft/kiss_fft_f32.c                   \
 190             gst-plugins-base/gst-libs/gst/fft/kiss_fft_f64.c                   \
 191             gst-plugins-base/gst-libs/gst/fft/kiss_fft_s16.c                   \
 192             gst-plugins-base/gst-libs/gst/fft/kiss_fft_s32.c                   \
 193             gst-plugins-base/gst-libs/gst/fft/kiss_fftr_f32.c                  \
 194             gst-plugins-base/gst-libs/gst/fft/kiss_fftr_f64.c                  \
 195             gst-plugins-base/gst-libs/gst/fft/kiss_fftr_s16.c                  \
 196             gst-plugins-base/gst-libs/gst/fft/kiss_fftr_s32.c                  \
 197             gstreamer/libs/gst/base/gstbaseparse.c                             \
 198             gstreamer/gst/gstdatetime.c                                        \
 199             gstreamer/gst/gstenumtypes.c                                       \
 200             gstreamer/gst/gstmarshal.c                                         \
 201             gstreamer/gst/gstparse.c                                           \
 202             gstreamer/gst/gstpluginloader.c                                    \
 203             gstreamer/gst/gstregistrychunks.c                                  \
 204             gst-plugins-base/gst-libs/gst/pbutils/codec-utils.c                \
 205             gst-plugins-base/gst-libs/gst/tag/gstxmptag.c                      \
 206             gstreamer/libs/gst/base/gstbytewriter.c                            \
 207             gst-plugins-base/gst-libs/gst/tag/lang.c                           \
 208             gst-plugins-base/gst-libs/gst/tag/gsttageditingprivate.c           \
 209             gstreamer/plugins/elements/gstcapsfilter.c \
 210             gstreamer/plugins/elements/gstelements.c                           \
 211             gstreamer/plugins/elements/gstfilesrc.c                            \
 212             gstreamer/plugins/elements/gstqueue.c                              \
 213             gstreamer/plugins/elements/gsttypefindelement.c                    \
 214             gst-plugins-base/gst/typefind/gsttypefindfunctions.c               \
 215             gst-plugins-base/gst/audioconvert/audioconvert.c                   \
 216             gst-plugins-base/gst/audioconvert/gstaudioconvert.c                \
 217             gst-plugins-base/gst/audioconvert/gstaudioquantize.c               \
 218             gst-plugins-base/gst/audioconvert/gstchannelmix.c                  \
 219             gst-plugins-base/gst/audioconvert/plugin.c                         \
 220             gst-plugins-good/sys/osxaudio/gstosxaudio.c                        \
 221             gst-plugins-good/sys/osxaudio/gstosxaudioelement.c                 \
 222             gst-plugins-good/sys/osxaudio/gstosxaudiosink.c                    \
 223             gst-plugins-good/sys/osxaudio/gstosxringbuffer.c                   \
 224             gst-plugins-good/gst/audiofx/audiofx.c                             \
 225             gst-plugins-good/gst/audiofx/audiopanorama.c                       \
 226             gst-plugins-good/gst/equalizer/gstiirequalizer.c                   \
 227             gst-plugins-good/gst/equalizer/gstiirequalizernbands.c             \
 228             gst-plugins-good/gst/wavparse/gstwavparse.c                        \
 229             projects/plugins/gstplugins-lite.c                                 \
 230             gst-plugins-base/gst/app/gstapp.c                                  \
 231             gst-plugins-good/sys/osxaudio/gstosxaudiosrc.c                     \
 232             gst-plugins-good/gst/spectrum/gstspectrum.c                        \
 233             gst-plugins-good/gst/audioparsers/parsersplugin.c                  \
 234             gst-plugins-good/gst/audioparsers/gstmpegaudioparse.c              \
 235             gst-plugins-good/gst/isomp4/qtdemux_lang.c                         \
 236             gst-plugins-good/gst/isomp4/isomp4-plugin.c                        \
 237             gst-plugins-good/gst/isomp4/qtdemux_dump.c                         \
 238             gst-plugins-good/gst/isomp4/qtdemux_types.c                        \
 239             gst-plugins-good/gst/isomp4/qtdemux.c                              \
 240             gst-plugins-bad/gst/aiff/aiff.c                                    \
 241             gst-plugins-bad/gst/aiff/aiffparse.c                               \
 242             gst-plugins-base/gst/audioconvert/gstaudioconvertorc-dist.c
 243 
 244 OBJ_DIRS = $(addprefix $(OBJBASE_DIR)/,$(DIRLIST))
 245 OBJECTS  = $(patsubst %.c,$(OBJBASE_DIR)/%.o,$(C_SOURCES))
 246 
 247 .PHONY: default list
 248 
 249 default: $(TARGET)
 250 
 251 $(OBJBASE_DIR)/%.o: $(SRCBASE_DIR)/%.c
 252         $(CC) $(CFLAGS) -I$(SRCBASE_DIR)/projects/build/osx/common/x86_64 $(INCLUDES) -c $< -o $@
 253 
 254 $(OBJECTS): | $(OBJ_DIRS) $(TARGET_DIRS)
 255 
 256 $(OBJ_DIRS):
 257         mkdir -p $(OBJ_DIRS)
 258 
 259 $(TARGET_DIRS):
 260         mkdir -p $(TARGET_DIRS)
 261 
 262 $(TARGET): $(OBJECTS)
 263         $(CC) -dynamiclib $(OBJECTS) $(LDFLAGS) -o $@