Merge branch 'DEV_mcview2'
[midnight-commander.git] / src / Makefile.am
blob57404f4a401157ad6275fb95d54b8647e764d13f
1 SUBDIRS = mcconfig search tty viewer
3 AM_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) $(PCRE_CFLAGS)
5 localedir = $(datadir)/locale
6 pkglibexecdir =         $(libexecdir)/@PACKAGE@
8 bin_PROGRAMS = mc mcmfmt
10 if CONS_SAVER
11 pkglibexec_PROGRAMS = cons.saver
12 AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" \
13         -DSAVERDIR=\""$(pkglibexecdir)"\" \
14         -DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
15 else
16 AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" \
17         -DLOCALEDIR=\""$(localedir)"\" \
18         -DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\"
19 endif
21 noinst_PROGRAMS = man2hlp
22 man2hlp_LDADD = $(GLIB_LIBS)
24 mcmfmt_SOURCES = mfmt.c
26 cons_saver_SOURCES = cons.saver.c
28 man2hlp_SOURCES = man2hlp.c glibcompat.c
30 if USE_EDIT
31 EDITLIB = ../edit/libedit.a
32 endif
34 if USE_VFS
35 if USE_SAMBA_FS
36 VFSLIB = ../vfs/libvfs-mc.a ../vfs/samba/libsamba.a
37 else
38 VFSLIB = ../vfs/libvfs-mc.a
39 endif
40 endif
42 MCCONFIGLIB = mcconfig/libmcconfig.la
43 SEARCHLIB = search/libsearch.la
44 TTYLIB =  tty/libmctty.la
45 VIEWERLIB = viewer/libmcviewer.la
47 mc_LDADD = $(EDITLIB) $(VFSLIB) \
48         $(MCCONFIGLIB) $(SEARCHLIB) $(TTYLIB) $(VIEWERLIB) \
49         $(INTLLIBS) $(MCLIBS) $(SLANGLIB) $(LIBICONV) $(GLIB_LIBS)
51 CHARSET_SRC = charsets.c charsets.h selcodepage.c selcodepage.h
53 SRCS =  achown.c achown.h background.c background.h boxes.c boxes.h     \
54         chmod.c chmod.h chown.c chown.h cmd.c cmd.h                     \
55         command.c command.h complete.c cons.handler.c                   \
56         cons.saver.h dialog.c dialog.h dir.c dir.h                      \
57         execute.c execute.h ext.c ext.h file.c filegui.c                \
58         filegui.h file.h filenot.c fileopctx.c fileopctx.h find.c       \
59         find.h findme.c findme.h fs.h                                   \
60         glibcompat.c glibcompat.h global.h help.c help.h hotlist.c      \
61         hotlist.h info.c info.h layout.c                                \
62         layout.h learn.c learn.h listmode.c listmode.h history.h        \
63         logging.h logging.c main.c main.h main-widgets.h                \
64         menu.c menu.h mountlist.c mountlist.h                           \
65         option.c option.h panel.h panelize.c panelize.h poptalloca.h    \
66         popt.c poptconfig.c popt.h popthelp.c poptint.h poptparse.c     \
67         screen.c setup.c setup.h                                        \
68         subshell.c subshell.h textconf.c textconf.h                     \
69         tree.c tree.h treestore.c treestore.h timefmt.h user.c          \
70         user.h util.c util.h utilunix.c vfsdummy.h                      \
71         widget.c widget.h wtools.c wtools.h unixcompat.h                \
72         ecs.h ecs.c                                                     \
73         strutil.h strutil.c strutilascii.c strutil8bit.c strutilutf8.c  \
74         search/search.h strescape.c strescape.h
76 if CHARSET
77 mc_SOURCES = $(SRCS) $(CHARSET_SRC)
78 else
79 mc_SOURCES = $(SRCS)
80 endif
82 EXTRA_DIST = man2hlp.c $(CHARSET_SRC)
84 # automated testing
86 TESTS =                 ecs-test
88 check_PROGRAMS =        ecs-test
89 ecs_test_SOURCES =      ecs-test.c ecs.h ecs.c
90 ecs_test_LDADD =        $(GLIB_LIBS) $(INTLLIBS) $(MCLIBS)
92 # end of automated testing
94 install-exec-hook:
95         $(MAKE) install_mcview
96 if USE_EDIT
97         $(MAKE) install_mcedit
98 endif
101 # Make relative symlinks, but do the right thing if LN_S is `ln' or `cp'.
103 install_mcview:
104         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcview && $(LN_S) mc mcview
106 install_mcedit:
107         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcedit && $(LN_S) mc mcedit
109 uninstall-hook:
110         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcview
111 if USE_EDIT
112         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcedit
113 endif