-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile-bin.in
152 lines (135 loc) · 4.3 KB
/
Makefile-bin.in
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
# Makefile for the binary distribution of the Curry compiler -*- makefile -*-
#
# $Id: Makefile-bin.in 3142 2013-11-24 18:53:41Z wlux $
#
# Copyright (c) 2002-2013, Wolfgang Lux
#
# package information
PACKAGE = @PACKAGE_TARNAME@
VERSION = @PACKAGE_VERSION@
# source directory
srcdir = @srcdir@
VPATH = @srcdir@
# install directories
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
bindir = @bindir@
libdir = @libdir@
mandir = @mandir@
# compiler definitions
CC = @CC@
RANLIB = @RANLIB@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_DIR = @INSTALL_DIR@
LN_S = @LN_S@
# file lists
bin_SCRIPTS = bin/cyc bin/cymake bin/cyi
lib_PROGS = lib/cycc lib/cymk lib/newer
lib_SRCS = lib/*.curry
lib_INTF = $(lib_SRCS:.curry=.icurry)
lib_HDRS = lib/*.h
lib_LIBS = $(lib_%LIBKIND%_LIBS)
lib_static_LIBS = lib/*.a
lib_shared_LIBS = $(lib_static_LIBS) lib/*.so.[0-9]*
lib_dylib_LIBS = lib/*.dylib
man1_MANS = man/cyc.1 man/cymake.1 man/cyi.1
# default target, show usage and configuration
all:
@echo 'Use "$(MAKE) install" to install the distribution'
@echo 'Use "$(MAKE) uninstall" to uninstall the distribution'
@echo
@echo Compilation
@echo 'C compiler: $(CC)'
@echo
@echo Installation directories
@echo 'Binaries: $(bindir)'
@echo 'Libraries: $(libdir)/curry-$(VERSION)'
@echo 'Man Pages: $(mandir)/man1'
# install the distribution
begin_config = ^\# DO NOT DELETE: Beginning of in-place configuration$$
end_config = ^\# DO NOT DELETE: End of in-place configuration$$
install_edit = sed \
-e '/$(begin_config)/,/$(end_config)/d' \
-e "s/%BUILD_DATE%/`date`/"
install: $(man1_MANS)
$(INSTALL_DIR) $(bindir)
$(INSTALL_DIR) $(libdir)
$(INSTALL_DIR) $(libdir)/curry-$(VERSION)
$(INSTALL_DIR) $(mandir)
$(INSTALL_DIR) $(mandir)/man1
for f in $(bin_SCRIPTS); do \
cmd=`basename $$f`; \
$(install_edit) $$f > /tmp/$$cmd && \
$(INSTALL_PROGRAM) /tmp/$$cmd $(bindir)/$$cmd-$(VERSION) && \
( cd $(bindir) && rm -f $$cmd && $(LN_S) $$cmd-$(VERSION) $$cmd ); \
rc=$$?; \
rm -f /tmp/$$cmd; \
test $$rc = 0 || exit $$rc; \
done
for f in $(lib_PROGS); do \
$(INSTALL_PROGRAM) $$f $(libdir)/curry-$(VERSION) || exit $$?; \
done
for f in $(lib_SRCS) $(lib_INTF) $(lib_HDRS) $(lib_LIBS); do \
$(INSTALL_DATA) $$f $(libdir)/curry-$(VERSION) || exit $$?; \
done
$(postinstall_%LIBKIND%_cmds)
for f in $(man1_MANS); do \
man=`basename $$f .1`; \
$(INSTALL_DATA) $$f $(mandir)/man1/$$man-$(VERSION).1 && \
echo ".so man1/$$man-$(VERSION).1" > $(mandir)/man1/$$man.1 || \
exit $$?; \
done
postinstall_static_cmds = \
for a in $(libdir)/curry-$(VERSION)/*.a; do $(RANLIB) $$a; done
postinstall_shared_cmds = \
$(postinstall_static_cmds); \
for f in $(libdir)/curry-$(VERSION)/*.so.$(VERSION); do \
rm -f `echo $$f | sed 's/\.$(VERSION)$$//'`; \
ln -s `echo $$f | sed 's:.*/::'` `echo $$f | sed 's/\.$(VERSION)$$//'`; \
done
postinstall_dylib_cmds = \
for f in $(libdir)/curry-$(VERSION)/*.$(VERSION).dylib; do \
install_name_tool -id $(libdir)/curry-$(VERSION)/`basename $$f` \
-change "`pwd`"/lib/libcurry.$(VERSION).dylib $(libdir)/curry-$(VERSION)/libcurry.$(VERSION).dylib \
$$f; \
rm -f `echo $$f | sed 's/\.$(VERSION)\././'`; \
ln -s `echo $$f | sed 's:.*/::'` `echo $$f | sed 's/\.$(VERSION)\././'`; \
done
# uninstall the distribution
uninstall:
cd $(bindir) && for f in $(bin_SCRIPTS); do \
cmd=`basename $$f`; \
cmp -s $$cmd $$cmd-$(VERSION) && rm -f $$cmd; \
rm -f $$cmd-$(VERSION); \
done
rm -rf $(libdir)/curry-$(VERSION)
for f in $(man1_MANS); do \
man=`basename $$f .1`; \
echo ".so man1/$$man-$(VERSION).1" | \
cmp -s - $(mandir)/man1/$$man.1 && \
rm -f $(mandir)/man1/$$man.1; \
rm -f $(mandir)/man1/$$man-$(VERSION).1; \
done
# automatic reconfiguration
configure: configure.in aclocal.m4
cd $(srcdir) && autoconf
Makefile: Makefile.in config.status
./config.status
config.status: configure
./config.status --recheck
man_edit = sed \
-e 's,@bindir\@,$(bindir),g' \
-e 's,@libdir\@,$(libdir),g' \
-e 's,@version\@,$(VERSION),g'
man/cyc.1: Makefile man/cyc.1.in
rm -f man/cyc.1
$(man_edit) man/cyc.1.in >man/cyc.1
man/cymake.1: Makefile man/cymake.1.in
rm -f man/cymake.1
$(man_edit) man/cymake.1.in >man/cymake.1
man/cyi.1: Makefile man/cyi.1.in
rm -f man/cyi.1
$(man_edit) man/cyi.1.in >man/cyi.1