Debian Codegraph @

Makefile.in

raw ◀ ▶
1 Debian patch touch this file
1 # Top Makefle for Gauche
2 # Run 'configure' script to generate Makefile
3
4 .PHONY: all test check pre-package install uninstall \
5 clean distclean maintainer-clean install-check \
6 rpmfiles
7
8 @SET_MAKE@
9 SHELL = @SHELL@
10 prefix = @prefix@
11 exec_prefix = @exec_prefix@
12 bindir = @bindir@
13 libdir = @libdir@
14 srcdir = @srcdir@
15 datadir = @datadir@
16 datarootdir = @datarootdir@
17 top_srcdir = @top_srcdir@
18
19 SUBDIRS = gc src lib ext doc examples tools
20 SRIDBUS = tools examples doc ext lib src gc
21 LIBATOMICDIR = gc/libatomic_ops
22 MKINSTDIR = $(top_srcdir)/mkinstalldirs
23 INSTALL = @INSTALL@
24 INSTALL_DATA = @INSTALL_DATA@
25 GAUCHE_VERSION = @GAUCHE_VERSION@
26 GAUCHE_DATA_DIR = $(datadir)/gauche-@GAUCHE_ABI_VERSION@
27 GAUCHE_ARCH_DIR = $(libdir)/gauche-@GAUCHE_ABI_VERSION@
28 GAUCHE_ACLOCAL_DIR = $(GAUCHE_DATA_DIR)/$(GAUCHE_VERSION)/
29 BUILD_GOSH = @BUILD_GOSH@
30 BUILD_GOSH_VERSION = @BUILD_GOSH_VERSION@
31 BUILD_GOSH_FLAGS =
32 DESTDIR =
33
34 GOSH = gosh
35 LN_S = @LN_S@
36
37 PRE_PACKAGE_GENERATED = INSTALL.en.adoc INSTALL.ja.adoc pre-package.stamp
38 CONFIG_GENERATED = Makefile config.cache config.log config.status \
39 libtool configure.lineno autom4* gc/autom4* \
40 gc/configure.gnu-gauche Gauche.spec
41 AUTOCONF_GENERATED = $(CONFIG_GENERATED) configure
42
43 TESTRECORD = ./test.record
44
45 all: pre-package.stamp
46 if [ $(srcdir) != "." ]; then $(srcdir)/wirebuildlibs "$(srcdir)" "$(LN_S)"; fi
47 for d in $(SUBDIRS); do (cd $$d; $(MAKE) all) || exit 1; done
48 cd src; $(MAKE) -s static
49 @@CYGWIN_FIXDLL@
50
51 test : check
52
53 check: all
54 @rm -f $(TESTRECORD)
•55 set -e; for d in $(SUBDIRS); do (cd $$d; $(MAKE) check) || exit 1; done
56 @cd src; $(MAKE) test2
57 @cat $(TESTRECORD)
•58 @grep -q '\b0 failed' test.record
59 @cd src; $(MAKE) test-summary-check
60
61 install-check:
62 @echo "Testing installed Gauche"
63 @rm -f test.log $(TESTRECORD)
64 @(cd src; $(MAKE) install-check) >> test.log
65 @(cd ext; $(MAKE) install-check) >> test.log
66 @cat $(TESTRECORD)
67 @cd src; $(MAKE) test-summary-check
68
69 # pre-package target should be run before creating distribution tarball.
70 # it generates files that requires pre-installed gosh.
71 pre-package: $(PRE_PACKAGE_GENERATED)
72 cd src; $(MAKE) GOSH=$(GOSH) BUILD_GOSH_FLAGS=$(BUILD_GOSH_FLAGS) pre-package
73 cd ext; $(MAKE) GOSH=$(GOSH) BUILD_GOSH_FLAGS=$(BUILD_GOSH_FLAGS) pre-package
74 cd doc; $(MAKE) GOSH=$(GOSH) BUILD_GOSH_FLAGS=$(BUILD_GOSH_FLAGS) pre-package
75
76 # Check if the host's Gauche is recent enough to generate files for this version.
77 pre-package.stamp:
78 "$(BUILD_GOSH)" "$(srcdir)/tools/check-build-version" ${BUILD_GOSH_VERSION} && touch pre-package.stamp
79
80 INSTALL.en.adoc: INSTALL.adoc
81 sed -e '/^ifdef::JA/,/^endif::JA/d ; /^ifdef::EN/d ; /^endif::EN/d ; /^\/\/@start header/,/^\/\/@end header/d' $< > $@
82
83 INSTALL.ja.adoc: INSTALL.adoc
84 sed -e '/^ifdef::EN/,/^endif::EN/d ; /^ifdef::JA/d ; /^endif::JA/d ; /^\/\/@start header/,/^\/\/@end header/d' $< > $@
85
86 install: install-doc install-pkg
87
88 install-doc:
89 cd doc; $(MAKE) install
90
91 # it is important to install lib and ext _before_ src, since they
92 # depend on gosh's rpath to point a valid version of libgauche.so.
93 install-pkg:
94 cd lib; $(MAKE) install
95 cd ext; $(MAKE) install
96 cd src; $(MAKE) install
97 $(INSTALL_DATA) "$(srcdir)/m4/gauche.m4" "$(DESTDIR)$(GAUCHE_ACLOCAL_DIR)/aclocal.m4"
98 $(MKINSTDIR) "$(DESTDIR)$(datadir)/aclocal"
99 $(INSTALL_DATA) "$(srcdir)/m4/gauche.m4" "$(DESTDIR)$(datadir)/aclocal/gauche.m4"
100
101 # for the backward compatibility;
102 # now slibcat is created in the build tree by default.
103 slibcat-in-place:
104 cd lib; $(MAKE) slibcat-in-place
105
106 uninstall:
107 cd src; $(MAKE) uninstall
108 cd ext; $(MAKE) uninstall
109 cd lib; $(MAKE) uninstall
110 cd doc; $(MAKE) uninstall
111 rm -f $(GAUCHE_ACLOCAL_DIR)/aclocal.m4
112 rm -f $(datadir)/aclocal/gauche.m4
113
114 # Install selected examples. We don't usually install examples. For Windows
115 # we distribute binary, so it's useful to include some examples in it.
116 install-examples:
117 $(INSTALL) -d "$(DESTDIR)${prefix}/examples"
118 $(INSTALL) -d "$(DESTDIR)${prefix}/examples/windows"
119 $(INSTALL_DATA) examples/windows/*.scm "$(DESTDIR)${prefix}/examples/windows"
120
121 # Cleaning ---------------------------------------------
122 # NB: we don't run maintainer-clean in $(LIBATOMICDIR) to avoid
123 # dealing with automake.
124 clean:
125 rm -rf test.log test.record core Gauche.framework rpmfiles-*.txt *~
126 -for d in $(SRIDBUS); do (cd $$d; $(MAKE) clean); done
127 -if test -f $(LIBATOMICDIR)/Makefile; then (cd $(LIBATOMICDIR); $(MAKE) clean); fi
128
129 distclean: clean
130 -for d in $(SRIDBUS); do (cd $$d; $(MAKE) distclean); done
131 -if test -f $(LIBATOMICDIR)/Makefile; then (cd $(LIBATOMICDIR); $(MAKE) distclean); fi
132 -(cd winnt/wix; $(MAKE) clean)
133 rm -rf $(CONFIG_GENERATED)
134
135 maintainer-clean: clean
136 -for d in $(SRIDBUS); do (cd $$d; $(MAKE) maintainer-clean); done
137 -if test -f $(LIBATOMICDIR)/Makefile; then \
138 (cd $(LIBATOMICDIR); $(MAKE) distclean; rm -f configure);\
139 fi
140 -(cd winnt/wix; $(MAKE) clean)
141 rm -rf $(AUTOCONF_GENERATED) VERSION DIST_EXCLUDE_X \
142 gc/configure gc/configure.gnu \
143 $(PRE_PACKAGE_GENERATED)
144
145 # MacOSX Framework specific stuff
146 framework: all
147 ./framework.sh $(GAUCHE_VERSION)
148
149 # Other dummy targets -------------------------------------------
150
151 dist:
152 @echo "To create a distribution tarball, use DIST script."
153
154 distcheck:
155 @echo "To create a distribution tarball, use DIST script."
156
157 # This must be called after the current version of Gauche is installed
158 rpmfiles:
159 find $(GAUCHE_DATA_DIR)/$(VERSION) -type f -print | grep -v 'dbm/[ong]dbm' > rpmfiles-common.txt
160 find $(GAUCHE_DATA_DIR)/$(VERSION) -type f -print | grep 'dbm/[ong]dbm' > rpmfiles-gdbm.txt
161 find $(GAUCHE_ARCH_DIR)/$(VERSION) -type f -print | grep -v '/dbm--[ong]dbm' > rpmfiles-encoding.txt
162 find $(GAUCHE_ARCH_DIR)/$(VERSION) -type f -print | grep '/dbm--[ong]dbm' >> rpmfiles-gdbm.txt