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

SUFFIXES = .rc.in .rc
14

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

21 22 23 24
#
# Main VLC executable
#
vlc_LDADD = ../lib/libvlc.la $(LIBPTHREAD)
25
if !HAVE_WIN32
26
vlc_SOURCES = vlc.c override.c
27 28
vlc_LDADD += $(LIBDL)
else
29
vlc_SOURCES = winvlc.c
30 31 32
vlc_DEPENDENCIES = vlc_win32_rc.$(OBJEXT)
vlc_LDFLAGS = -mwindows
vlc_LDADD += -lpsapi vlc_win32_rc.$(OBJEXT)
33
endif
34

35
vlc_osx_SOURCES = darwinvlc.m
36
vlc_osx_LDFLAGS = $(LDFLAGS_vlc) -Wl,-framework,CoreFoundation,-framework,Cocoa
37 38
vlc_osx_LDFLAGS += -Xlinker -rpath -Xlinker "@executable_path/lib/"
vlc_osx_LDFLAGS += -Xlinker -rpath -Xlinker "@executable_path/plugins/"
39 40
if HAVE_BREAKPAD
vlc_osx_LDFLAGS += -Wl,-framework,Breakpad
41
vlc_osx_OBJCFLAGS = -F$(CONTRIB_DIR)/Frameworks
42
endif
43
vlc_osx_LDADD = ../lib/libvlc.la
44 45 46 47 48 49 50

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
51 52
vlc_osx_static_LDFLAGS += -Xlinker -rpath -Xlinker "@executable_path/../lib/.libs/"
vlc_osx_static_LDFLAGS += -Xlinker -rpath -Xlinker "@executable_path/../src/.libs/"
53
vlc_osx_static_LDADD = $(vlc_osx_LDADD)
54 55
if HAVE_BREAKPAD
vlc_osx_static_LDFLAGS += -Wl,-framework,Breakpad
56
vlc_osx_static_OBJCFLAGS += -F$(CONTRIB_DIR)/Frameworks
57
endif
58

59

60 61 62
#
# Static (debug) VLC executable
#
63
vlc_static_SOURCES = $(vlc_SOURCES)
64 65 66 67
vlc_static_CFLAGS = $(AM_CFLAGS) \
	-DTOP_BUILDDIR=\"$$(cd "$(top_builddir)"; pwd)\" \
	-DTOP_SRCDIR=\"$$(cd "$(top_srcdir)"; pwd)\" \
	$(NULL)
68 69
vlc_static_DEPENDENCIES = $(vlc_DEPENDENCIES)
vlc_static_LDADD = $(vlc_LDADD)
70
vlc_static_LDFLAGS = $(vlc_LDFLAGS) -no-install -static
71

72 73 74 75 76 77
#
# Root wrapper
#
if !HAVE_WIN32
if !HAVE_OS2
bin_PROGRAMS += vlc-wrapper
78
endif
79 80 81
endif
vlc_wrapper_SOURCES = rootwrap.c
vlc_wrapper_LDADD = $(SOCKET_LIBS)
82

83
vlc_win32_rc.rc: $(top_builddir)/config.status vlc_win32_rc.rc.in
84 85 86
	cd "$(top_builddir)" && \
	$(SHELL) ./config.status --file="bin/$@"

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

90 91 92 93
#
# Plug-ins cache generator
#
vlclib_PROGRAMS = vlc-cache-gen
94
vlc_cache_gen_SOURCES = cachegen.c
95
vlc_cache_gen_LDADD = \
96
	$(GNUGETOPT_LIBS) \
97
	../compat/libcompat.la \
98
	../lib/libvlc.la
99 100 101 102 103
if HAVE_WIN32
vlc_cache_gen_LDADD += vlc_win32_rc.$(OBJEXT)
vlc_cache_gen_DEPENDENCIES = vlc_win32_rc.$(OBJEXT)
endif

104 105 106
#
# Plug-ins cache
#
107
noinst_DATA = ../modules/plugins.dat
108 109
MOSTLYCLEANFILES = $(noinst_DATA)

110 111 112 113 114 115
if HAVE_DARWIN
install-data-local:
	cd $(bindir); mv vlc-osx vlc

endif

116 117 118 119 120
.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 \
121
		./vlc-cache-gen$(EXEEXT) `realpath ../modules` ; \
122 123 124
	else \
		echo "Cross-compilation: cache generation skipped!" ; \
	fi