1## -*- text -*- ####################################################
2#								   #
3# Makefile for the GNU Tilde Library.				   #
4#								   #
5####################################################################
6
7# Copyright (C) 1996-2009 Free Software Foundation, Inc.     
8
9#   This program is free software: you can redistribute it and/or modify
10#   it under the terms of the GNU General Public License as published by
11#   the Free Software Foundation, either version 3 of the License, or
12#   (at your option) any later version.
13
14#   This program is distributed in the hope that it will be useful,
15#   but WITHOUT ANY WARRANTY; without even the implied warranty of
16#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17#   GNU General Public License for more details.
18
19#   You should have received a copy of the GNU General Public License
20#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
22srcdir = @srcdir@
23VPATH = .:@srcdir@
24topdir = @top_srcdir@
25BUILD_DIR = @BUILD_DIR@
26
27INSTALL = @INSTALL@
28INSTALL_PROGRAM = @INSTALL_PROGRAM@
29INSTALL_DATA = @INSTALL_DATA@
30
31CC = @CC@
32RANLIB = @RANLIB@
33AR = @AR@
34ARFLAGS = @ARFLAGS@
35RM = rm
36CP = cp
37MV = mv
38
39SHELL = @MAKE_SHELL@
40
41PROFILE_FLAGS = @PROFILE_FLAGS@
42
43CFLAGS = @CFLAGS@
44LOCAL_CFLAGS = @LOCAL_CFLAGS@
45CPPFLAGS = @CPPFLAGS@
46LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@
47
48DEFS = @DEFS@
49LOCAL_DEFS = @LOCAL_DEFS@
50
51BASHINCDIR = ${topdir}/include
52
53INCLUDES = -I. -I../.. -I$(topdir) -I${BASHINCDIR} -I$(topdir)/lib
54
55CCFLAGS = $(PROFILE_FLAGS) $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) \
56	  ${INCLUDES} $(LOCAL_CFLAGS) $(CFLAGS)
57
58.c.o:
59	$(CC) -c $(CCFLAGS) $<
60
61# The name of the library target.
62LIBRARY_NAME = libtilde.a
63
64# The C code source files for this library.
65CSOURCES = $(srcdir)/tilde.c
66
67# The header files for this library.
68HSOURCES = $(srcdir)/tilde.h
69
70OBJECTS = tilde.o
71
72# The texinfo files which document this library.
73DOCSOURCE = doc/tilde.texi
74DOCOBJECT = doc/tilde.dvi
75DOCSUPPORT = doc/Makefile
76DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
77
78SUPPORT = Makefile ChangeLog $(DOCSUPPORT)
79
80SOURCES  = $(CSOURCES) $(HSOURCES) $(DOCSOURCE)
81
82THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
83
84######################################################################
85
86all: $(LIBRARY_NAME)
87
88$(LIBRARY_NAME): $(OBJECTS)
89	$(RM) -f $@
90	$(AR) $(ARFLAGS) $@ $(OBJECTS)
91	-test -n "$(RANLIB)" && $(RANLIB) $@
92
93documentation: force
94	-(cd doc; $(MAKE) $(MFLAGS))
95
96force:
97
98# The rule for 'includes' is written funny so that the if statement
99# always returns TRUE unless there really was an error installing the
100# include files.
101install:
102	$(INSTALL_DATA) -c -m 644 $(LIBRARY_NAME) $(libdir)/$(LIBRARY_NAME)
103	-test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/$(LIBRARY_NAME)
104
105clean:
106	$(RM) -f $(OBJECTS) $(LIBRARY_NAME)
107	-( cd doc && $(MAKE) $(MFLAGS) $@ )
108
109realclean distclean maintainer-clean: clean
110	-( cd doc && $(MAKE) $(MFLAGS) $@ )
111	$(RM) -f Makefile
112
113mostlyclean: clean
114	-( cd doc && $(MAKE) $(MFLAGS) $@ )
115
116######################################################################
117#								     #
118#  Dependencies for the object files which make up this library.     #
119#								     #
120######################################################################
121
122tilde.o: tilde.h $(BASHINCDIR)/ansi_stdlib.h
123tilde.o: $(BUILD_DIR)/config.h
124
125# Rules for deficient makes, like SunOS and Solaris
126tilde.o: tilde.c
127