-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.in
More file actions
181 lines (141 loc) · 6.25 KB
/
Makefile.in
File metadata and controls
181 lines (141 loc) · 6.25 KB
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
# Copyright 2011 Sergey Kolotsey.
#
# This file is part of libexpression library.
#
# libexpression is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# libexpression is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public Licenise
# along with libexpression. If not, see <http://www.gnu.org/licenses/>.
# Project name and name of the output library
PACKAGE_NAME=@PACKAGE_NAME@
PACKAGE_TARNAME=@PACKAGE_TARNAME@
# Prefixes and install dirs
VPATH=@srcdir@
prefix=$(DESTDIR)@prefix@
exec_prefix=@exec_prefix@
top_srcdir=@top_srcdir@
top_builddir=@top_builddir@
srcdir=@srcdir@
bindir=@bindir@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
mandir=@mandir@
docdir=@docdir@
doc_relative_path=html
# System and compilers
SHELL=@SHELL@
CC=@CC@
LIBTOOL=@LIBTOOL@
install_sh=@install_sh@
INSTALL=@INSTALL@
INSTALL_DATA=@INSTALL_DATA@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
INSTALL_STRIP_PROGRAM=@INSTALL_STRIP_PROGRAM@
MKDIR_P=@MKDIR_P@
# Includes and flags
CPPFLAGS=-I$(srcdir) -I$(top_builddir) @CPPFLAGS@
CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@ @MATHLIBS@
PACKAGE_VERSION:="@PACKAGE_VERSION@"
PACKAGE_VERSION:=$(shell echo "$(PACKAGE_VERSION)" |sed "s/\./:/g")
PACKAGE_VERSION_FLAGS=-version-info "$(PACKAGE_VERSION)"
COMPILE=$(CC) $(CFLAGS) $(CPPFLAGS)
LTCOMPILE=$(LIBTOOL) --silent --mode=compile $(COMPILE)
LINK_LIB=$(LIBTOOL) --silent --mode=link $(CC) -no-undefined $(PACKAGE_VERSION_FLAGS) -rpath $(libdir) $(LDFLAGS) -o $@
LINK_EXE=$(LIBTOOL) --silent --mode=link $(CC) $(LDFLAGS) -l$(LIB_BASENAME) -o $@
# Sources and objects
API_HEADERS=libexpression.h
LIB_HEADERS=libexpression.h libexpression-private.h libexpression-config.h
LIB_SOURCES=eval.c functions.c libexpression.c rpn.c shunting-yard.c tokenizer.c
LIB_OBJECTS=$(patsubst %.c,%.lo,$(LIB_SOURCES))
LIB_BASENAME=$(shell ret="$(PACKAGE_NAME)" && echo $${ret\#*lib})
EXAMPLE_HEADERS=libexpression.h
EXAMPLE_SOURCES=expression.c
EXAMPLE_OBJECTS=$(patsubst %.c,%.o,$(EXAMPLE_SOURCES))
# Targets
LIBRARY=lib$(LIB_BASENAME).la
EXAMPLE=expression
all: $(LIBRARY) $(EXAMPLE)
install: install-lib-ldconfig install-bin install-data install-doc
install-lib-ldconfig: install-lib
@if which ldconfig >/dev/null 2>/dev/null && ldconfig -p 2>/dev/null |grep $(libdir)/lib$(LIB_BASENAME) >/dev/null 2>/dev/null; then : ; \
elif which id >/dev/null 2>/dev/null && test `id -u` -eq 0 && ldconfig; then : ; \
else echo "======================================================================" >&2; \
echo "You probably need to ask you system administrator to run \`ldconfig'" >&2; \
echo "to add installed libraries to cache. Otherwise you can add $(libdir) " >&2; \
echo "to the \`LD_LIBRARY_PATH' environment variable" >&2; \
echo "======================================================================" >&2; \
fi
install-lib: $(LIBRARY)
$(MKDIR_P) $(libdir)
$(LIBTOOL) --mode=install --silent $(INSTALL) $(LIBRARY) $(libdir)/$(LIBRARY)
install-bin: $(EXAMPLE)
$(MKDIR_P) $(bindir)
$(LIBTOOL) --mode=install --silent $(INSTALL_PROGRAM) $(EXAMPLE) $(bindir)/$(EXAMPLE)
install-data:
$(MKDIR_P) $(includedir)
$(INSTALL_DATA) $(top_srcdir)/libexpression.h $(includedir)/libexpression.h
install-doc:
$(MKDIR_P) $(mandir)/man1
$(INSTALL_DATA) $(top_srcdir)/expression.1 $(mandir)/man1/expression.1
@if [ -d $(top_srcdir)/$(doc_relative_path) ]; then \
echo "Installing documentation into \`$(docdir)'" >&2; \
pwd=`pwd`; \
cd "$(top_srcdir)/$(doc_relative_path)" \
&& $(MKDIR_P) $(docdir)/$(doc_relative_path) \
&& find . -type d |sed "s/^\\.\\/\{0,1\}//" |while read dir; do if [ "X$$dir" != "X" ]; then $(MKDIR_P) "$(docdir)/$(doc_relative_path)/$$dir"; fi; done \
&& find . -type f |sed "s/^\\.\\/\{0,1\}//" |while read file; do if [ "X$$file" != "X" ]; then $(INSTALL_DATA) "$$file" "$(docdir)/$(doc_relative_path)/$$file"; fi; done \
&& cd "$$pwd"; \
fi
uninstall: uninstall-doc uninstall-data uninstall-bin uninstall-lib-ldconfig
uninstall-lib:
$(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(LIBRARY)
uninstall-lib-ldconfig: uninstall-lib
@if which ldconfig >/dev/null 2>/dev/null && ldconfig -p 2>/dev/null |grep $(libdir)/lib$(LIB_BASENAME) >/dev/null 2>/dev/null; then \
if which id >/dev/null 2>/dev/null && test `id -u` -eq 0 && ldconfig; then : ; \
else echo "======================================================================" >&2; \
echo "You probably need to ask you system administrator to run \`ldconfig'" >&2; \
echo "to remove uninstalled libraries from cache." >&2; \
echo "======================================================================" >&2; \
fi; \
fi
uninstall-bin:
$(LIBTOOL) --mode=uninstall rm -f $(bindir)/$(EXAMPLE)
uninstall-data:
rm -f $(includedir)/libexpression.h
uninstall-doc:
rm -f $(mandir)/man1/expression.1
@if [ -d $(top_srcdir)/$(doc_relative_path) ]; then \
echo "Uninstalling documentation from $(docdir)" >&2; \
pwd=`pwd`; \
cd "$(top_srcdir)/$(doc_relative_path)" \
&& find . -type f |sed "s/^\\.\\/\{0,1\}//" |while read file; do if [ "X$$file" != "X" ]; then rm -f "$(docdir)/$(doc_relative_path)/$$file"; fi; done \
&& cd "$$pwd"; \
fi
clean:
$(LIBTOOL) --mode=clean rm -f $(LIB_OBJECTS) $(LIBRARY) $(EXAMPLE_OBJECTS) $(EXAMPLE)
rm -rf .libs
distclean: clean
rm -f libexpression-config.h config.status config.cache config.log libtool Makefile
extraclean: distclean
cd $(top_srcdir) && rm -rf autom4te.cache tools && rm -f configure configure.scan autoscan.log aclocal.m4 libexpression-config.h.in libexpression-config.h.in~
$(LIBRARY): $(LIB_OBJECTS)
$(LINK_LIB) $^
$(EXAMPLE): $(EXAMPLE_OBJECTS)
$(LINK_EXE) $^
%.lo: %.c $(LIB_HEADERS) Makefile
$(LTCOMPILE) -o $@ -c $<
%.o: %.c Makefile
$(COMPILE) -o $@ -c $<
.PHONY: all install install-lib-ldconfig install-lib install-bin install-data install-doc \
uninstall uninstall-lib-ldconfig uninstall-lib uninstall-bin uninstall-data uninstall-doc \
clean distclean extraclean