(examine_cd): split in two functions to be unit test friendly.
[midnight-commander.git] / src / Makefile.am
blobc87ac8f3d3c190f46da861a573bef078040d36dc
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)"\"
17 if CONS_SAVER
18 SUBDIRS += consaver
19 AM_CPPFLAGS += -DSAVERDIR=\""$(pkglibexecdir)"\"
20 endif
22 AM_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) $(PCRE_CFLAGS)
24 localedir = $(datadir)/locale
25 pkglibexecdir = $(libexecdir)/@PACKAGE@
27 bin_PROGRAMS = mc
29 if USE_EDIT
30 EDITLIB = editor/libedit.la
31 endif
33 if USE_DIFF
34 DIFFLIB = diffviewer/libdiffviewer.la
35 endif
37 mc_LDADD = \
38         vfs/libmc-vfs.la \
39         viewer/libmcviewer.la \
40         filemanager/libmcfilemanager.la \
41         $(DIFFLIB) $(EDITLIB) \
42         $(top_builddir)/lib/libmc.la
44 if ENABLE_VFS_SMB
45 # this is a hack for linking with own samba library in simple way
46 mc_LDADD += vfs/smbfs/helpers/libsamba.a
47 endif
49 SRC_mc_conssaver = \
50         cons.handler.c consaver/cons.saver.h
52 mc_SOURCES = \
53         $(SRC_mc_conssaver) \
54         args.c args.h \
55         background.c background.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 EXTRA_DIST = $(SRC_maintainer) $(SRC_charset)
75 # end of automated testing
77 install-exec-hook:
78         $(MAKE) install_mcview
79 if USE_EDIT
80         $(MAKE) install_mcedit
81 endif
82 if USE_DIFF
83         $(MAKE) install_mcdiff
84 endif
87 # Make relative symlinks, but do the right thing if LN_S is `ln' or `cp'.
89 install_mcview:
90         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcview && $(LN_S) mc mcview
92 install_mcedit:
93         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcedit && $(LN_S) mc mcedit
95 install_mcdiff:
96         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcdiff && $(LN_S) mc mcdiff
98 uninstall-hook:
99         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcview
100 if USE_EDIT
101         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcedit
102 endif
103 if USE_DIFF
104         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcdiff
105 endif