Revert "Try fix of compile warnings about assigned but unused variables"
[midnight-commander.git] / src / Makefile.am
blob8630b52db6d9eeeefbbbde99e7228cfd066cffb6
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 = -I$(top_srcdir) $(GLIB_CFLAGS) $(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         clipboard.c clipboard.h \
56         events_init.c events_init.h \
57         execute.c execute.h \
58         help.c help.h \
59         history.h \
60         keybind-defaults.c keybind-defaults.h \
61         learn.c learn.h \
62         main.c main.h \
63         setup.c setup.h \
64         subshell.c subshell.h \
65         textconf.c textconf.h \
66         util.c util.h
68 if CHARSET
69     mc_SOURCES += selcodepage.c selcodepage.h
70 endif
72 if ENABLE_BACKGROUND
73     mc_SOURCES += background.c background.h
74 endif
76 EXTRA_DIST = $(SRC_maintainer) $(SRC_charset)
78 # end of automated testing
80 install-exec-hook:
81         $(MAKE) install_mcview
82 if USE_EDIT
83         $(MAKE) install_mcedit
84 endif
85 if USE_DIFF
86         $(MAKE) install_mcdiff
87 endif
90 # Make relative symlinks, but do the right thing if LN_S is `ln' or `cp'.
92 install_mcview:
93         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcview && $(LN_S) mc mcview
95 install_mcedit:
96         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcedit && $(LN_S) mc mcedit
98 install_mcdiff:
99         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcdiff && $(LN_S) mc mcdiff
101 uninstall-hook:
102         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcview
103 if USE_EDIT
104         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcedit
105 endif
106 if USE_DIFF
107         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcdiff
108 endif