Merge branch '2344_fix_line_jump'
[midnight-commander.git] / src / Makefile.am
blob229be59f37810bc673de276cd2b7db9d3b10dbdb
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
44 mc_LDADD = \
45         viewer/libmcviewer.la \
46         $(DIFFLIB) $(EDITLIB) \
47         ../lib/libmc.la \
48         $(MCLIBS) $(SLANGLIB) $(GLIB_LIBS) \
49         $(PCRE_LIBS) $(LIBICONV) $(INTLLIBS)
51 if ENABLE_VFS_SMB
52 # this is a hack for linking with own samba library in simple way
53 mc_LDADD += ../lib/vfs/mc-vfs/samba/libsamba.a
54 endif
56 SRC_mc_widgets = \
57         dialog.c dialog.h \
58         dialog-switch.c dialog-switch.h \
59         menu.c menu.h \
60         screen.c panel.h \
61         tree.c tree.h \
62         widget.c widget.h \
63         wtools.c wtools.h
65 SRC_mc_conssaver = \
66         cons.handler.c consaver/cons.saver.h
68 SRC_mc_options = \
69         learn.c learn.h \
70         option.c option.h \
71         setup.c setup.h
73 SRC_mc_keybind = \
74         keybind.c keybind.h \
75         cmddef.h
77 mc_SOURCES = \
78         $(SRC_USE_charset) \
79         $(SRC_mc_widgets) \
80         $(SRC_mc_conssaver) \
81         $(SRC_mc_options) \
82         $(SRC_mc_keybind) \
83         achown.c achown.h \
84         args.c args.h \
85         background.c background.h \
86         boxes.c boxes.h \
87         chmod.c chmod.h \
88         chown.c chown.h \
89         clipboard.c clipboard.h \
90         cmd.c cmd.h \
91         command.c command.h \
92         complete.c \
93         dir.c dir.h \
94         execute.c execute.h \
95         ext.c ext.h \
96         file.c file.h \
97         filegui.c filegui.h \
98         filenot.c \
99         fileopctx.c fileopctx.h \
100         find.c find.h \
101         help.c help.h \
102         history.h \
103         hotlist.c hotlist.h \
104         info.c info.h \
105         layout.c layout.h \
106         listmode.c listmode.h \
107         main.c main.h \
108         main-widgets.h \
109         panelize.c panelize.h \
110         subshell.c subshell.h \
111         textconf.c textconf.h \
112         treestore.c treestore.h \
113         user.c user.h
115 #if USE_MOUNTLIST
116 mc_SOURCES += mountlist.c mountlist.h
117 #endif
119 EXTRA_DIST = $(SRC_maintainer) $(SRC_charset)
121 # end of automated testing
123 install-exec-hook:
124         $(MAKE) install_mcview
125 if USE_EDIT
126         $(MAKE) install_mcedit
127 endif
128 if USE_DIFF
129         $(MAKE) install_mcdiff
130 endif
133 # Make relative symlinks, but do the right thing if LN_S is `ln' or `cp'.
135 install_mcview:
136         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcview && $(LN_S) mc mcview
138 install_mcedit:
139         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcedit && $(LN_S) mc mcedit
141 install_mcdiff:
142         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcdiff && $(LN_S) mc mcdiff
144 uninstall-hook:
145         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcview
146 if USE_EDIT
147         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcedit
148 endif
149 if USE_DIFF
150         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcdiff
151 endif