Big cleanup. Should be ready to distribute now.

This commit is contained in:
mainzelm 2001-01-11 13:43:22 +00:00
parent c5cfe8c420
commit 3e2a109780
1 changed files with 49 additions and 109 deletions

View File

@ -1,4 +1,4 @@
# Scheme 48 Makefile # Scsh Makefile
# Documentation in files INSTALL and doc/install.txt # Documentation in files INSTALL and doc/install.txt
SHELL = /bin/sh SHELL = /bin/sh
@ -43,7 +43,6 @@ mandir = $(prefix)/man/man$(manext)
.c.o: .c.o:
$(CC) -g -c $(CPPFLAGS) $(DEFS) -I$(srcdir)/c -I$(srcdir)/cig $(CFLAGS) -o $@ $< $(CC) -g -c $(CPPFLAGS) $(DEFS) -I$(srcdir)/c -I$(srcdir)/cig $(CFLAGS) -o $@ $<
# You might want to change RUNNABLE to "s48"
RUNNABLE = scsh RUNNABLE = scsh
MANPAGE = $(RUNNABLE).$(manext) MANPAGE = $(RUNNABLE).$(manext)
LIB = $(libdir)/$(RUNNABLE) LIB = $(libdir)/$(RUNNABLE)
@ -73,18 +72,18 @@ include $(srcdir)/build/filenames.make
# LINKER_RUNNABLE = $(RUNNABLE) # LINKER_RUNNABLE = $(RUNNABLE)
# These settings requires you to already have a $(RUNNABLE) # These settings requires you to already have a $(RUNNABLE)
# command. This is desirable if you are making changes to the # command. This is desirable if you are making changes to the
# system that might break scheme48vm and/or scheme48.image. But it # system that might break scshvm and/or scsh/scsh.image. But it
# requires you to have squirreled away a previous working version # requires you to have squirreled away a previous working version
# of scheme48. # of scsh.
BIG_HEAP = -h 5000000 BIG_HEAP = -h 5000000
# JMG: 1. is broken ... # 1. is broken if you build from CVS
# LINKER_VM = ./$(VM) $(BIG_HEAP) # LINKER_VM = ./$(VM) $(BIG_HEAP)
# LINKER_RUNNABLE = $(LINKER_VM) -i $(IMAGE) # LINKER_RUNNABLE = $(LINKER_VM) -i $(IMAGE)
# JMG now according 2 # therefor according to 2.
LINKER_VM = /afs/informatik.uni-tuebingen.de/home/gasbichl/i386_fbsd40/lib/scheme48/scheme48vm $(BIG_HEAP) LINKER_VM = $(RUNNABLE) $(BIG_HEAP)
LINKER_RUNNABLE = scheme48 LINKER_RUNNABLE = $(RUNNABLE)
LINKER_IMAGE = build/linker.image LINKER_IMAGE = build/linker.image
LINKER = $(LINKER_VM) -i $(LINKER_IMAGE) LINKER = $(LINKER_VM) -i $(LINKER_IMAGE)
@ -96,7 +95,7 @@ START_LINKER = echo ',batch' && echo ',bench on'
# Targets: # Targets:
IMAGE = scsh.image IMAGE = scheme48.image
INITIAL = $(srcdir)/build/initial.image INITIAL = $(srcdir)/build/initial.image
VM = scshvm VM = scshvm
LIBCIG = cig/lib$(VM).a LIBCIG = cig/lib$(VM).a
@ -151,17 +150,17 @@ CONFIG_FILES = scheme/interfaces.scm scheme/low-packages.scm \
# The following is the first rule and therefore the "make" command's # The following is the first rule and therefore the "make" command's
# default target. # default target.
enough: $(VM) $(IMAGE) go $(LIBCIG) scsh $(LIBSCSH) $(LIBSCSHVM) enough: $(VM) $(IMAGE) go $(LIBCIG) scsh $(LIBSCSH) $(LIBSCSHVM)
#JMG: no manpages at the moment $(MANPAGE)
#JMG no notify at the moment... .notify #JMG no notify at the moment... .notify
# Files generated by cig
CIGGED = flock network select syscalls tty time
CIGGEDOBJ = $(patsubst %,scsh/%.o, $(CIGGED))
CIGGEDINIT = $(patsubst %,s48_init_%, $(CIGGED))
# -------------------- # --------------------
# External code to include in the VM # External code to include in the VM
# After changing any of these you should delete `scheme48vm' and remake it. # After changing any of these you should delete `scheme48vm' and remake it.
CIGGED = flock network select syscalls tty time
CIGGEDOBJ = $(patsubst %,scsh/%.o, $(CIGGED))
CIGGEDINIT = $(patsubst %,s48_init_%, $(CIGGED))
EXTERNAL_OBJECTS = $(SOCKET_OBJECTS) $(LOOKUP_OBJECTS) EXTERNAL_OBJECTS = $(SOCKET_OBJECTS) $(LOOKUP_OBJECTS)
EXTERNAL_FLAGS = $(SOCKET_FLAGS) EXTERNAL_FLAGS = $(SOCKET_FLAGS)
EXTERNAL_INITIALIZERS = $(ADDITIONAL_INITIALIZER) $(SOCKET_INITIALIZERS) \ EXTERNAL_INITIALIZERS = $(ADDITIONAL_INITIALIZER) $(SOCKET_INITIALIZERS) \
@ -199,12 +198,13 @@ ADDITIONAL_INITIALIZER = s48_init_additional_inits
# -------------------- # --------------------
# The developers are curious to know. Don't be concerned if this fails. # The developers are curious to know. Don't be concerned if this fails.
# TODO: change this to scsh-notifications
.notify: build/minor-version-number .notify: build/minor-version-number
touch .notify touch .notify
-echo Another 0.`cat $(srcdir)/build/minor-version-number` \ -echo SCSH 0.`cat $(srcdir)/scsh/minor-version-number` \
installation. \ Scheme48 0.`cat $(srcdir)/minor-version-number` infestation. \
| mail scheme-48-notifications@martigny.ai.mit.edu | mail scheme-48-notifications@zurich.ai.mit.edu
-echo Another scsh 0.`cat $(srcdir)/scsh/minor-version-number` \
infestation. | mail scsh-notifications@zurich.ai.mit.edu
# This says how to process .scm files with cig to make .c stubs. # This says how to process .scm files with cig to make .c stubs.
@ -277,7 +277,7 @@ $(LIBSCSH): $(OBJS) $(OBJS) $(UNIX_OBJS) $(LIBOBJS) $(EXTERNAL_OBJECTS)
$(AR) $@ $(OBJS) $(OBJS) $(UNIX_OBJS) $(LIBOBJS) $(EXTERNAL_OBJECTS) \ $(AR) $@ $(OBJS) $(OBJS) $(UNIX_OBJS) $(LIBOBJS) $(EXTERNAL_OBJECTS) \
/tmp/s48_external_$$$$.o && \ /tmp/s48_external_$$$$.o && \
$(RANLIB) $@ && \ $(RANLIB) $@ && \
rm -f /tmp/s48_external_$$$$.{c,o} rm -f /tmp/s48_external_$$$$.c /tmp/s48_external_$$$$.o
c/main.o: c/main.c c/main.o: c/main.c
$(CC) -c $(CFLAGS) -o $@ \ $(CC) -c $(CFLAGS) -o $@ \
@ -314,15 +314,13 @@ c/fake/strerror.o: c/fake/strerror.h
$(IMAGE): $(VM) scheme/env/init-defpackage.scm scheme/more-interfaces.scm \ $(IMAGE): $(VM) scheme/env/init-defpackage.scm scheme/more-interfaces.scm \
scheme/link-packages.scm scheme/more-packages.scm \ scheme/link-packages.scm scheme/more-packages.scm \
$(usual-files) build/initial.debug build/build-usual-image $(usual-files) build/initial.debug build/build-usual-image
# sh $(srcdir)/build/build-usual-image "$(srcdir)" "$(LIB)" "$(IMAGE)" \
# "$(VM)" "$(INITIAL)"
build/build-usual-image . "`pwd`/scheme" '$(IMAGE)' './$(VM)' \ build/build-usual-image . "`pwd`/scheme" '$(IMAGE)' './$(VM)' \
'$(INITIAL)' '$(INITIAL)'
### Fake targets: all clean install man dist ### Fake targets: all clean install man dist
#inst-man
install: dirs inst-script inst-vm inst-misc inst-inc install-cig \ install: enough dirs inst-script inst-vm inst-misc inst-man inst-inc \
install-scsh inst-doc install-cig install-scsh
inst-vm: $(VM) inst-vm: $(VM)
$(INSTALL_PROGRAM) $(VM) $(LIB) $(INSTALL_PROGRAM) $(VM) $(LIB)
@ -331,11 +329,11 @@ inst-image: $(IMAGE)
$(INSTALL_DATA) $(IMAGE) $(LIB) $(INSTALL_DATA) $(IMAGE) $(LIB)
inst-man: $(MANPAGE) inst-man:
if [ -d $(mandir) -a -w $(mandir) ]; then \ if [ -d $(mandir) -a -w $(mandir) ]; then \
sed 's=LBIN=$(bindir)=g' doc/scheme48.man | \ sed 's=LBIN=$(bindir)=g' doc/scsh.man | \
sed 's=LLIB=$(LIB)=g' | \ sed 's=LLIB=$(LIB)=g' | \
sed 's=LS48=$(RUNNABLE)=g' >$(MANPAGE) && \ sed 's=LSCSH=$(RUNNABLE)=g' >$(MANPAGE) && \
$(INSTALL_DATA) $(MANPAGE) $(mandir) && \ $(INSTALL_DATA) $(MANPAGE) $(mandir) && \
rm $(MANPAGE); \ rm $(MANPAGE); \
else \ else \
@ -362,6 +360,14 @@ inst-misc:
$(INSTALL_DATA) $$f $(LIB)/rts || exit 1; \ $(INSTALL_DATA) $$f $(LIB)/rts || exit 1; \
done done
inst-doc:
for f in $(srcdir)/doc/*.txt $(srcdir)/doc/*.tex $(srcdir)/doc/*.ps; do \
$(INSTALL_DATA) $$f $(LIB)/doc/; \
done && \
for f in $(srcdir)/doc/scsh-manual/*.tex; \
do $(INSTALL_DATA) $$f $(LIB)/doc/scsh-manual/; \
done
inst-script: inst-script:
script=$(bindir)/$(RUNNABLE) && \ script=$(bindir)/$(RUNNABLE) && \
echo '#!/bin/sh' >$$script && \ echo '#!/bin/sh' >$$script && \
@ -371,7 +377,7 @@ inst-script:
>>$$script && \ >>$$script && \
chmod +x $$script chmod +x $$script
# Script to run scheme48 in this directory. # Script to run scsh in this directory.
go: go:
echo '#!/bin/sh' >$@ && \ echo '#!/bin/sh' >$@ && \
echo >>$@ && \ echo >>$@ && \
@ -381,17 +387,15 @@ go:
chmod +x $@ chmod +x $@
dirs: dirs:
for dir in $(libdir) $(bindir) $(incdir); do \ for dir in $(libdir) $(bindir) $(incdir) $(LIB) $(mandir); do \
[ -d $$dir -a -w $$dir ] || { \ { mkdir -p $$dir && [ -w $$dir ]; } || { \
echo "$$dir not a writable directory" >&2; \ echo "$$dir not a writable directory" >&2; \
exit 1; \ exit 1; \
}; \ } \
done done && \
{ mkdir -p $(LIB) && [ -w $(LIB) ]; } || { \ for dir in \
echo "$(LIB) not a writable directory" >&2; \ rts env big opt misc link scsh doc doc/scsh-manual cig; \
exit 1; \ do \
}
for dir in rts env big opt misc link scsh; do \
{ mkdir -p $(LIB)/$$dir && [ -w $(LIB)/$$dir ]; } || { \ { mkdir -p $(LIB)/$$dir && [ -w $(LIB)/$$dir ]; } || { \
echo "$(LIB)/$$dir not a writable directory" >&2; \ echo "$(LIB)/$$dir not a writable directory" >&2; \
exit 1; \ exit 1; \
@ -401,7 +405,6 @@ dirs:
configure: configure.in configure: configure.in
autoheader && autoconf autoheader && autoconf
#JMG: removed TAGS
clean: clean-cig clean-scsh clean: clean-cig clean-scsh
-rm -f $(VM) *.o c/unix/*.o c/*.o c/fake/*.o \ -rm -f $(VM) *.o c/unix/*.o c/*.o c/fake/*.o \
$(IMAGE) \ $(IMAGE) \
@ -417,7 +420,6 @@ clean-scm2c:
rm -f scsh/flock.c scsh/network.c \ rm -f scsh/flock.c scsh/network.c \
scsh/select.c scsh/syscalls.c scsh/tty.c scsh/time.c scsh/select.c scsh/syscalls.c scsh/tty.c scsh/time.c
#JMG: moved config.cache to distclean for easier debugging
distclean: clean distclean: clean
rm -f Makefile config.log config.status c/sysdep.h config.cache \ rm -f Makefile config.log config.status c/sysdep.h config.cache \
scsh/machine scsh/regexp/Makefile \ scsh/machine scsh/regexp/Makefile \
@ -448,11 +450,7 @@ image: $(INITIAL)
$(MAKE) $(IMAGE) $(MAKE) $(IMAGE)
tags: tags:
find . -name "*.scm" -or -name "*.c" -or -name "*.h" | etags - find . -name "*.scm" -o -name "*.c" -o -name "*.h" | etags -
# etags scsh/*.scm scsh/*.c \
# scheme/vm/arch.scm scheme/rts/*.scm scheme/bcomp/*.scm \
# scheme/*.scm scheme/env/*.scm scheme/big/*.scm scheme/link/*.scm \
# scheme/opt/*.scm scheme/debug/*.scm scheme/misc/*.scm
# -------------------- # --------------------
# Distribution... # Distribution...
@ -707,20 +705,6 @@ $(CIG): $(VM) $(IMAGE) $(srcdir)/cig/cig.scm $(srcdir)/cig/libcig.scm
mv /tmp/cig $(srcdir)/cig/cig_bootstrap mv /tmp/cig $(srcdir)/cig/cig_bootstrap
$(RM) /tmp/cig $(RM) /tmp/cig
$(CIG)2:
(echo ",batch"; \
echo ",translate =scheme48/ $(srcdir)/scheme/"; \
echo ",config ,load $(srcdir)/cig/cig2.scm"; \
echo ",config ,load $(srcdir)/cig/libcig.scm"; \
echo ",load-package cig-standalone"; \
echo ",in cig-standalone"; \
echo ",translate =scheme48/ $(LIB)/"; \
echo '(dump-scsh-program cig-standalone-toplevel "/tmp/cig")') \
| ./$(VM) -o ./$(VM) -i ./scsh/scsh.image
$(srcdir)/cig/image2script $(LIB)/$(VM) </tmp/cig > $(CIG)2
-chmod +x $(CIG)2
$(RM) /tmp/cig
$(CIG).image: $(IMAGE) $(VM) $(srcdir)/cig/cig.scm $(srcdir)/cig/libcig.scm $(CIG).image: $(IMAGE) $(VM) $(srcdir)/cig/cig.scm $(srcdir)/cig/libcig.scm
(echo ",batch"; \ (echo ",batch"; \
echo ",translate =scheme48/ $(srcdir)/scheme/"; \ echo ",translate =scheme48/ $(srcdir)/scheme/"; \
@ -862,53 +846,9 @@ scsh/scsh.image: $(VM) $(SCHEME) $(CIG).image
echo ",batch on") \ echo ",batch on") \
| ./$(VM) -o ./$(VM) -i $(CIG).image -h 10000000 | ./$(VM) -o ./$(VM) -i $(CIG).image -h 10000000
# echo ",build (lambda (args) ((scsh-stand-alone-resumer (make-scsh-starter)) args)) bla.image"; \
#scsh/scsh.image: $(VM) $(SCHEME) $(CIG).image
# (echo ",translate =scheme48/ $(srcdir)/"; \
# echo ",batch on"; \
# echo ",load-package floatnums"; \
# echo ",open externals"; \
# echo "(lookup-all-externals)"; \
# echo ",config"; \
# echo ",load $(srcdir)/scsh/let-opt.scm"; \
# echo ",load $(srcdir)/scsh/scsh-interfaces.scm"; \
# echo ",load $(srcdir)/scsh/machine/packages.scm"; \
# echo ",load $(srcdir)/scsh/scsh-package.scm"; \
# echo ",load-package scsh"; \
# echo ",load-package scsh-here-string-hax"; \
# echo ",translate =scheme48/ $(LIB)/"; \
# echo ",in scsh-level-0"; \
# echo "(%install-scsh-handlers)"; \
# echo "(autoreap-policy 'early)"; \
# echo ",user"; \
# echo ",open floatnums"; \
# echo ",open scsh"; \
# echo ",dump scsh/scsh.image") \
# | ./$(VM) -o ./$(VM) -i $(CIG).image
# Removed these lines from scsh/scsh.image rule so you don't lose so
# badly when you are debugging in scsh. -Olin 6/95
# echo ",flush";
# echo ",flush maps source names files table";
#scsh/scsh.runnable: scsh/scsh.image
# cig/image2script $(LIB)/$(VM) -o $(LIB)/$(VM) -h 1800000 \
# < scsh/scsh.image > $@
# -chmod +x $@
scsh/regexp/libregex.a: scsh/regexp/libregex.a:
cd ./scsh/regexp; $(MAKE) lib cd ./scsh/regexp; $(MAKE) lib
scsh/scsh.vm: $(LIBSCSHVM) $(VM) scsh/scsh.image
./$(VM) -o ./$(VM) -h 8000000 -i scsh/scsh.image \
-lm ./vm/ps-interface.scm \
-lm ./vm/interfaces.scm \
-lm ./vm/package-defs.scm \
-lm ./vm/s48-package-defs.scm \
-dm -m static-heaps -e static-heap-linker \
-s scsh/static.scm \
-i scsh/scsh.image -o $@
install-scsh: scsh install-scsh: scsh
$(RM) $(bindir)/$(RUNNABLE) $(RM) $(bindir)/$(RUNNABLE)
$(INSTALL_PROGRAM) $(srcdir)/scsh/scsh $(bindir)/$(RUNNABLE) $(INSTALL_PROGRAM) $(srcdir)/scsh/scsh $(bindir)/$(RUNNABLE)
@ -922,7 +862,7 @@ install-scsh: scsh
clean-scsh: clean-scsh:
$(RM) scsh/*.o scsh/regexp/*.o scsh/rx/*.o scsh/machine/*.o $(RM) scsh/*.o scsh/regexp/*.o scsh/rx/*.o scsh/machine/*.o
$(RM) scsh/*.image $(RM) scsh/*.image
$(RM) $(LIBSCSHVM) $(LIBSCSH) scsh/scsh$(EXEEXT) scsh/scsh.vm $(RM) $(LIBSCSHVM) $(LIBSCSH) scsh/scsh$(EXEEXT)
-cd scsh/regexp; $(MAKE) clean -cd scsh/regexp; $(MAKE) clean