2 # This is the Makefile for the readline examples subdirectory.
4 # Copyright (C) 1994,2008,2009 Free Software Foundation, Inc.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 RL_LIBRARY_VERSION
= @LIBVERSION@
25 exec_prefix = @
exec_prefix@
27 datarootdir
= @datarootdir@
33 top_srcdir
= @top_srcdir@
35 BUILD_DIR
= @BUILD_DIR@
36 installdir
= $(datadir)/readline
39 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
40 INSTALL_DATA
= @INSTALL_DATA@
45 # Support an alternate destination root directory for package building
51 LOCAL_CFLAGS
= @LOCAL_CFLAGS@
-DREADLINE_LIBRARY
-DRL_LIBRARY_VERSION
='"$(RL_LIBRARY_VERSION)"'
54 INCLUDES
= -I
$(srcdir) -I
$(top_srcdir
) -I..
56 CCFLAGS
= $(DEFS
) $(LOCAL_CFLAGS
) $(CPPFLAGS
) $(INCLUDES
) $(CFLAGS
)
57 LDFLAGS
= -g
-L.. @LDFLAGS@
61 READLINE_LIB
= ..
/libreadline.a
62 HISTORY_LIB
= ..
/libhistory.a
64 TERMCAP_LIB
= @TERMCAP_LIB@
68 $(CC
) $(CCFLAGS
) -c
$<
70 SOURCES
= excallback.c fileman.c histexamp.c manexamp.c rl-fgets.c rl.c \
71 rlcat.c rlevent.c rlptytest.c rltest.c rlversion.c
73 EXECUTABLES
= fileman
$(EXEEXT
) rltest
$(EXEEXT
) rl
$(EXEEXT
) rlcat
$(EXEEXT
) \
74 rlevent
$(EXEEXT
) rlversion
$(EXEEXT
) histexamp
$(EXEEXT
)
75 OBJECTS
= fileman.o rltest.o rl.o rlevent.o rlcat.o rlversion.o histexamp.o
80 check: rlversion
$(EXEEXT
)
81 @echo Readline version
: `rlversion$(EXEEXT)`
84 -$(SHELL
) $(top_srcdir
)/support
/mkdirs
$(DESTDIR
)$(installdir
)
87 @for f in
$(SOURCES
); do \
88 $(RM
) $(DESTDIR
)$(installdir
)/$$f ; \
89 $(INSTALL_DATA
) $(srcdir)/$$f $(DESTDIR
)$(installdir
) ; \
93 @for f in
$(SOURCES
); do \
94 $(RM
) $(DESTDIR
)$(installdir
)/$$f ; \
96 -rmdir
$(DESTDIR
)$(installdir
)
98 rl
$(EXEEXT
): rl.o
$(READLINE_LIB
)
99 $(PURIFY
) $(CC
) $(LDFLAGS
) -o
$@ rl.o
$(READLINE_LIB
) $(TERMCAP_LIB
)
101 rlcat
$(EXEEXT
): rlcat.o
$(READLINE_LIB
)
102 $(PURIFY
) $(CC
) $(LDFLAGS
) -o
$@ rlcat.o
$(READLINE_LIB
) $(TERMCAP_LIB
)
104 rlevent
$(EXEEXT
): rlevent.o
$(READLINE_LIB
)
105 $(PURIFY
) $(CC
) $(LDFLAGS
) -o
$@ rlevent.o
$(READLINE_LIB
) $(TERMCAP_LIB
)
107 fileman
$(EXEEXT
): fileman.o
$(READLINE_LIB
)
108 $(PURIFY
) $(CC
) $(LDFLAGS
) -o
$@ fileman.o
$(READLINE_LIB
) $(TERMCAP_LIB
)
110 rltest
$(EXEEXT
): rltest.o
$(READLINE_LIB
)
111 $(PURIFY
) $(CC
) $(LDFLAGS
) -o
$@ rltest.o
$(READLINE_LIB
) $(TERMCAP_LIB
)
113 rlptytest
$(EXEEXT
): rlptytest.o
$(READLINE_LIB
)
114 $(PURIFY
) $(CC
) $(LDFLAGS
) -o
$@ rlptytest.o
$(READLINE_LIB
) $(TERMCAP_LIB
)
116 rlversion
$(EXEEXT
): rlversion.o
$(READLINE_LIB
)
117 $(CC
) $(LDFLAGS
) -o
$@ rlversion.o
$(READLINE_LIB
) $(TERMCAP_LIB
)
119 histexamp
$(EXEEXT
): histexamp.o
$(HISTORY_LIB
)
120 $(PURIFY
) $(CC
) $(LDFLAGS
) -o
$@ histexamp.o
-lhistory
$(TERMCAP_LIB
)
124 $(RM
) $(EXECUTABLES
) *.exe
126 distclean maintainer-clean
: clean
132 rlversion.o
: rlversion.c
133 histexamp.o
: histexamp.c
135 rlptytest.o
: rlptytest.c
137 fileman.o
: $(top_srcdir
)/readline.h
138 rltest.o
: $(top_srcdir
)/readline.h
139 rl.o
: $(top_srcdir
)/readline.h
140 rlversion.o
: $(top_srcdir
)/readline.h
141 histexamp.o
: $(top_srcdir
)/history.h
142 rlcat.o
: $(top_srcdir
)/readline.h
$(top_srcdir
)/history.h
143 rlptytest.o
: $(top_srcdir
)/readline.h
$(top_srcdir
)/history.h