| 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); done |
| 56 |
@cd src; $(MAKE) test2 |
| 57 |
@cat $(TESTRECORD) |
| 58 |
@cd src; $(MAKE) test-summary-check |
| 59 |
|
| 60 |
install-check: |
| 61 |
@echo "Testing installed Gauche" |
| 62 |
@rm -f test.log $(TESTRECORD) |
| 63 |
@(cd src; $(MAKE) install-check) >> test.log |
| 64 |
@(cd ext; $(MAKE) install-check) >> test.log |
| 65 |
@cat $(TESTRECORD) |
| 66 |
@cd src; $(MAKE) test-summary-check |
| 67 |
|
| 68 |
# pre-package target should be run before creating distribution tarball. |
| 69 |
# it generates files that requires pre-installed gosh. |
| 70 |
pre-package: $(PRE_PACKAGE_GENERATED) |
| 71 |
cd src; $(MAKE) GOSH=$(GOSH) BUILD_GOSH_FLAGS=$(BUILD_GOSH_FLAGS) pre-package |
| 72 |
cd ext; $(MAKE) GOSH=$(GOSH) BUILD_GOSH_FLAGS=$(BUILD_GOSH_FLAGS) pre-package |
| 73 |
cd doc; $(MAKE) GOSH=$(GOSH) BUILD_GOSH_FLAGS=$(BUILD_GOSH_FLAGS) pre-package |
| 74 |
|
| 75 |
# Check if the host's Gauche is recent enough to generate files for this version. |
| 76 |
pre-package.stamp: |
| 77 |
"$(BUILD_GOSH)" "$(srcdir)/tools/check-build-version" ${BUILD_GOSH_VERSION} && touch pre-package.stamp |
| 78 |
|
| 79 |
INSTALL.en.adoc: INSTALL.adoc |
| 80 |
sed -e '/^ifdef::JA/,/^endif::JA/d ; /^ifdef::EN/d ; /^endif::EN/d ; /^\/\/@start header/,/^\/\/@end header/d' $< > $@ |
| 81 |
|
| 82 |
INSTALL.ja.adoc: INSTALL.adoc |
| 83 |
sed -e '/^ifdef::EN/,/^endif::EN/d ; /^ifdef::JA/d ; /^endif::JA/d ; /^\/\/@start header/,/^\/\/@end header/d' $< > $@ |
| 84 |
|
| 85 |
install: install-doc install-pkg |
| 86 |
|
| 87 |
install-doc: |
| 88 |
cd doc; $(MAKE) install |
| 89 |
|
| 90 |
# it is important to install lib and ext _before_ src, since they |
| 91 |
# depend on gosh's rpath to point a valid version of libgauche.so. |
| 92 |
install-pkg: |
| 93 |
cd lib; $(MAKE) install |
| 94 |
cd ext; $(MAKE) install |
| 95 |
cd src; $(MAKE) install |
| 96 |
$(INSTALL_DATA) "$(srcdir)/m4/gauche.m4" "$(DESTDIR)$(GAUCHE_ACLOCAL_DIR)/aclocal.m4" |
| 97 |
$(MKINSTDIR) "$(DESTDIR)$(datadir)/aclocal" |
| 98 |
$(INSTALL_DATA) "$(srcdir)/m4/gauche.m4" "$(DESTDIR)$(datadir)/aclocal/gauche.m4" |
| 99 |
|
| 100 |
# for the backward compatibility; |
| 101 |
# now slibcat is created in the build tree by default. |
| 102 |
slibcat-in-place: |
| 103 |
cd lib; $(MAKE) slibcat-in-place |
| 104 |
|
| 105 |
uninstall: |
| 106 |
cd src; $(MAKE) uninstall |
| 107 |
cd ext; $(MAKE) uninstall |
| 108 |
cd lib; $(MAKE) uninstall |
| 109 |
cd doc; $(MAKE) uninstall |
| 110 |
rm -f $(GAUCHE_ACLOCAL_DIR)/aclocal.m4 |
| 111 |
rm -f $(datadir)/aclocal/gauche.m4 |
| 112 |
|
| 113 |
# Install selected examples. We don't usually install examples. For Windows |
| 114 |
# we distribute binary, so it's useful to include some examples in it. |
| 115 |
install-examples: |
| 116 |
$(INSTALL) -d "$(DESTDIR)${prefix}/examples" |
| 117 |
$(INSTALL) -d "$(DESTDIR)${prefix}/examples/windows" |
| 118 |
$(INSTALL_DATA) examples/windows/*.scm "$(DESTDIR)${prefix}/examples/windows" |
| 119 |
|
| 120 |
# Cleaning --------------------------------------------- |
| 121 |
# NB: we don't run maintainer-clean in $(LIBATOMICDIR) to avoid |
| 122 |
# dealing with automake. |
| 123 |
clean: |
| 124 |
rm -rf test.log test.record core Gauche.framework rpmfiles-*.txt *~ |
| 125 |
-for d in $(SRIDBUS); do (cd $$d; $(MAKE) clean); done |
| 126 |
-if test -f $(LIBATOMICDIR)/Makefile; then (cd $(LIBATOMICDIR); $(MAKE) clean); fi |
| 127 |
|
| 128 |
distclean: clean |
| 129 |
-for d in $(SRIDBUS); do (cd $$d; $(MAKE) distclean); done |
| 130 |
-if test -f $(LIBATOMICDIR)/Makefile; then (cd $(LIBATOMICDIR); $(MAKE) distclean); fi |
| 131 |
-(cd winnt/wix; $(MAKE) clean) |
| 132 |
rm -rf $(CONFIG_GENERATED) |
| 133 |
|
| 134 |
maintainer-clean: clean |
| 135 |
-for d in $(SRIDBUS); do (cd $$d; $(MAKE) maintainer-clean); done |
| 136 |
-if test -f $(LIBATOMICDIR)/Makefile; then \ |
| 137 |
(cd $(LIBATOMICDIR); $(MAKE) distclean; rm -f configure);\ |
| 138 |
fi |
| 139 |
-(cd winnt/wix; $(MAKE) clean) |
| 140 |
rm -rf $(AUTOCONF_GENERATED) VERSION DIST_EXCLUDE_X \ |
| 141 |
gc/configure gc/configure.gnu \ |
| 142 |
$(PRE_PACKAGE_GENERATED) |
| 143 |
|
| 144 |
# MacOSX Framework specific stuff |
| 145 |
framework: all |
| 146 |
./framework.sh $(GAUCHE_VERSION) |
| 147 |
|
| 148 |
# Other dummy targets ------------------------------------------- |
| 149 |
|
| 150 |
dist: |
| 151 |
@echo "To create a distribution tarball, use DIST script." |
| 152 |
|
| 153 |
distcheck: |
| 154 |
@echo "To create a distribution tarball, use DIST script." |
| 155 |
|
| 156 |
# This must be called after the current version of Gauche is installed |
| 157 |
rpmfiles: |
| 158 |
find $(GAUCHE_DATA_DIR)/$(VERSION) -type f -print | grep -v 'dbm/[ong]dbm' > rpmfiles-common.txt |
| 159 |
find $(GAUCHE_DATA_DIR)/$(VERSION) -type f -print | grep 'dbm/[ong]dbm' > rpmfiles-gdbm.txt |
| 160 |
find $(GAUCHE_ARCH_DIR)/$(VERSION) -type f -print | grep -v '/dbm--[ong]dbm' > rpmfiles-encoding.txt |
| 161 |
find $(GAUCHE_ARCH_DIR)/$(VERSION) -type f -print | grep '/dbm--[ong]dbm' >> rpmfiles-gdbm.txt |