Merge branch '4524_cleanup'
[midnight-commander.git] / src / Makefile.am
blobcca050cb8e17da0e1f8e69939e7d5f0bbca45704
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
57 if ENABLE_MCLIB
58 libinternal_la_LIBADD += \
59         $(top_builddir)/lib/libmc.la
60 else
61 mc_LDADD += \
62         $(top_builddir)/lib/libmc.la
63 endif
65 SRC_mc_conssaver = \
66         cons.handler.c consaver/cons.saver.h
68 mc_SOURCES = \
69         main.c
71 libinternal_la_SOURCES = \
72         $(SRC_mc_conssaver) \
73         args.c args.h \
74         clipboard.c clipboard.h \
75         events_init.c events_init.h \
76         execute.c execute.h \
77         file_history.c file_history.h \
78         help.c help.h \
79         history.h \
80         keymap.c keymap.h \
81         learn.c learn.h \
82         setup.c setup.h \
83         textconf.c textconf.h \
84         usermenu.c usermenu.h \
85         util.c util.h
87 if CHARSET
88     libinternal_la_SOURCES += selcodepage.c selcodepage.h
89 endif
92 if ENABLE_BACKGROUND
93     libinternal_la_SOURCES += background.c background.h
94 endif
96 EXTRA_DIST = $(SRC_maintainer) $(SRC_charset)
98 # end of automated testing
100 install-exec-hook:
101         $(MAKE) install_mcview
102 if USE_INTERNAL_EDIT
103         $(MAKE) install_mcedit
104 endif
105 if USE_DIFF
106         $(MAKE) install_mcdiff
107 endif
110 # Make relative symlinks, but do the right thing if LN_S is `ln' or `cp'.
112 install_mcview:
113         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcview && $(LN_S) mc mcview
115 install_mcedit:
116         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcedit && $(LN_S) mc mcedit
118 install_mcdiff:
119         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcdiff && $(LN_S) mc mcdiff
121 uninstall-hook:
122         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcview
123 if USE_INTERNAL_EDIT
124         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcedit
125 endif
126 if USE_DIFF
127         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcdiff
128 endif