Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 1 | ## -*- text -*- #################################################### |
| 2 | # # |
| 3 | # Makefile for the GNU Tilde Library. # |
| 4 | # # |
| 5 | #################################################################### |
| 6 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 7 | # Copyright (C) 1996-2009 Free Software Foundation, Inc. |
Jari Aalto | bb70624 | 2000-03-17 21:46:59 +0000 | [diff] [blame] | 8 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 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. |
Jari Aalto | bb70624 | 2000-03-17 21:46:59 +0000 | [diff] [blame] | 13 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 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. |
Jari Aalto | bb70624 | 2000-03-17 21:46:59 +0000 | [diff] [blame] | 18 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 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/>. |
Jari Aalto | bb70624 | 2000-03-17 21:46:59 +0000 | [diff] [blame] | 21 | |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 22 | srcdir = @srcdir@ |
| 23 | VPATH = .:@srcdir@ |
| 24 | topdir = @top_srcdir@ |
| 25 | BUILD_DIR = @BUILD_DIR@ |
| 26 | |
| 27 | INSTALL = @INSTALL@ |
| 28 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
| 29 | INSTALL_DATA = @INSTALL_DATA@ |
| 30 | |
| 31 | CC = @CC@ |
| 32 | RANLIB = @RANLIB@ |
| 33 | AR = @AR@ |
Jari Aalto | b72432f | 1999-02-19 17:11:39 +0000 | [diff] [blame] | 34 | ARFLAGS = @ARFLAGS@ |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 35 | RM = rm |
| 36 | CP = cp |
| 37 | MV = mv |
| 38 | |
Jari Aalto | b72432f | 1999-02-19 17:11:39 +0000 | [diff] [blame] | 39 | SHELL = @MAKE_SHELL@ |
| 40 | |
Jari Aalto | 7117c2d | 2002-07-17 14:10:11 +0000 | [diff] [blame] | 41 | PROFILE_FLAGS = @PROFILE_FLAGS@ |
| 42 | |
Jari Aalto | d166f04 | 1997-06-05 14:59:13 +0000 | [diff] [blame] | 43 | CFLAGS = @CFLAGS@ |
| 44 | LOCAL_CFLAGS = @LOCAL_CFLAGS@ |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 45 | CPPFLAGS = @CPPFLAGS@ |
| 46 | LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@ |
| 47 | |
| 48 | DEFS = @DEFS@ |
Jari Aalto | d166f04 | 1997-06-05 14:59:13 +0000 | [diff] [blame] | 49 | LOCAL_DEFS = @LOCAL_DEFS@ |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 50 | |
Jari Aalto | bb70624 | 2000-03-17 21:46:59 +0000 | [diff] [blame] | 51 | BASHINCDIR = ${topdir}/include |
| 52 | |
| 53 | INCLUDES = -I. -I../.. -I$(topdir) -I${BASHINCDIR} -I$(topdir)/lib |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 54 | |
Jari Aalto | 7117c2d | 2002-07-17 14:10:11 +0000 | [diff] [blame] | 55 | CCFLAGS = $(PROFILE_FLAGS) $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) \ |
| 56 | ${INCLUDES} $(LOCAL_CFLAGS) $(CFLAGS) |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 57 | |
| 58 | .c.o: |
| 59 | $(CC) -c $(CCFLAGS) $< |
| 60 | |
| 61 | # The name of the library target. |
| 62 | LIBRARY_NAME = libtilde.a |
| 63 | |
| 64 | # The C code source files for this library. |
| 65 | CSOURCES = $(srcdir)/tilde.c |
| 66 | |
| 67 | # The header files for this library. |
| 68 | HSOURCES = $(srcdir)/tilde.h |
| 69 | |
| 70 | OBJECTS = tilde.o |
| 71 | |
| 72 | # The texinfo files which document this library. |
| 73 | DOCSOURCE = doc/tilde.texi |
| 74 | DOCOBJECT = doc/tilde.dvi |
| 75 | DOCSUPPORT = doc/Makefile |
| 76 | DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT) |
| 77 | |
| 78 | SUPPORT = Makefile ChangeLog $(DOCSUPPORT) |
| 79 | |
| 80 | SOURCES = $(CSOURCES) $(HSOURCES) $(DOCSOURCE) |
| 81 | |
| 82 | THINGS_TO_TAR = $(SOURCES) $(SUPPORT) |
| 83 | |
| 84 | ###################################################################### |
| 85 | |
| 86 | all: $(LIBRARY_NAME) |
| 87 | |
| 88 | $(LIBRARY_NAME): $(OBJECTS) |
| 89 | $(RM) -f $@ |
Jari Aalto | b72432f | 1999-02-19 17:11:39 +0000 | [diff] [blame] | 90 | $(AR) $(ARFLAGS) $@ $(OBJECTS) |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 91 | -test -n "$(RANLIB)" && $(RANLIB) $@ |
| 92 | |
| 93 | documentation: force |
| 94 | -(cd doc; $(MAKE) $(MFLAGS)) |
| 95 | |
| 96 | force: |
| 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. |
| 101 | install: |
Jari Aalto | f73dda0 | 2001-11-13 17:56:06 +0000 | [diff] [blame] | 102 | $(INSTALL_DATA) -c -m 644 $(LIBRARY_NAME) $(libdir)/$(LIBRARY_NAME) |
| 103 | -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/$(LIBRARY_NAME) |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 104 | |
| 105 | clean: |
| 106 | $(RM) -f $(OBJECTS) $(LIBRARY_NAME) |
| 107 | -( cd doc && $(MAKE) $(MFLAGS) $@ ) |
| 108 | |
| 109 | realclean distclean maintainer-clean: clean |
| 110 | -( cd doc && $(MAKE) $(MFLAGS) $@ ) |
| 111 | $(RM) -f Makefile |
| 112 | |
| 113 | mostlyclean: clean |
| 114 | -( cd doc && $(MAKE) $(MFLAGS) $@ ) |
| 115 | |
| 116 | ###################################################################### |
| 117 | # # |
| 118 | # Dependencies for the object files which make up this library. # |
| 119 | # # |
| 120 | ###################################################################### |
| 121 | |
Jari Aalto | bb70624 | 2000-03-17 21:46:59 +0000 | [diff] [blame] | 122 | tilde.o: tilde.h $(BASHINCDIR)/ansi_stdlib.h |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 123 | tilde.o: $(BUILD_DIR)/config.h |
Jari Aalto | e8ce775 | 1997-09-22 20:22:27 +0000 | [diff] [blame] | 124 | |
| 125 | # Rules for deficient makes, like SunOS and Solaris |
| 126 | tilde.o: tilde.c |