1#
2# This is the Makefile for the readline examples subdirectory.
3#
4# Copyright (C) 1994 Free Software Foundation, Inc.
5
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 2, or (at your option)
9# any later version.
10
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.
15
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
19RL_LIBRARY_VERSION = @LIBVERSION@
20
21SHELL = @MAKE_SHELL@
22RM = rm -f
23
24srcdir = @srcdir@
25VPATH = .:@srcdir@
26top_srcdir = @top_srcdir@
27BUILD_DIR = .
28
29# Support an alternate destination root directory for package building
30DESTDIR =
31
32DEFS = @DEFS@
33CC = @CC@
34CFLAGS = @CFLAGS@
35LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DREADLINE_LIBRARY -DRL_LIBRARY_VERSION='"$(RL_LIBRARY_VERSION)"'
36CPPFLAGS = @CPPFLAGS@
37
38INCLUDES = -I$(srcdir) -I$(top_srcdir) -I..
39
40CCFLAGS  = $(DEFS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS)
41LDFLAGS = -g -L.. @LDFLAGS@
42
43PURIFY = @PURIFY@
44
45READLINE_LIB = ../libreadline.a
46HISTORY_LIB = ../libhistory.a
47
48TERMCAP_LIB = @TERMCAP_LIB@
49
50.c.o:
51	${RM} $@
52	$(CC) $(CCFLAGS) -c $<
53
54EXECUTABLES = fileman rltest rl rlcat rlversion histexamp 
55OBJECTS = fileman.o rltest.o rl.o rlcat.o rlversion.o histexamp.o
56
57all: $(EXECUTABLES)
58everything: all
59
60rl: rl.o $(READLINE_LIB)
61	$(PURIFY) $(CC) $(LDFLAGS) -o $@ rl.o $(READLINE_LIB) $(TERMCAP_LIB)
62
63rlcat: rlcat.o $(READLINE_LIB)
64	$(PURIFY) $(CC) $(LDFLAGS) -o $@ rlcat.o $(READLINE_LIB) $(TERMCAP_LIB)
65
66fileman: fileman.o $(READLINE_LIB)
67	$(PURIFY) $(CC) $(LDFLAGS) -o $@ fileman.o $(READLINE_LIB) $(TERMCAP_LIB)
68
69rltest: rltest.o $(READLINE_LIB)
70	$(PURIFY) $(CC) $(LDFLAGS) -o $@ rltest.o $(READLINE_LIB) $(TERMCAP_LIB)
71
72rlptytest: rlptytest.o $(READLINE_LIB)
73	$(PURIFY) $(CC) $(LDFLAGS) -o $@ rlptytest.o $(READLINE_LIB) $(TERMCAP_LIB)
74
75rlversion: rlversion.o $(READLINE_LIB)
76	$(CC) $(LDFLAGS) -o $@ rlversion.o $(READLINE_LIB) $(TERMCAP_LIB)
77
78histexamp: histexamp.o $(HISTORY_LIB)
79	$(PURIFY) $(CC) $(LDFLAGS) -o $@ histexamp.o -lhistory $(TERMCAP_LIB)
80
81clean mostlyclean:
82	$(RM) $(OBJECTS)
83	$(RM) $(EXECUTABLES) *.exe
84
85distclean maintainer-clean: clean
86	$(RM) Makefile
87
88fileman.o: fileman.c
89rltest.o: rltest.c
90rl.o: rl.c
91rlversion.o: rlversion.c
92histexamp.o: histexamp.c
93rlcat.o: rlcat.c
94rlptytest.o: rlptytest.c
95
96fileman.o: $(top_srcdir)/readline.h
97rltest.o: $(top_srcdir)/readline.h
98rl.o: $(top_srcdir)/readline.h
99rlversion.o: $(top_srcdir)/readline.h
100histexamp.o: $(top_srcdir)/history.h
101rlcat.o: $(top_srcdir)/readline.h $(top_srcdir)/history.h
102rlptytest.o: $(top_srcdir)/readline.h $(top_srcdir)/history.h
103