Makefile.am 3.81 KB
Newer Older
1 2
# Building vlc
#
3
if BUILD_VLC
4
if HAVE_OSX
5
bin_PROGRAMS = vlc-osx
6
noinst_PROGRAMS = vlc-osx-static
7
else
8
bin_PROGRAMS = vlc
9
noinst_PROGRAMS = vlc-static
10
endif
11
endif
12
EXTRA_DIST = vlc_win32_rc.rc.in
13
CLEANFILES = vlc_win32_rc.rc
14 15

SUFFIXES = .rc.in .rc
16

17 18
AM_CPPFLAGS = $(CPPFLAGS_vlc)
AM_CFLAGS = $(CFLAGS_vlc)
19 20 21
if HAVE_DBUS
AM_CPPFLAGS += -DHAVE_DBUS
endif
22

23 24 25 26
#
# Main VLC executable
#
vlc_LDADD = ../lib/libvlc.la $(LIBPTHREAD)
27
vlc_CPPFLAGS = $(AM_CPPFLAGS)
28
if !HAVE_WIN32
29
vlc_SOURCES = vlc.c override.c
30 31
vlc_LDADD += $(LIBDL)
else
32
vlc_SOURCES = winvlc.c
33 34
vlc_DEPENDENCIES = vlc_win32_rc.$(OBJEXT)
vlc_LDFLAGS = -mwindows
35
vlc_LDADD += vlc_win32_rc.$(OBJEXT)
36 37 38 39 40 41 42
libbreakpad_wrapper_la_SOURCES = breakpad.cpp
libbreakpad_wrapper_la_LIBADD = $(BREAKPAD_LIBS)
libbreakpad_wrapper_la_LDFLAGS = -static
libbreakpad_wrapper_la_CXXFLAGS = $(AM_CXXFLAGS) $(BREAKPAD_CFLAGS) -DBREAKPAD_URL=\"@BREAKPAD_URL@\"
if HAVE_BREAKPAD
noinst_LTLIBRARIES = libbreakpad_wrapper.la
vlc_LDADD += libbreakpad_wrapper.la -lstdc++ -lwininet
43
vlc_DEPENDENCIES += libbreakpad_wrapper.la
44 45
vlc_CPPFLAGS += -DHAVE_BREAKPAD
endif
46
endif
47

48
vlc_osx_SOURCES = darwinvlc.m
49
vlc_osx_LDFLAGS = $(LDFLAGS_vlc) -Wl,-framework,CoreFoundation,-framework,Cocoa
50 51
vlc_osx_LDFLAGS += -Xlinker -rpath -Xlinker "@executable_path/lib/"
vlc_osx_LDFLAGS += -Xlinker -rpath -Xlinker "@executable_path/plugins/"
52 53
if HAVE_BREAKPAD
vlc_osx_LDFLAGS += -Wl,-framework,Breakpad
54
vlc_osx_OBJCFLAGS = -F$(CONTRIB_DIR)/Frameworks
55
vlc_osx_CPPFLAGS = -DHAVE_BREAKPAD
56
endif
57
vlc_osx_LDADD = ../lib/libvlc.la
58 59 60 61 62 63 64

vlc_osx_static_SOURCES = $(vlc_osx_SOURCES)
vlc_osx_static_OBJCFLAGS = $(AM_OBJCFLAGS) \
	-DTOP_BUILDDIR=\"$$(cd "$(top_builddir)"; pwd)\" \
	-DTOP_SRCDIR=\"$$(cd "$(top_srcdir)"; pwd)\" \
	$(NULL)
vlc_osx_static_LDFLAGS = $(vlc_osx_LDFLAGS) -static
65 66
vlc_osx_static_LDFLAGS += -Xlinker -rpath -Xlinker "@executable_path/../lib/.libs/"
vlc_osx_static_LDFLAGS += -Xlinker -rpath -Xlinker "@executable_path/../src/.libs/"
67
vlc_osx_static_LDADD = $(vlc_osx_LDADD)
68 69
if HAVE_BREAKPAD
vlc_osx_static_LDFLAGS += -Wl,-framework,Breakpad
70
vlc_osx_static_OBJCFLAGS += -F$(CONTRIB_DIR)/Frameworks
71
vlc_osx_static_CPPFLAGS = -DHAVE_BREAKPAD
72
endif
73

74

75 76 77
#
# Static (debug) VLC executable
#
78
vlc_static_SOURCES = $(vlc_SOURCES)
79 80 81 82
vlc_static_CFLAGS = $(AM_CFLAGS) \
	-DTOP_BUILDDIR=\"$$(cd "$(top_builddir)"; pwd)\" \
	-DTOP_SRCDIR=\"$$(cd "$(top_srcdir)"; pwd)\" \
	$(NULL)
83
vlc_static_CPPFLAGS = $(vlc_CPPFLAGS)
84 85
vlc_static_DEPENDENCIES = $(vlc_DEPENDENCIES)
vlc_static_LDADD = $(vlc_LDADD)
86
vlc_static_LDFLAGS = $(vlc_LDFLAGS) -no-install -static
87

88 89 90
#
# Root wrapper
#
91
if BUILD_VLC
92 93 94
if !HAVE_WIN32
if !HAVE_OS2
bin_PROGRAMS += vlc-wrapper
95
endif
96
endif
97
endif
98 99
vlc_wrapper_SOURCES = rootwrap.c
vlc_wrapper_LDADD = $(SOCKET_LIBS)
100

101
vlc_win32_rc.rc: $(top_builddir)/config.status vlc_win32_rc.rc.in
102 103 104
	cd "$(top_builddir)" && \
	$(SHELL) ./config.status --file="bin/$@"

105
vlc_win32_rc.$(OBJEXT): vlc_win32_rc.rc $(top_srcdir)/extras/package/win32/vlc.exe.manifest
106
	$(WINDRES) --include-dir $(top_srcdir)/share/icons --include-dir $(top_srcdir)/extras/package/win32 -i $< -o $@
107

108 109 110
#
# Plug-ins cache generator
#
111
if HAVE_DYNAMIC_PLUGINS
112
pkglibexec_PROGRAMS = vlc-cache-gen
113
endif
114
vlc_cache_gen_SOURCES = cachegen.c
115
vlc_cache_gen_LDADD = \
116
	$(GNUGETOPT_LIBS) \
117
	../compat/libcompat.la \
118
	../lib/libvlc.la
119 120 121 122 123
if HAVE_WIN32
vlc_cache_gen_LDADD += vlc_win32_rc.$(OBJEXT)
vlc_cache_gen_DEPENDENCIES = vlc_win32_rc.$(OBJEXT)
endif

124 125 126
#
# Plug-ins cache
#
127
if HAVE_DYNAMIC_PLUGINS
128
noinst_DATA = ../modules/plugins.dat
129
endif
130 131
MOSTLYCLEANFILES = $(noinst_DATA)

132
if HAVE_OSX
133
if BUILD_VLC
134 135 136 137
install-data-local:
	cd $(bindir); mv vlc-osx vlc

endif
138
endif
139

140 141 142 143 144
.PHONY: ../modules/plugins.dat

../modules/plugins.dat: vlc-cache-gen$(EXEEXT)
	$(AM_V_at)rm -f ../modules/plugins.dat
	$(AM_V_GEN)if test "$(build)" = "$(host)"; then \
145
		./vlc-cache-gen$(EXEEXT) `realpath ../modules` ; \
146 147 148
	else \
		echo "Cross-compilation: cache generation skipped!" ; \
	fi