Massive moved some dirs from $(srcdir)/src into $(srcdir)/lib
[midnight-commander.git] / src / Makefile.am
blob33993d0803d65fe7c1a83abc46b44280cbee3f84
1 SUBDIRS = viewer
3 if USE_EDIT
4 SUBDIRS += editor
5 endif
7 AM_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) $(PCRE_CFLAGS)
9 localedir = $(datadir)/locale
10 pkglibexecdir =         $(libexecdir)/@PACKAGE@
12 bin_PROGRAMS = mc mcmfmt
15 if CONS_SAVER
16 pkglibexec_PROGRAMS = cons.saver
17 AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" \
18         -DSAVERDIR=\""$(pkglibexecdir)"\" \
19         -DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
20 else
21 AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" \
22         -DLOCALEDIR=\""$(localedir)"\" \
23         -DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
24 endif
26 noinst_PROGRAMS = man2hlp
27 man2hlp_LDADD = $(GLIB_LIBS)
29 mcmfmt_SOURCES = mfmt.c
31 cons_saver_SOURCES = cons.saver.c
33 man2hlp_SOURCES = man2hlp.c glibcompat.c
35 if USE_EDIT
36 EDITLIB = editor/libedit.a
37 endif
39 SRC_maintainer=logging.c logging.h
40 SRC_charset = charsets.c charsets.h selcodepage.c selcodepage.h
42 if USE_MAINTAINER_MODE
43     SRC_USE_maintainer=$(SRC_maintainer)
44 endif
46 if CHARSET
47     SRC_USE_charset=$(SRC_charset)
48 endif
50 mc_LDADD = \
51         ../lib/libmc.la \
52         $(EDITLIB) \
53         viewer/libmcviewer.la \
54         $(INTLLIBS) $(MCLIBS) $(SLANGLIB) $(LIBICONV) $(GLIB_LIBS)
56 SRC_mc_widgets = \
57         dialog.c dialog.h \
58         menu.c menu.h \
59         screen.c panel.h \
60         tree.c tree.h \
61         widget.c widget.h \
62         wtools.c wtools.h
64 SRC_mc_strutils = \
65         strescape.c strescape.h \
66         strutil8bit.c \
67         strutilascii.c \
68         strutil.c strutil.h \
69         strutilutf8.c
71 SRC_mc_conssaver = \
72         cons.handler.c cons.saver.h
74 SRC_mc_options = \
75         learn.c learn.h \
76         option.c option.h \
77         setup.c setup.h
79 SRC_mc_keybind = \
80         keybind.c keybind.h \
81         cmddef.h
83 SRC_mc_utils = \
84         util.c util.h \
85         utilunix.c \
86         unixcompat.h
88 SRC_mc_extended_charset = \
89         ecs.c ecs.h
91 mc_SOURCES = \
92         $(SRC_USE_maintainer) \
93         $(SRC_USE_charset) \
94         $(SRC_mc_widgets) \
95         $(SRC_mc_strutils) \
96         $(SRC_mc_conssaver) \
97         $(SRC_mc_options) \
98         $(SRC_mc_keybind) \
99         $(SRC_mc_utils) \
100         $(SRC_mc_extended_charset) \
101         achown.c achown.h \
102         args.c args.h \
103         background.c background.h \
104         boxes.c boxes.h \
105         chmod.c chmod.h \
106         chown.c chown.h \
107         cmd.c cmd.h \
108         command.c command.h \
109         complete.c \
110         dir.c dir.h \
111         execute.c execute.h \
112         ext.c ext.h \
113         file.c file.h \
114         filegui.c filegui.h \
115         fileloc.h \
116         filenot.c \
117         fileopctx.c fileopctx.h \
118         find.c find.h \
119         fs.h \
120         glibcompat.c glibcompat.h \
121         global.h \
122         help.c help.h \
123         history.h \
124         hotlist.c hotlist.h \
125         info.c info.h \
126         layout.c layout.h \
127         listmode.c listmode.h \
128         main.c main.h \
129         main-widgets.h \
130         mountlist.c mountlist.h \
131         panelize.c panelize.h \
132         subshell.c subshell.h \
133         textconf.c textconf.h \
134         timefmt.h \
135         treestore.c treestore.h \
136         user.c user.h
138 EXTRA_DIST = man2hlp.c $(SRC_maintainer) $(SRC_charset)
140 # automated testing
142 TESTS =                 ecs-test
144 check_PROGRAMS =        ecs-test
145 ecs_test_SOURCES =      ecs-test.c ecs.h ecs.c
146 ecs_test_LDADD =        $(GLIB_LIBS) $(INTLLIBS) $(MCLIBS)
148 # end of automated testing
150 install-exec-hook:
151         $(MAKE) install_mcview
152 if USE_EDIT
153         $(MAKE) install_mcedit
154 endif
157 # Make relative symlinks, but do the right thing if LN_S is `ln' or `cp'.
159 install_mcview:
160         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcview && $(LN_S) mc mcview
162 install_mcedit:
163         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcedit && $(LN_S) mc mcedit
165 uninstall-hook:
166         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcview
167 if USE_EDIT
168         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcedit
169 endif