summaryrefslogtreecommitdiffstats
path: root/libtecla/Makefile.in
blob: cb0891f71b7ca1b67146547a918f4271098cda94 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
#-----------------------------------------------------------------------
# This is the template that the libtecla configure script uses to create
# the libtecla Makefile. It does this by replacing all instances of
# @name@ with the value of the correspondingly named configuration
# variable. You should find another file in the same directory as this
# one, called "configure.in". The latter file contains extensive comments
# explaining how this all works.
#-----------------------------------------------------------------------

# Where is the source code?

srcdir = @srcdir@

# Where do you want to install the library, its header file, and the man pages?

prefix=@prefix@
exec_prefix=@exec_prefix@
LIBDIR=@libdir@
INCDIR=@includedir@
MANDIR=@mandir@
BINDIR=@bindir@

# Which C compiler do you want to use?

CC = @CC@

# If 'make' doesn't define the MAKE variable, define it here.

@SET_MAKE@

# To use RANLIB set the RANLIB variable to ranlib. Otherwise set it to
# :, which is the bourne shell do-nothing command.

RANLIB = @RANLIB@

# Optional flags to pass to the linker.

LDFLAGS = @LDFLAGS@

# Optional C pre-processor flags.

CPPFLAGS = @CPPFLAGS@

# The following optional defines change the characteristics of the library.
#
# USE_TERMINFO
#   Use the terminfo terminal information database when looking up
#   terminal characteristics. Most modern UNIX and UNIX-like operating
#   systems support terminfo, so this define should normally be included.
#   If in doubt leave it in, and see if the library compiles.
# USE_TERMCAP
#   If you don't have terminfo but do have the termcap database, replace
#   the -DUSE_TERMINFO with -DUSE_TERMCAP. If there is a termcap.h in
#   /usr/include/, also add -DHAVE_TERMCAP_H.
#
# If neither USE_TERMINFO nor USE_TERMCAP are included, ANSI VT100 control
# sequences will be used to control all terminal types.
#
# For Solaris and Linux, use:
#
#  DEFINES = -DUSE_TERMINFO
#

DEFINES = @DEFS@

#
# The following defines are used in addition to the above when compiling
# the reentrant version of the library. Note that the definition of
# _POSIX_C_SOURCE to request reentrant functions, has the unfortunate
# side-effect on some systems of stopping the TIOCGWINSZ ioctl macro from
# getting defined. This in turn stops the library from being
# able to respond to terminal size changes. Under Solaris this can be
# remedied by adding -D__EXTENSIONS__. On linux this isn't necessary.
# If you don't get this right, the library will still work, but
# it will get confused if the terminal size gets changed and you try to
# edit a line that exceeds the terminal width.
#
# Thus on Solaris you should use:
#
#   DEFINES_R = -D_POSIX_C_SOURCE=199506L -D__EXTENSIONS__
#
# and on linux you should use:
#
#   DEFINES_R = -D_POSIX_C_SOURCE=199506L
#

DEFINES_R = @DEFS_R@

#
# The compiler optimization flags. I like to keep this separate so
# that I can set it to -g from the 'make' command line without having
# to edit this file when debugging the library. If you aren't working
# on modifying the library, leave this set to -O.
#

OPT = -O

#
# These are paranoid gcc warning flags to use when compiling new code.
# Simply invoke make with WARNING_FLAGS='$(PEDANTIC_FLAGS)'.
#
PEDANTIC_FLAGS=-Wall -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls

#
# Specify any extra compiler warning options that you want to use.
# Leave this blank unless you are porting the library to a new system,
# or modifying the library.
#

WARNING_FLAGS=

#
# If you want to compile the demo program, specify any system
# libraries that are needed for the terminal I/O functions.
#
# If you are using terminfo, you will probably only need -lcurses.
# For termcap you may need -ltermcap or -ltermlib.
#
# For Solaris, use:
#
#  LIBS = -lcurses
#
# For linux, use:
#
#  LIBS = -lncurses
#

LIBS = @LIBS@

#
# List the default target libraries. This should be one or
# both of the words "normal" and "reentrant".
#
TARGETS = @TARGETS@

#
# List which types of the above libraries are required.
# This should be one or both of the words "static" and "shared".
#
TARGET_LIBS = @TARGET_LIBS@

#
# If you want the demo programs to be built, the following variable
# should be assigned the single word: demos. If it isn't assigned
# anything, the demo programs won't be built.
#
DEMOS = demos

#
# List the programs that are to be made by default.
#
PROGRAMS = enhance

#
# List programs for which reentrant versions are to be built by default.
#
PROGRAMS_R =

#-----------------------------------------------------------------------
# You shouldn't need to change anything below this line.
#-----------------------------------------------------------------------

CFLAGS = $(OPT) $(WARNING_FLAGS) $(DEFINES) @CFLAGS@ @SHARED_CFLAGS@

default: $(TARGETS)

normal:
	@$(MAKE) -f $(srcdir)/Makefile.rules TARGETS="$(TARGET_LIBS)" SUFFIX="" CFLAGS="$(CFLAGS)" CC="$(CC)" OBJDIR=normal_obj LINK_SHARED='@LINK_SHARED@' SHARED_EXT='@SHARED_EXT@' SHARED_ALT='@SHARED_ALT@' LIBS='$(LIBS)' srcdir='$(srcdir)' LIBDIR='$(LIBDIR)' LN_S='@LN_S@' DEMOS="$(DEMOS)" PROGRAMS='$(PROGRAMS)' RANLIB='$(RANLIB)' LDFLAGS='$(LDFLAGS)' CPPFLAGS='$(CPPFLAGS)'

