33bebdf0fd7486d6c0469b99080a6a46bc7ead01
[enigma2.git] / main / Makefile.am
1 AM_CPPFLAGS = \
2         -I$(top_srcdir) \
3         -I$(top_srcdir)/include \
4         -include Python.h \
5         -include $(top_builddir)/enigma2_config.h
6
7 AM_CXXFLAGS = \
8         $(LIBSDL_CFLAGS)
9
10 bin_PROGRAMS = enigma2
11
12 enigma2_SOURCES = \
13         bsod.cpp \
14         bsod.h \
15         enigma.cpp \
16         version.h
17
18 EXTRA_DIST = \
19         enigma-dvbtest.cpp \
20         enigma-gdi.cpp \
21         enigma-gui.cpp \
22         enigma-playlist.cpp \
23         enigma-scan.cpp
24
25 enigma2_LDADD = \
26         $(top_builddir)/lib/libenigma.la \
27         @BASE_LIBS@ \
28         @LIBGIF_LIBS@ \
29         @LIBJPEG_LIBS@ \
30         @LIBSDL_LIBS@ \
31         @LIBXINE_LIBS@ \
32         @LIBXMLCCWRAP_LIBS@ \
33         @PTHREAD_LIBS@ \
34         @PYTHON_LDFLAGS@
35
36 GIT_DIR = $(top_srcdir)/.git
37
38 version.h:
39         if [ -d $(GIT_DIR) ]; then \
40                 if [ -f $(GIT_DIR)/last_commit_info ]; then \
41                         echo "#define ENIGMA2_LAST_CHANGE_DATE \"`cat $(GIT_DIR)/last_commit_info | grep 'Date:' | cut -d' ' -f4`\"" > $@; \
42                         echo "#define ENIGMA2_BRANCH \"`cat $(GIT_DIR)/branch`\"" >> $@; \
43                 else \
44                         echo "#define ENIGMA2_LAST_CHANGE_DATE \"`git --git-dir=$(top_srcdir)/.git log --no-color -n 1 --format=format:%cd --date=short`\"" > $@; \
45                         echo "#define ENIGMA2_BRANCH \"`git --git-dir=$(top_srcdir)/.git branch --no-color 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`\"" >> $@; \
46                 fi; \
47         elif [ ! -f $@ ]; then \
48                 echo "#define ENIGMA2_LAST_CHANGE_DATE \"`date --rfc-3339=date`\"" > $@; \
49                 echo "#define ENIGMA2_BRANCH \"$(PACKAGE_VERSION)\"" >> $@; \
50         fi;
51
52 dist-hook:
53         echo "#define ENIGMA2_LAST_CHANGE_DATE \"`date --rfc-3339=date`\"" > version.h;
54         echo "#define ENIGMA2_BRANCH \"$(PACKAGE_VERSION)\"" >> version.h;