Moved src/util.[ch] into lib, also moved unixcompat.h and utilunix.c.
[midnight-commander.git] / src / Makefile.am
blobdfb4783e7c5f2cee1f8d2499c2fcd8481d0841a3
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
28 mcmfmt_SOURCES = mfmt.c
30 cons_saver_SOURCES = cons.saver.c
32 man2hlp_SOURCES = man2hlp.c
33 man2hlp_LDADD = $(GLIB_LIBS) ../lib/libmc.la
35 if USE_EDIT
36 EDITLIB = editor/libedit.la
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 if USE_SAMBA_FS
57 # this is a hack for linking with own samba library in simple way
58 mc_LDADD += ../lib/vfs/mc-vfs/samba/libsamba.a
59 endif
62 SRC_mc_widgets = \
63         dialog.c dialog.h \
64         menu.c menu.h \
65         screen.c panel.h \
66         tree.c tree.h \
67         widget.c widget.h \
68         wtools.c wtools.h
70 SRC_mc_strutils = \
71         strescape.c strescape.h \
72         strutil8bit.c \
73         strutilascii.c \
74         strutil.c strutil.h \
75         strutilutf8.c
77 SRC_mc_conssaver = \
78         cons.handler.c cons.saver.h
80 SRC_mc_options = \
81         learn.c learn.h \
82         option.c option.h \
83         setup.c setup.h
85 SRC_mc_keybind = \
86         keybind.c keybind.h \
87         cmddef.h
89 SRC_mc_utils = \
90         utilunix.c \
91         unixcompat.h \
92         util.c util.h
94 SRC_mc_extended_charset = \
95         ecs.c ecs.h
97 mc_SOURCES = \
98         $(SRC_USE_maintainer) \
99         $(SRC_USE_charset) \
100         $(SRC_mc_widgets) \
101         $(SRC_mc_strutils) \
102         $(SRC_mc_conssaver) \
103         $(SRC_mc_options) \
104         $(SRC_mc_keybind) \
105         $(SRC_mc_utils) \
106         $(SRC_mc_extended_charset) \
107         achown.c achown.h \
108         args.c args.h \
109         background.c background.h \
110         boxes.c boxes.h \
111         chmod.c chmod.h \
112         chown.c chown.h \
113         cmd.c cmd.h \
114         command.c command.h \
115         complete.c \
116         dir.c dir.h \
117         execute.c execute.h \
118         ext.c ext.h \
119         file.c file.h \
120         filegui.c filegui.h \
121         filenot.c \
122         fileopctx.c fileopctx.h \
123         find.c find.h \
124         help.c help.h \
125         history.h \
126         hotlist.c hotlist.h \
127         info.c info.h \
128         layout.c layout.h \
129         listmode.c listmode.h \
130         main.c main.h \
131         main-widgets.h \
132         mountlist.c mountlist.h \
133         panelize.c panelize.h \
134         subshell.c subshell.h \
135         textconf.c textconf.h \
136         treestore.c treestore.h \
137         user.c user.h
139 EXTRA_DIST = man2hlp.c $(SRC_maintainer) $(SRC_charset)
141 # automated testing
143 TESTS =                 ecs-test
145 check_PROGRAMS =        ecs-test
146 ecs_test_SOURCES =      ecs-test.c ecs.h ecs.c
147 ecs_test_LDADD =        $(GLIB_LIBS) $(INTLLIBS) $(MCLIBS)
149 # end of automated testing
151 install-exec-hook:
152         $(MAKE) install_mcview
153 if USE_EDIT
154         $(MAKE) install_mcedit
155 endif
158 # Make relative symlinks, but do the right thing if LN_S is `ln' or `cp'.
160 install_mcview:
161         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcview && $(LN_S) mc mcview
163 install_mcedit:
164         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcedit && $(LN_S) mc mcedit
166 uninstall-hook:
167         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcview
168 if USE_EDIT
169         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcedit
170 endif