Skip to content

Commit

Permalink
Add ./configure, doc/configure-and-make.org
Browse files Browse the repository at this point in the history
  * ./configure && make && make install
  • Loading branch information
drewc authored and fare committed May 25, 2021
1 parent e06f58e commit b986749
Show file tree
Hide file tree
Showing 5 changed files with 3,624 additions and 0 deletions.
105 changes: 105 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Makefile Template for Gerbil
# Tangled using Org Mode (C-c C-v t) from doc/configure.org
# $ tangle() {
# emacs --batch -l org --eval "(org-babel-tangle-file \"$1\")"
# }
# $ tangle doc/configure.org

# Copyright (c) 2019 by drewc <[email protected]>, All Rights Reserved.

# The Makefile is generated by running ./configure

PACKAGE_SHORTNAME = @PACKAGE_SHORTNAME@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_TARNAME = @PACKAGE_TARNAME@

prefix = @prefix@
exec_prefix = @exec_prefix@
includedir = @includedir@
libdir = @libdir@
bindir = @bindir@
docdir = @docdir@
infodir = @infodir@
emacsdir = @emacsdir@
libexecdir = @libexecdir@
datarootdir = @datarootdir@
datadir = @datadir@
htmldir = @htmldir@
dvidir = @dvidir@
pdfdir = @pdfdir@
psdir = @psdir@
localedir = @localedir@
mandir = @mandir@

LIBS = @LIBS@

gerbil_home = "${DESTDIR}/${prefix}/lib/${PACKAGE_SHORTNAME}"
gerbil_bin = "${gerbil_home}/bin"
gerbil_lib = "${gerbil_home}/lib"
gerbil_bin_linkdir = "${DESTDIR}/${prefix}/bin"


gerbil: ensure-gx-version
cd src && LDFLAGS="$(LIBS)" ./build.sh

ensure-gx-version:
echo "(define (gerbil-version-string) \"$(PACKAGE_STRING)\")" \
> ./src/gerbil/runtime/gx-version.scm ;

stdlib:
cd src && LDFLAGS="$(LIBS)" ./build.sh stdlib

lang:
cd src && LDFLAGS="$(LIBS)" ./build.sh lang


r7rs-large:
cd src && LDFLAGS="$(LIBS)" ./build.sh r7rs-large

tools:
cd src && LDFLAGS="$(LIBS)" ./build.sh tools

stage0:
cd src && LDFLAGS="$(LIBS)" ./build.sh stage0

stage1:
cd src && LDFLAGS="$(LIBS)" ./build.sh stage1

layout:
cd src && LDFLAGS="$(LIBS)" ./build.sh layout

tags:
cd src && LDFLAGS="$(LIBS)" ./build.sh tags

install:
# Symlinks
mkdir -p ${gerbil_bin} ;
mkdir -p ${gerbil_lib} ;
cp -a bin/* ${gerbil_bin} ;
cp -a lib/* ${gerbil_lib} ;
@for i in `find ${gerbil_bin} -type f` ; do \
_name=`basename $$i`;\
_link="${gerbil_bin_linkdir}/$$_name" ; \
mkdir -p "${gerbil_bin_linkdir}"; \
if test -f $$_link ; then rm "$$_link" ; fi ;\
echo "Linking $$_link to $$i"; \
ln -sr $$i "$$_link" ; \
done ;


uninstall:
# Symlinks
@for i in `find ${gerbil_bin} -type f` ; do \
_name=`basename $$i`;\
_link="${gerbil_bin_linkdir}/$$_name" ; \
if test -L $$_link && test $$(dirname `readlink $$_link`) = ${gerbil_bin}; then \
echo removing "$$_link" ; rm "$$_link" ; elif test -f "$$_link" ; then echo $$_link is not a link to $$i. Not removing. ; fi ; \
done ;

rm -rf ${gerbil_home};

test:
echo $(LIBS) ;
Loading

0 comments on commit b986749

Please sign in to comment.