Support of multiple editors and viewers.
[midnight-commander.git] / src / Makefile.am
blob828674c6f4037ab8ae4e16ed5a16e37d7dd60478
1 SUBDIRS = man2hlp viewer
3 if USE_EDIT
4 SUBDIRS += editor
5 endif
7 if USE_DIFF
8 SUBDIRS += diffviewer
9 endif
11 AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" \
12         -DLOCALEDIR=\""$(localedir)"\" \
13         -DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
16 if CONS_SAVER
17 SUBDIRS += consaver
18 AM_CPPFLAGS += -DSAVERDIR=\""$(pkglibexecdir)"\"
19 endif
21 AM_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) $(PCRE_CFLAGS)
23 localedir = $(datadir)/locale
24 pkglibexecdir =         $(libexecdir)/@PACKAGE@
26 bin_PROGRAMS = mc mcmfmt
28 mcmfmt_SOURCES = mfmt.c
30 if USE_EDIT
31 EDITLIB = editor/libedit.la
32 endif
34 if USE_DIFF
35 DIFFLIB = diffviewer/libdiffviewer.la
36 endif
38 SRC_charset = charsets.c charsets.h selcodepage.c selcodepage.h
40 if CHARSET
41     SRC_USE_charset=$(SRC_charset)
42 endif
45 mc_LDADD = \
46         ../lib/libmc.la \
47         viewer/libmcviewer.la \
48         $(MCLIBS) $(DIFFLIB) $(EDITLIB) $(SLANGLIB) \
49         $(GLIB_LIBS) $(PCRE_LIBS) \
50         $(LIBICONV) $(INTLLIBS)
52 if USE_SAMBA_FS
53 # this is a hack for linking with own samba library in simple way
54 mc_LDADD += ../lib/vfs/mc-vfs/samba/libsamba.a
55 endif
58 SRC_mc_widgets = \
59         dialog.c dialog.h \
60         dialog-switch.c dialog-switch.h \
61         menu.c menu.h \
62         screen.c panel.h \
63         tree.c tree.h \
64         widget.c widget.h \
65         wtools.c wtools.h
67 SRC_mc_conssaver = \
68         cons.handler.c consaver/cons.saver.h
70 SRC_mc_options = \
71         learn.c learn.h \
72         option.c option.h \
73         setup.c setup.h
75 SRC_mc_keybind = \
76         keybind.c keybind.h \
77         cmddef.h
79 mc_SOURCES = \
80         $(SRC_USE_charset) \
81         $(SRC_mc_widgets) \
82         $(SRC_mc_conssaver) \
83         $(SRC_mc_options) \
84         $(SRC_mc_keybind) \
85         achown.c achown.h \
86         args.c args.h \
87         background.c background.h \
88         boxes.c boxes.h \
89         chmod.c chmod.h \
90         chown.c chown.h \
91         clipboard.c clipboard.h \
92         cmd.c cmd.h \
93         command.c command.h \
94         complete.c \
95         dir.c dir.h \
96         execute.c execute.h \
97         ext.c ext.h \
98         file.c file.h \
99         filegui.c filegui.h \
100         filenot.c \
101         fileopctx.c fileopctx.h \
102         find.c find.h \
103         help.c help.h \
104         history.h \
105         hotlist.c hotlist.h \
106         info.c info.h \
107         layout.c layout.h \
108         listmode.c listmode.h \
109         main.c main.h \
110         main-widgets.h \
111         panelize.c panelize.h \
112         subshell.c subshell.h \
113         textconf.c textconf.h \
114         treestore.c treestore.h \
115         user.c user.h
117 #if USE_MOUNTLIST
118 mc_SOURCES += mountlist.c mountlist.h
119 #endif
121 EXTRA_DIST = $(SRC_maintainer) $(SRC_charset)
123 # end of automated testing
125 install-exec-hook:
126         $(MAKE) install_mcview
127 if USE_EDIT
128         $(MAKE) install_mcedit
129 endif
130 if USE_DIFF
131         $(MAKE) install_mcdiff
132 endif
135 # Make relative symlinks, but do the right thing if LN_S is `ln' or `cp'.
137 install_mcview:
138         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcview && $(LN_S) mc mcview
140 install_mcedit:
141         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcedit && $(LN_S) mc mcedit
143 install_mcdiff:
144         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcdiff && $(LN_S) mc mcdiff
146 uninstall-hook:
147         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcview
148 if USE_EDIT
149         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcedit
150 endif
151 if USE_DIFF
152         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcdiff
153 endif