Embed manifest files as Windows PE resource
[vlc.git] / bin / Makefile.am
1 # Building vlc
2 #
3 bin_PROGRAMS = vlc
4 noinst_PROGRAMS = vlc-static
5 noinst_DATA =
6 vlclib_PROGRAMS = vlc-cache-gen
7 EXTRA_PROGRAMS = vlc-wrapper
8 EXTRA_DIST = vlc_win32_rc.rc.in
9
10 SUFFIXES = .rc.in .rc
11
12 AM_CPPFLAGS = $(CPPFLAGS_vlc)
13 AM_CFLAGS = $(CFLAGS_vlc)
14
15
16 if !HAVE_WIN32
17 if !HAVE_WINCE
18 bin_PROGRAMS += vlc-wrapper
19 vlc_SOURCES = vlc.c override.c
20 endif
21 endif
22
23 EXTRA_vlc_SOURCES = vlc.c winvlc.c
24 if HAVE_WIN32
25 vlc_SOURCES = winvlc.c
26 noinst_DATA += vlc_win32_rc.rc
27 endif
28 if HAVE_WINCE
29 vlc_SOURCES = winvlc.c
30 endif
31
32 vlc_wrapper_SOURCES = rootwrap.c
33 vlc_wrapper_LDADD = $(SOCKET_LIBS)
34
35 vlc_LDFLAGS = $(LDFLAGS_vlc)
36 vlc_LDADD = ../lib/libvlc.la ../src/libvlccore.la $(LIBS_vlc)
37
38 vlc_static_SOURCES = $(vlc_SOURCES)
39 vlc_static_CFLAGS = $(AM_CFLAGS) \
40         -DTOP_BUILDDIR=\"$$(cd "$(top_builddir)"; pwd)\" \
41         -DTOP_SRCDIR=\"$$(cd "$(top_srcdir)"; pwd)\" \
42         $(NULL)
43 vlc_static_DEPENDENCIES = $(vlc_DEPENDENCIES)
44 vlc_static_LDADD = $(vlc_LDADD)
45 vlc_static_LDFLAGS = $(vlc_LDFLAGS)
46
47 if HAVE_WIN32
48 vlc_LDADD += -lpsapi -lwininet vlc_win32_rc.$(OBJEXT)
49 vlc_DEPENDENCIES = vlc_win32_rc.$(OBJEXT)
50 else
51 vlc_LDADD += $(LIBDL)
52 vlc_static_LDFLAGS += -no-install -static
53 endif
54
55 vlc_win32_rc.rc: $(top_builddir)/config.status vlc_win32_rc.rc.in
56         cd "$(top_builddir)" && \
57         $(SHELL) ./config.status --file="bin/$@"
58
59 vlc_win32_rc.$(OBJEXT): vlc_win32_rc.rc
60         $(WINDRES) --include-dir $(top_srcdir)/share/icons --include-dir $(top_srcdir)/extras/package/win32 -i $< -o $@
61
62 vlc_cache_gen_SOURCES = cachegen.c
63 vlc_cache_gen_LDADD = \
64         $(GNUGETOPT_LIBS) \
65         ../compat/libcompat.la \
66         ../lib/libvlc.la ../src/libvlccore.la
67 if HAVE_WIN32
68 vlc_cache_gen_LDADD += vlc_win32_rc.$(OBJEXT)
69 vlc_cache_gen_DEPENDENCIES = vlc_win32_rc.$(OBJEXT)
70 endif
71
72 #
73 # Plug-ins cache
74 #
75 noinst_DATA += ../modules/plugins.dat
76 MOSTLYCLEANFILES = $(noinst_DATA)
77
78 .PHONY: ../modules/plugins.dat
79
80 ../modules/plugins.dat: vlc-cache-gen$(EXEEXT)
81         $(AM_V_at)rm -f ../modules/plugins.dat
82         $(AM_V_GEN)if test "$(build)" = "$(host)"; then \
83                 ./vlc-cache-gen$(EXEEXT) ../modules ; \
84         else \
85                 echo "Cross-compilation: cache generation skipped!" ; \
86         fi