blob: d5506c500b02f48c19809a720bddcf29c86f1d8a [file] [log] [blame]
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001## -*- text -*- ####################################################
2# #
3# Makefile for the GNU Tilde Library. #
4# #
5####################################################################
6
Jari Aalto31859422009-01-12 13:36:28 +00007# Copyright (C) 1996-2009 Free Software Foundation, Inc.
Jari Aaltobb706242000-03-17 21:46:59 +00008
Jari Aalto31859422009-01-12 13:36:28 +00009# 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.
Jari Aaltobb706242000-03-17 21:46:59 +000013
Jari Aalto31859422009-01-12 13:36:28 +000014# 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.
Jari Aaltobb706242000-03-17 21:46:59 +000018
Jari Aalto31859422009-01-12 13:36:28 +000019# 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/>.
Jari Aaltobb706242000-03-17 21:46:59 +000021
Jari Aaltoccc6cda1996-12-23 17:02:34 +000022srcdir = @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@
Jari Aaltob72432f1999-02-19 17:11:39 +000034ARFLAGS = @ARFLAGS@
Jari Aaltoccc6cda1996-12-23 17:02:34 +000035RM = rm
36CP = cp
37MV = mv
38
Jari Aaltob72432f1999-02-19 17:11:39 +000039SHELL = @MAKE_SHELL@
40
Jari Aalto7117c2d2002-07-17 14:10:11 +000041PROFILE_FLAGS = @PROFILE_FLAGS@
42
Jari Aaltod166f041997-06-05 14:59:13 +000043CFLAGS = @CFLAGS@
44LOCAL_CFLAGS = @LOCAL_CFLAGS@
Jari Aaltoccc6cda1996-12-23 17:02:34 +000045CPPFLAGS = @CPPFLAGS@
46LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@
47
48DEFS = @DEFS@
Jari Aaltod166f041997-06-05 14:59:13 +000049LOCAL_DEFS = @LOCAL_DEFS@
Jari Aaltoccc6cda1996-12-23 17:02:34 +000050
Jari Aaltobb706242000-03-17 21:46:59 +000051BASHINCDIR = ${topdir}/include
52
53INCLUDES = -I. -I../.. -I$(topdir) -I${BASHINCDIR} -I$(topdir)/lib
Jari Aaltoccc6cda1996-12-23 17:02:34 +000054
Jari Aalto7117c2d2002-07-17 14:10:11 +000055CCFLAGS = $(PROFILE_FLAGS) $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) \
56 ${INCLUDES} $(LOCAL_CFLAGS) $(CFLAGS)
Jari Aaltoccc6cda1996-12-23 17:02:34 +000057
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 $@
Jari Aaltob72432f1999-02-19 17:11:39 +000090 $(AR) $(ARFLAGS) $@ $(OBJECTS)
Jari Aaltoccc6cda1996-12-23 17:02:34 +000091 -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:
Jari Aaltof73dda02001-11-13 17:56:06 +0000102 $(INSTALL_DATA) -c -m 644 $(LIBRARY_NAME) $(libdir)/$(LIBRARY_NAME)
103 -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/$(LIBRARY_NAME)
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000104
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
Jari Aaltobb706242000-03-17 21:46:59 +0000122tilde.o: tilde.h $(BASHINCDIR)/ansi_stdlib.h
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000123tilde.o: $(BUILD_DIR)/config.h
Jari Aaltoe8ce7751997-09-22 20:22:27 +0000124
125# Rules for deficient makes, like SunOS and Solaris
126tilde.o: tilde.c