Original patch as attached on the bugreport
[midnight-commander.git] / src / Makefile.am
bloba4713a6256e1a04f3dc558e58075af56eda16f17
1 AM_CFLAGS = $(GLIB_CFLAGS)
3 localedir = $(datadir)/locale
4 pkglibexecdir =         $(libexecdir)/@PACKAGE@
6 bin_PROGRAMS = mc mcmfmt
8 if CONS_SAVER
9 pkglibexec_PROGRAMS = cons.saver
10 AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\" \
11         -DSAVERDIR=\""$(pkglibexecdir)"\"
12 else
13 AM_CPPFLAGS = -DDATADIR=\""$(pkgdatadir)/"\" -DLOCALEDIR=\""$(localedir)"\"
14 endif
16 noinst_PROGRAMS = man2hlp
17 man2hlp_LDADD = $(GLIB_LIBS)
19 mcmfmt_SOURCES = mfmt.c
21 cons_saver_SOURCES = cons.saver.c
23 man2hlp_SOURCES = man2hlp.c glibcompat.c
25 if INCLUDED_SLANG
26 SLANGLIB = ../slang/libmcslang.a
27 endif
29 if USE_EDIT
30 EDITLIB = ../edit/libedit.a
31 endif
33 if USE_VFS
34 if USE_SAMBA_FS
35 VFSLIB = ../vfs/libvfs-mc.a ../vfs/samba/libsamba.a
36 else
37 VFSLIB = ../vfs/libvfs-mc.a
38 endif
39 endif
41 mc_LDADD = $(EDITLIB) $(SLANGLIB) $(VFSLIB) \
42         $(INTLLIBS) $(GLIB_LIBS) $(MCLIBS) $(LIBICONV)
44 CHARSET_SRC = charsets.c charsets.h selcodepage.c selcodepage.h
46 SRCS =  achown.c achown.h background.c background.h boxes.c boxes.h     \
47         chmod.c chmod.h chown.c chown.h cmd.c cmd.h color.c color.h     \
48         command.c command.h complete.c complete.h cons.handler.c        \
49         cons.saver.h dialog.c dialog.h dir.c dir.h                      \
50         eregex.h execute.c execute.h ext.c ext.h file.c filegui.c       \
51         filegui.h file.h filenot.c fileopctx.c fileopctx.h find.c       \
52         find.h findme.c findme.h fs.h                                   \
53         glibcompat.c glibcompat.h global.h help.c help.h hotlist.c      \
54         hotlist.h info.c info.h key.c key.h keyxdef.c layout.c          \
55         layout.h learn.c learn.h listmode.c listmode.h                  \
56         logging.h logging.c                                             \
57         main.c main.h                                                   \
58         menu.c menu.h mountlist.c mountlist.h mouse.c mouse.h myslang.h \
59         option.c option.h panel.h panelize.c panelize.h poptalloca.h    \
60         popt.c poptconfig.c popt.h popthelp.c poptint.h poptparse.c     \
61         profile.c profile.h regex.c rxvt.c screen.c setup.c setup.h     \
62         slint.c subshell.c subshell.h textconf.c textconf.h             \
63         tree.c tree.h treestore.c treestore.h timefmt.h tty.c tty.h user.c      \
64         user.h util.c util.h utilunix.c view.c view.h vfsdummy.h widget.c       \
65         widget.h win.c win.h wtools.c wtools.h unixcompat.h             \
66         x11conn.h x11conn.c ecs.h ecs.c
68 if CHARSET
69 mc_SOURCES = $(SRCS) $(CHARSET_SRC)
70 else
71 mc_SOURCES = $(SRCS)
72 endif
74 EXTRA_DIST = ChangeLog OChangeLog man2hlp.c $(CHARSET_SRC)
76 # automated testing
78 TESTS =                 ecs-test
80 check_PROGRAMS =        ecs-test
81 ecs_test_SOURCES =      ecs-test.c ecs.h ecs.c
82 ecs_test_LDADD =        $(GLIB_LIBS) $(INTLLIBS) $(MCLIBS)
84 # end of automated testing
86 install-exec-hook:
87         $(MAKE) install_mcview
88 if USE_EDIT
89         $(MAKE) install_mcedit
90 endif
93 # Make relative symlinks, but do the right thing if LN_S is `ln' or `cp'.
95 install_mcview:
96         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcview && $(LN_S) mc mcview
98 install_mcedit:
99         cd $(DESTDIR)$(bindir)/$(binprefix) && rm -f mcedit && $(LN_S) mc mcedit
101 uninstall-hook:
102         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcview
103 if USE_EDIT
104         rm -f $(DESTDIR)$(bindir)/$(binprefix)/mcedit
105 endif