reentrant:
	@$(MAKE) -f $(srcdir)/Makefile.rules TARGETS="$(TARGET_LIBS)" SUFFIX="_r" CFLAGS="$(CFLAGS) $(DEFINES_R)" CC="$(CC)" OBJDIR=reentrant_obj LINK_SHARED='@LINK_SHARED@' SHARED_EXT='@SHARED_EXT@' SHARED_ALT='@SHARED_ALT@' LIBS='$(LIBS)' srcdir='$(srcdir)' LIBDIR='$(LIBDIR)' LN_S='@LN_S@' DEMOS="$(DEMOS)" PROGRAMS='$(PROGRAMS_R)' RANLIB='$(RANLIB)' LDFLAGS='$(LDFLAGS)' CPPFLAGS='$(CPPFLAGS)'

demos: normal

demos_r: reentrant

clean:
	rm -rf *.o normal_obj reentrant_obj libtecla*.a demo demo[0-9] demo_r demo[0-9]_r enhance *~ man/*~ man/*/*~ html/*~ compile_reentrant compile_normal `/bin/ls -1 man/*/*.in | sed 's/\.in$$//'`
	@endings="@SHARED_EXT@ @SHARED_ALT@" ; \
	for alt in $$endings ; do \
	  lib="libtecla*$$alt" ; \
	  rm -f $$lib; echo rm -f $$lib ; \
	done

distclean: clean
	rm -rf config.cache config.status config.log Makefile libtecla.map.opt \
               autom*.cache
	cp $(srcdir)/Makefile.stub Makefile

install_lib: $(TARGETS) $(LIBDIR)
	@for lib in libtecla.a libtecla_r.a ; do \
	   if [ -f $$lib ] ; then \
	     cp $$lib $(LIBDIR)/ ; chmod ugo+r $(LIBDIR)/$$lib; \
	     echo "cp $$lib $(LIBDIR)/ ; chmod ugo+r $(LIBDIR)/$$lib"; \
	   fi ; \
	done
	@for lib in libtecla libtecla_r ; do \
	   src="$$lib@SHARED_EXT@"; \
	   if [ -f $$src ] ; then \
	     dst="$(LIBDIR)/$$src"; \
	     cp -f $$src $$dst; chmod a=rX $$dst; \
	     echo "cp -f $$src $$dst ; chmod a=rX $$dst"; \
	     endings="@SHARED_ALT@" ; \
	     for alt in $$endings ; do \
	       lnk="$$lib$$alt"; \
	       (cd $(LIBDIR); rm -f $$lnk; @LN_S@ $$src $$lnk); \
	       echo "(cd $(LIBDIR); rm -f $$lnk; @LN_S@ $$src $$lnk)"; \
	     done ; \
	   fi ; \
	done

install_inc: $(INCDIR)
	@if [ -f $(srcdir)/libtecla.h ]; then \
	  cp $(srcdir)/libtecla.h $(INCDIR)/ ; chmod ugo+r $(INCDIR)/libtecla.h; \
	  echo "cp $(srcdir)/libtecla.h $(INCDIR)/ ; chmod ugo+r $(INCDIR)/libtecla.h"; \
	fi

install_man: $(MANDIR) libr_man func_man prog_man misc_man file_man

libr_man:
	if test "@MAKE_MAN_PAGES@"_ = "yes"_; then \
	  for template in man/libr/*.in; do \
	    page=`basename "$$template" .in`; \
	    $(srcdir)/install-sh -c -m 644 man/libr/$$page ${MANDIR}/@LIBR_MANDIR@/$$page.@LIBR_MANEXT@; \
	  done ; \
	fi

func_man:
	if test "@MAKE_MAN_PAGES@"_ = "yes"_; then \
	  for template in man/func/*.in; do \
	    page=`basename "$$template" .in`; \
	    $(srcdir)/install-sh -c -m 644 man/func/$$page ${MANDIR}/@FUNC_MANDIR@/$$page.@FUNC_MANEXT@; \
	  done ; \
	fi

prog_man:
	if test "@MAKE_MAN_PAGES@"_ = "yes"_; then \
	  for template in man/prog/*.in; do \
	    page=`basename "$$template" .in`; \
	    $(srcdir)/install-sh -c -m 644 man/prog/$$page ${MANDIR}/@PROG_MANDIR@/$$page.@PROG_MANEXT@; \
	  done ; \
	fi

misc_man:
	if test "@MAKE_MAN_PAGES@"_ = "yes"_; then \
	  for template in man/misc/*.in; do \
	    page=`basename "$$template" .in`; \
	    $(srcdir)/install-sh -c -m 644 man/misc/$$page ${MANDIR}/@MISC_MANDIR@/$$page.@MISC_MANEXT@; \
	  done ; \
	fi

file_man:
	if test "@MAKE_MAN_PAGES@"_ = "yes"_; then \
	  for template in man/file/*.in; do \
	    page=`basename "$$template" .in`; \
	    $(srcdir)/install-sh -c -m 644 man/file/$$page ${MANDIR}/@FILE_MANDIR@/$$page.@FILE_MANEXT@; \
	  done ; \
	fi

install_bin: $(BINDIR) $(PROGRAMS) $(PROGRAMS_R)
	progs="$(PROGRAMS) $(PROGRAMS_R)"; \
	for prog in $$progs; do \
	  $(srcdir)/install-sh -c -m 755 -s $$prog $(BINDIR)/; \
	done

install: install_lib install_inc install_man install_bin

# Make any missing installation directories.

$(MANDIR) $(LIBDIR) $(INCDIR) $(BINDIR):
	$(srcdir)/install-sh -d $@
	chmod ugo+rx $@