Move global variables to an appropriate place
[midnight-commander.git] / src / Makefile.am
blob19c850f6fd30a0cd4a1e9ec6e9e44d2eaca26458
1 SUBDIRS = filemanager man2hlp vfs viewer
3 if USE_EDIT
4 SUBDIRS += editor
5 endif
7 if USE_DIFF
8 SUBDIRS += diffviewer
9 endif
11 AM_CPPFLAGS = \
12         -DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\" \
13         -DLIBEXECDIR=\""$(libexecdir)/@PACKAGE@/"\" \
14         -DDATADIR=\""$(pkgdatadir)/"\" \
15         -DLOCALEDIR=\""$(localedir)"\" \
16         -DEXTHELPERSDIR=\""@EXTHELPERSDIR@/"\"
18 if CONS_SAVER
19 SUBDIRS += consaver
20 AM_CPPFLAGS += -DSAVERDIR=\""$(pkglibexecdir)"\"
21 endif
23 AM_CFLAGS = -I$(top_srcdir) $(GLIB_CFLAGS) $(PCRE_CFLAGS)
25 localedir = $(datadir)/locale
26 pkglibexecdir = $(libexecdir)/@PACKAGE@
28 bin_PROGRAMS = mc
30 if USE_EDIT
31 EDITLIB = editor/libedit.la
32 endif
34 if USE_DIFF
35 DIFFLIB = diffviewer/libdiffviewer.la
36 endif
38 mc_LDADD = \
39         vfs/libmc-vfs.la \
40         viewer/libmcviewer.la \
41         filemanager/libmcfilemanager.la \
42         $(DIFFLIB) $(EDITLIB) \
43         $(top_builddir)/lib/libmc.la
45 if ENABLE_VFS_SMB
46 # this is a hack for linking with own samba library in simple way
47 mc_LDADD += vfs/smbfs/helpers/libsamba.a
48 endif
50 SRC_mc_conssaver = \
51         cons.handler.c consaver/cons.saver.h
53 mc_SOURCES = \
54         $(SRC_mc_conssaver) \
55         args.c args.h \
56         clipboard.c clipboard.h \
57         events_init.c events_init.h \
58         execute.c execute.h \
59         help.c help.h \
60         history.h \
61         keybind-defaults.c keybind-defaults.h \
62         learn.c learn.h \
63         main.c main.h \
64         setup.c setup.h \
65         subshell.c subshell.h \
66         textconf.c textconf.h \
67         util.c util.h
69 if CHARSET
70     mc_SOURCES += selcodepage.c selcodepage.h
71 endif
73 if ENABLE_BACKGROUND
74     mc_SOURCES += background.c background.h
75 endif
77 EXTRA_DIST = $(SRC_maintainer) $(SRC_charset)
79 # end of automated testing
81 install-exec-hook:
82         $(MAKE) install_mcview
83 if USE_EDIT
84         $(MAKE) install_mcedit
85 endif
86 if USE_DIFF
87         $(MAKE) install_mcdiff
88 endif
91 # Make relative symlinks, but do the right thing if LN_S is `ln' or `cp'.
93 install_mcview:
94         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcview && $(LN_S) mc mcview
96 install_mcedit:
97         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcedit && $(LN_S) mc mcedit
99 install_mcdiff:
100         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcdiff && $(LN_S) mc mcdiff
102 uninstall-hook:
103         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcview
104 if USE_EDIT
105         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcedit
106 endif
107 if USE_DIFF
108         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcdiff
109 endif