make internal library for testing purposes
[midnight-commander.git] / src / Makefile.am
blob34a8586833d4071c93a3e78a72234deb87fa6df4
1 SUBDIRS = filemanager man2hlp vfs viewer
3 if USE_EDIT
4 SUBDIRS += editor
5 endif
7 if USE_DIFF
8 SUBDIRS += diffviewer
9 endif
11 noinst_LTLIBRARIES = libinternal.la
13 AM_CPPFLAGS = \
14         -DSYSCONFDIR=\""$(sysconfdir)/@PACKAGE@/"\" \
15         -DLIBEXECDIR=\""$(libexecdir)/@PACKAGE@/"\" \
16         -DDATADIR=\""$(pkgdatadir)/"\" \
17         -DLOCALEDIR=\""$(localedir)"\" \
18         -DEXTHELPERSDIR=\""@EXTHELPERSDIR@/"\"
20 if CONS_SAVER
21 SUBDIRS += consaver
22 AM_CPPFLAGS += -DSAVERDIR=\""$(pkglibexecdir)"\"
23 endif
25 AM_CFLAGS = -I$(top_srcdir) $(GLIB_CFLAGS) $(PCRE_CFLAGS)
27 localedir = $(datadir)/locale
28 pkglibexecdir = $(libexecdir)/@PACKAGE@
30 bin_PROGRAMS = mc
32 if USE_EDIT
33 EDITLIB = editor/libedit.la
34 endif
36 if USE_DIFF
37 DIFFLIB = diffviewer/libdiffviewer.la
38 endif
40 libinternal_la_LIBADD = \
41         filemanager/libmcfilemanager.la \
42         vfs/libmc-vfs.la \
43         viewer/libmcviewer.la \
44         $(DIFFLIB) $(EDITLIB)
46 mc_LDADD = \
47         libinternal.la \
48         $(top_builddir)/lib/libmc.la
50 if ENABLE_VFS_SMB
51 # this is a hack for linking with own samba library in simple way
52 mc_LDADD += vfs/smbfs/helpers/libsamba.a
53 endif
55 SRC_mc_conssaver = \
56         cons.handler.c consaver/cons.saver.h
58 mc_SOURCES = \
59         main.c
61 libinternal_la_SOURCES = \
62         $(SRC_mc_conssaver) \
63         args.c args.h \
64         clipboard.c clipboard.h \
65         events_init.c events_init.h \
66         execute.c execute.h \
67         help.c help.h \
68         history.h \
69         keybind-defaults.c keybind-defaults.h \
70         learn.c learn.h \
71         setup.c setup.h \
72         subshell.c subshell.h \
73         textconf.c textconf.h \
74         util.c util.h
76 if CHARSET
77     libinternal_la_SOURCES += selcodepage.c selcodepage.h
78 endif
80 if ENABLE_BACKGROUND
81     libinternal_la_SOURCES += background.c background.h
82 endif
84 EXTRA_DIST = $(SRC_maintainer) $(SRC_charset)
86 # end of automated testing
88 install-exec-hook:
89         $(MAKE) install_mcview
90 if USE_EDIT
91         $(MAKE) install_mcedit
92 endif
93 if USE_DIFF
94         $(MAKE) install_mcdiff
95 endif
98 # Make relative symlinks, but do the right thing if LN_S is `ln' or `cp'.
100 install_mcview:
101         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcview && $(LN_S) mc mcview
103 install_mcedit:
104         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcedit && $(LN_S) mc mcedit
106 install_mcdiff:
107         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcdiff && $(LN_S) mc mcdiff
109 uninstall-hook:
110         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcview
111 if USE_EDIT
112         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcedit
113 endif
114 if USE_DIFF
115         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcdiff
116 endif