Commit | Line | Data |
---|---|---|
d60d9f65 | 1 | # |
1b17e766 EZ |
2 | # This is the Makefile for the readline examples subdirectory. |
3 | # | |
cc88a640 | 4 | # Copyright (C) 1994,2008,2009 Free Software Foundation, Inc. |
1b17e766 | 5 | |
cc88a640 JK |
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. | |
1b17e766 | 10 | |
cc88a640 JK |
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, see <http://www.gnu.org/licenses/>. | |
1b17e766 | 18 | |
9255ee31 | 19 | RL_LIBRARY_VERSION = @LIBVERSION@ |
1b17e766 | 20 | |
c862e87b | 21 | SHELL = @MAKE_SHELL@ |
d60d9f65 SS |
22 | RM = rm -f |
23 | ||
cc88a640 JK |
24 | prefix = @prefix@ |
25 | exec_prefix = @exec_prefix@ | |
26 | ||
27 | datarootdir = @datarootdir@ | |
28 | ||
29 | bindir = @bindir@ | |
d60d9f65 | 30 | srcdir = @srcdir@ |
cc88a640 JK |
31 | datadir = @datadir@ |
32 | VPATH = @srcdir@ | |
d60d9f65 | 33 | top_srcdir = @top_srcdir@ |
cc88a640 JK |
34 | #BUILD_DIR = . |
35 | BUILD_DIR = @BUILD_DIR@ | |
36 | installdir = $(datadir)/readline | |
37 | ||
38 | INSTALL = @INSTALL@ | |
39 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
40 | INSTALL_DATA = @INSTALL_DATA@ | |
41 | ||
42 | EXEEXT = @EXEEXT@ | |
43 | OBJEXT = @OBJEXT@ | |
d60d9f65 | 44 | |
9255ee31 EZ |
45 | # Support an alternate destination root directory for package building |
46 | DESTDIR = | |
47 | ||
d60d9f65 SS |
48 | DEFS = @DEFS@ |
49 | CC = @CC@ | |
50 | CFLAGS = @CFLAGS@ | |
9255ee31 | 51 | LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DREADLINE_LIBRARY -DRL_LIBRARY_VERSION='"$(RL_LIBRARY_VERSION)"' |
d60d9f65 SS |
52 | CPPFLAGS = @CPPFLAGS@ |
53 | ||
c862e87b | 54 | INCLUDES = -I$(srcdir) -I$(top_srcdir) -I.. |
d60d9f65 SS |
55 | |
56 | CCFLAGS = $(DEFS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) | |
9255ee31 | 57 | LDFLAGS = -g -L.. @LDFLAGS@ |
d60d9f65 | 58 | |
5bdf8622 DJ |
59 | PURIFY = @PURIFY@ |
60 | ||
1b17e766 EZ |
61 | READLINE_LIB = ../libreadline.a |
62 | HISTORY_LIB = ../libhistory.a | |
63 | ||
d60d9f65 SS |
64 | TERMCAP_LIB = @TERMCAP_LIB@ |
65 | ||
66 | .c.o: | |
c862e87b | 67 | ${RM} $@ |
d60d9f65 SS |
68 | $(CC) $(CCFLAGS) -c $< |
69 | ||
cc88a640 JK |
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 | |
72 | ||
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 | |
d60d9f65 SS |
76 | |
77 | all: $(EXECUTABLES) | |
5bdf8622 | 78 | everything: all |
d60d9f65 | 79 | |
cc88a640 JK |
80 | check: rlversion$(EXEEXT) |
81 | @echo Readline version: `rlversion$(EXEEXT)` | |
82 | ||
83 | installdirs: | |
84 | -$(SHELL) $(top_srcdir)/support/mkdirs $(DESTDIR)$(installdir) | |
85 | ||
86 | install: installdirs | |
87 | @for f in $(SOURCES); do \ | |
88 | $(RM) $(DESTDIR)$(installdir)/$$f ; \ | |
89 | $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(installdir) ; \ | |
90 | done | |
91 | ||
92 | uninstall: | |
93 | @for f in $(SOURCES); do \ | |
94 | $(RM) $(DESTDIR)$(installdir)/$$f ; \ | |
95 | done | |
96 | -rmdir $(DESTDIR)$(installdir) | |
97 | ||
98 | rl$(EXEEXT): rl.o $(READLINE_LIB) | |
5bdf8622 | 99 | $(PURIFY) $(CC) $(LDFLAGS) -o $@ rl.o $(READLINE_LIB) $(TERMCAP_LIB) |
d60d9f65 | 100 | |
cc88a640 | 101 | rlcat$(EXEEXT): rlcat.o $(READLINE_LIB) |
5bdf8622 | 102 | $(PURIFY) $(CC) $(LDFLAGS) -o $@ rlcat.o $(READLINE_LIB) $(TERMCAP_LIB) |
9255ee31 | 103 | |
cc88a640 JK |
104 | rlevent$(EXEEXT): rlevent.o $(READLINE_LIB) |
105 | $(PURIFY) $(CC) $(LDFLAGS) -o $@ rlevent.o $(READLINE_LIB) $(TERMCAP_LIB) | |
106 | ||
107 | fileman$(EXEEXT): fileman.o $(READLINE_LIB) | |
5bdf8622 | 108 | $(PURIFY) $(CC) $(LDFLAGS) -o $@ fileman.o $(READLINE_LIB) $(TERMCAP_LIB) |
d60d9f65 | 109 | |
cc88a640 | 110 | rltest$(EXEEXT): rltest.o $(READLINE_LIB) |
5bdf8622 DJ |
111 | $(PURIFY) $(CC) $(LDFLAGS) -o $@ rltest.o $(READLINE_LIB) $(TERMCAP_LIB) |
112 | ||
cc88a640 | 113 | rlptytest$(EXEEXT): rlptytest.o $(READLINE_LIB) |
5bdf8622 | 114 | $(PURIFY) $(CC) $(LDFLAGS) -o $@ rlptytest.o $(READLINE_LIB) $(TERMCAP_LIB) |
d60d9f65 | 115 | |
cc88a640 | 116 | rlversion$(EXEEXT): rlversion.o $(READLINE_LIB) |
5bdf8622 | 117 | $(CC) $(LDFLAGS) -o $@ rlversion.o $(READLINE_LIB) $(TERMCAP_LIB) |
c862e87b | 118 | |
cc88a640 | 119 | histexamp$(EXEEXT): histexamp.o $(HISTORY_LIB) |
5bdf8622 | 120 | $(PURIFY) $(CC) $(LDFLAGS) -o $@ histexamp.o -lhistory $(TERMCAP_LIB) |
9255ee31 | 121 | |
d60d9f65 SS |
122 | clean mostlyclean: |
123 | $(RM) $(OBJECTS) | |
1b17e766 | 124 | $(RM) $(EXECUTABLES) *.exe |
d60d9f65 SS |
125 | |
126 | distclean maintainer-clean: clean | |
127 | $(RM) Makefile | |
128 | ||
129 | fileman.o: fileman.c | |
130 | rltest.o: rltest.c | |
131 | rl.o: rl.c | |
c862e87b | 132 | rlversion.o: rlversion.c |
9255ee31 | 133 | histexamp.o: histexamp.c |
5bdf8622 DJ |
134 | rlcat.o: rlcat.c |
135 | rlptytest.o: rlptytest.c | |
9255ee31 EZ |
136 | |
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 | |
5bdf8622 DJ |
142 | rlcat.o: $(top_srcdir)/readline.h $(top_srcdir)/history.h |
143 | rlptytest.o: $(top_srcdir)/readline.h $(top_srcdir)/history.h |