Merge branch '1396_with_search_engine'
[midnight-commander.git] / src / Makefile.am
blob28cdbd267b6cec5d3c7d5af2a350a652186bba7e
1 SUBDIRS = mcconfig search tty viewer filehighlight skin
3 AM_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) $(PCRE_CFLAGS)
5 localedir = $(datadir)/locale
6 pkglibexecdir =         $(libexecdir)/@PACKAGE@
8 bin_PROGRAMS = mc mcmfmt
11 if CONS_SAVER
12 pkglibexec_PROGRAMS = cons.saver
13 AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" \
14         -DSAVERDIR=\""$(pkglibexecdir)"\" \
15         -DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
16 else
17 AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" \
18         -DLOCALEDIR=\""$(localedir)"\" \
19         -DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
20 endif
22 noinst_PROGRAMS = man2hlp
23 man2hlp_LDADD = $(GLIB_LIBS)
25 mcmfmt_SOURCES = mfmt.c
27 cons_saver_SOURCES = cons.saver.c
29 man2hlp_SOURCES = man2hlp.c glibcompat.c
31 if USE_EDIT
32 EDITLIB = ../edit/libedit.a
33 endif
35 if USE_VFS
36 if USE_SAMBA_FS
37 VFSLIB = ../vfs/libvfs-mc.a ../vfs/samba/libsamba.a
38 else
39 VFSLIB = ../vfs/libvfs-mc.a
40 endif
41 endif
43 SRC_maintainer=logging.c logging.h
44 SRC_charset = charsets.c charsets.h selcodepage.c selcodepage.h
46 if USE_MAINTAINER_MODE
47     SRC_USE_maintainer=$(SRC_maintainer)
48 endif
50 if CHARSET
51     SRC_USE_charset=$(SRC_charset)
52 endif
54 mc_LDADD = \
55         $(EDITLIB) $(VFSLIB) \
56         filehighlight/libmcfilehighlight.la \
57         mcconfig/libmcconfig.la \
58         search/libsearch.la \
59         skin/libmcskin.la \
60         tty/libmctty.la \
61         viewer/libmcviewer.la \
62         $(INTLLIBS) $(MCLIBS) $(SLANGLIB) $(LIBICONV) $(GLIB_LIBS)
64 SRC_mc_widgets = \
65         dialog.c dialog.h \
66         menu.c menu.h \
67         screen.c panel.h \
68         tree.c tree.h \
69         widget.c widget.h \
70         wtools.c wtools.h
72 SRC_mc_strutils = \
73         strescape.c strescape.h \
74         strutil8bit.c \
75         strutilascii.c \
76         strutil.c strutil.h \
77         strutilutf8.c
79 SRC_mc_conssaver = \
80         cons.handler.c cons.saver.h
82 SRC_mc_options = \
83         learn.c learn.h \
84         option.c option.h \
85         setup.c setup.h
87 SRC_mc_keybind = \
88         keybind.c keybind.h \
89         cmddef.h
91 SRC_mc_utils = \
92         util.c util.h \
93         utilunix.c \
94         vfsdummy.h \
95         unixcompat.h
97 SRC_mc_extended_charset = \
98         ecs.c ecs.h
100 mc_SOURCES = \
101         $(SRC_USE_maintainer) \
102         $(SRC_USE_charset) \
103         $(SRC_mc_widgets) \
104         $(SRC_mc_strutils) \
105         $(SRC_mc_conssaver) \
106         $(SRC_mc_options) \
107         $(SRC_mc_keybind) \
108         $(SRC_mc_utils) \
109         $(SRC_mc_extended_charset) \
110         achown.c achown.h \
111         args.c args.h \
112         background.c background.h \
113         boxes.c boxes.h \
114         chmod.c chmod.h \
115         chown.c chown.h \
116         cmd.c cmd.h \
117         command.c command.h \
118         complete.c \
119         dir.c dir.h \
120         execute.c execute.h \
121         ext.c ext.h \
122         file.c file.h \
123         filegui.c filegui.h \
124         fileloc.h \
125         filenot.c \
126         fileopctx.c fileopctx.h \
127         find.c find.h \
128         fs.h \
129         glibcompat.c glibcompat.h \
130         global.h \
131         help.c help.h \
132         history.h \
133         hotlist.c hotlist.h \
134         info.c info.h \
135         layout.c layout.h \
136         listmode.c listmode.h \
137         main.c main.h \
138         main-widgets.h \
139         mountlist.c mountlist.h \
140         panelize.c panelize.h \
141         subshell.c subshell.h \
142         textconf.c textconf.h \
143         timefmt.h \
144         treestore.c treestore.h \
145         user.c user.h
147 EXTRA_DIST = man2hlp.c $(SRC_maintainer) $(SRC_charset)
149 # automated testing
151 TESTS =                 ecs-test
153 check_PROGRAMS =        ecs-test
154 ecs_test_SOURCES =      ecs-test.c ecs.h ecs.c
155 ecs_test_LDADD =        $(GLIB_LIBS) $(INTLLIBS) $(MCLIBS)
157 # end of automated testing
159 install-exec-hook:
160         $(MAKE) install_mcview
161 if USE_EDIT
162         $(MAKE) install_mcedit
163 endif
166 # Make relative symlinks, but do the right thing if LN_S is `ln' or `cp'.
168 install_mcview:
169         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcview && $(LN_S) mc mcview
171 install_mcedit:
172         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcedit && $(LN_S) mc mcedit
174 uninstall-hook:
175         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcview
176 if USE_EDIT
177         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcedit
178 endif