Merge branch '3698_etags_codejump'
[midnight-commander.git] / src / Makefile.am
blobcb2e87e230ea394044747f3003b09e30325a176e
1 SUBDIRS = filemanager man2hlp vfs viewer
3 if USE_INTERNAL_EDIT
4 SUBDIRS += editor
5 endif
7 if USE_DIFF
8 SUBDIRS += diffviewer
9 endif
11 if ENABLE_SUBSHELL
12 SUBDIRS += subshell
13 endif
15 noinst_LTLIBRARIES = libinternal.la
17 AM_CPPFLAGS = \
18         -DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\" \
19         -DLIBEXECDIR=\""$(libexecdir)/@PACKAGE@/"\" \
20         -DDATADIR=\""$(pkgdatadir)/"\" \
21         -DLOCALEDIR=\""$(localedir)"\" \
22         -DEXTHELPERSDIR=\""@EXTHELPERSDIR@/"\"
24 if CONS_SAVER
25 SUBDIRS += consaver
26 AM_CPPFLAGS += -DSAVERDIR=\""$(pkglibexecdir)"\"
27 endif
29 AM_CPPFLAGS += -I$(top_srcdir) $(GLIB_CFLAGS)
31 localedir = $(datadir)/locale
32 pkglibexecdir = $(libexecdir)/@PACKAGE@
34 bin_PROGRAMS = mc
36 if USE_INTERNAL_EDIT
37 EDITLIB = editor/libedit.la
38 endif
40 if USE_DIFF
41 DIFFLIB = diffviewer/libdiffviewer.la
42 endif
44 if ENABLE_SUBSHELL
45 SUBSHELLLIB = subshell/libsubshell.la
46 endif
48 libinternal_la_LIBADD = \
49         filemanager/libmcfilemanager.la \
50         vfs/libmc-vfs.la \
51         viewer/libmcviewer.la \
52         $(DIFFLIB) $(EDITLIB) $(SUBSHELLLIB)
54 mc_LDADD = \
55         libinternal.la \
56         $(top_builddir)/lib/libmc.la
58 if ENABLE_VFS_SMB
59 # this is a hack for linking with own samba library in simple way
60 mc_LDADD += vfs/smbfs/helpers/libsamba.a
61 endif
63 SRC_mc_conssaver = \
64         cons.handler.c consaver/cons.saver.h
66 mc_SOURCES = \
67         main.c
69 libinternal_la_SOURCES = \
70         $(SRC_mc_conssaver) \
71         args.c args.h \
72         clipboard.c clipboard.h \
73         events_init.c events_init.h \
74         execute.c execute.h \
75         help.c help.h \
76         history.h \
77         keybind-defaults.c keybind-defaults.h \
78         learn.c learn.h \
79         setup.c setup.h \
80         textconf.c textconf.h \
81         util.c util.h
83 if CHARSET
84     libinternal_la_SOURCES += selcodepage.c selcodepage.h
85 endif
88 if ENABLE_BACKGROUND
89     libinternal_la_SOURCES += background.c background.h
90 endif
92 EXTRA_DIST = $(SRC_maintainer) $(SRC_charset)
94 # end of automated testing
96 install-exec-hook:
97         $(MAKE) install_mcview
98 if USE_INTERNAL_EDIT
99         $(MAKE) install_mcedit
100 endif
101 if USE_DIFF
102         $(MAKE) install_mcdiff
103 endif
106 # Make relative symlinks, but do the right thing if LN_S is `ln' or `cp'.
108 install_mcview:
109         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcview && $(LN_S) mc mcview
111 install_mcedit:
112         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcedit && $(LN_S) mc mcedit
114 install_mcdiff:
115         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcdiff && $(LN_S) mc mcdiff
117 uninstall-hook:
118         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcview
119 if USE_INTERNAL_EDIT
120         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcedit
121 endif
122 if USE_DIFF
123         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcdiff
124 endif