home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
s
/
s48.zip
/
MAKEFILE
< prev
next >
Wrap
Text File
|
1992-06-18
|
5KB
|
175 lines
# Scheme48 Makefile
# Last updated May 1992 by JAR
# Due to a bug ("limitation") in many implementations of the Unix
# kernel's shell script execution feature (#! at the beginning of an
# exec'ed file), the length of the string produced by $(BIN)/$(VM)
# should be <= 27 characters in order for the "install_method_1"
# target to work. If $(BIN)/$(VM) is too long, or this feature is
# unsupported, then change INSTALL_TARGET to be "install_method_2"
# instead of "install_method_1".
# Set the following variables as appropriate for your site.
BIN = /usr/u/jar/bin
LIB = /usr/u/jar/lib
MAN = /usr/u/jar/man/man1
DISTDIR = /usr/spool/ftp/pub/jar
RUNNABLE = s48
INSTALL_METHOD = install_method_1
CC = gcc
# Avoid changing anything below this point, except MOREFILES, which
# you might want to change to make the default image have more or less
# stuff in it.
CFLAGS = -O2 -g
SUBMAKEFILE = Makefile.filenames
include $(SUBMAKEFILE)
MOREFILES = $(EXTRAFILES)
# Sources: (IMAGE is also a target)
CFILES = main.c unix.c error.c extension.c scheme48vm.c
FILES_FILE = files.scm
IMAGE = scheme48.image
# DISTFILES should include all sources.
DISTFILES = COPYING README INSTALL Makefile NEWS TODO user-guide.txt \
$(SUBMAKEFILE) $(CFILES) $(IMAGE) $(FILES_FILE) $(ALLFILES) \
scheme48.man
# Targets:
VM = scheme48vm
OBJFILES = main.o unix.o error.o extension.o scheme48vm.o
LINKER_IMAGE = boot/linker.image
SYSTEM_IMAGE = boot/system.image
# Make's default target will be the VM only, not the image. We can't
# make a new image unless we already have an installed scheme48 (i.e.
# RUNNABLE).
$(VM): $(OBJFILES)
$(CC) -o $(VM) $(OBJFILES)
# The linker is capable of rebuilding an image from sources, even
# across an incompatible change in VM data representations.
# The :bench command here turns benchmark mode on.
$(LINKER_IMAGE) : $(COMPILERFILES) $(LINKERFILES)
(echo :batch; \
echo :bench; \
echo :load $(FILES_FILE); \
echo "(load-linker)"; \
echo :undefined; \
echo :dump $(LINKER_IMAGE)) \
| $(RUNNABLE)
# Use the linker to build a new Scheme48 system image ("rts").
$(SYSTEM_IMAGE) : $(LINKER_IMAGE) $(RTSFILES)
(echo :batch; \
echo :load $(FILES_FILE); \
echo "(link-system)") \
| $(RUNNABLE) -i $(LINKER_IMAGE)
# The double $ in the following causes make to pass a single $ on to sh.
# Filename boot/system.debug shouldn't be hard-wired!
# The :bench command here turns benchmark mode off.
$(IMAGE): $(VM) $(SYSTEM_IMAGE) $(MOREFILES)
(echo :load $(MOREFILES); \
echo "(command-processor 'batch)"; \
echo "(read-debug-info \"boot/system.debug\")"; \
echo "(keep-debug-data! 'maps #t)"; \
echo "(keep-debug-data! 'source #t)"; \
echo :bench; \
echo :disable; \
echo :identify-image \"\(made by $$USER on `date`\)\"; \
echo :dump $(IMAGE)) \
| ./$(VM) -i $(SYSTEM_IMAGE)
main.o: main.c
$(CC) $(CFLAGS) -c -DDEFAULT_IMAGE_NAME=\"$(BIN)/$(RUNNABLE)\" main.c
$(SUBMAKEFILE): $(FILES_FILE)
(echo :batch; \
echo :load $(FILES_FILE); \
echo "(write-makefile \"$(SUBMAKEFILE)\")") \
| $(RUNNABLE)
$(RUNNABLE).1: scheme48.man Makefile
sed 's=LBIN=$(BIN)=g' scheme48.man \
| sed 's=LLIB=$(BIN)=g' \
| sed 's=LS48=$(RUNNABLE)=g' >$@
$(DISTDIR)/s48.tar.Z: $(DISTFILES)
tar cf - $(DISTFILES) \
| compress -c >$(DISTDIR)/s48.tar.Z
# This fake target is for making a new system.image quickly (but
# "incestuously"). This doesn't rely on the linker image.
# You'll probably want to follow a "make quickly" with
# "make scheme48.image".
quickly: $(QUICKLYFILES) $(RTSFILES)
(echo :batch; \
echo :load $(FILES_FILE); \
echo "(for-each load-file quickly-files)"; \
echo "(link-system)") \
| $(RUNNABLE)
boot/testsys.image: boot/testsys.scm $(LINKER_IMAGE)
(echo :batch; \
echo "(define testsys";\
echo " (make-system '(\"boot/testsys.scm\") 'resume #f))"; \
echo "(write-system testsys \"boot/testsys.image\")") \
| $(RUNNABLE) -i $(LINKER_IMAGE)
boot/little.image: boot/little.scm $(LINKER_IMAGE)
(echo :batch; \
echo "(link-little)") \
| $(RUNNABLE) -i $(LINKER_IMAGE)
# Big kludge (p- means Pseudoscheme)
p-files.scm: files.scm
sed -e "s= s48-= p-=" <files.scm >p-files.scm
t-files.scm: files.scm
sed -e "s= s48-= t-=" <files.scm >t-files.scm
# Fake targets: all clean install man dist
all: $(SUBMAKEFILE) $(VM) $(IMAGE)
clean:
-rm -f $(VM) *.o *.1 boot/*.image boot/*.debug TAGS
install: $(VM) $(INSTALL_METHOD) $(RUNNABLE).1
cp $(VM) $(BIN)/
chmod +x $(BIN)/$(RUNNABLE)
cp $(RUNNABLE).1 $(MAN)/
chmod +r $(MAN)/$(RUNNABLE).1
install_method_1:
(echo '#!$(BIN)/$(VM)' -i; cat $(IMAGE)) >$(BIN)/$(RUNNABLE)
install_method_2:
cp $(IMAGE) $(LIB)/$(IMAGE)
(echo '#!/bin/sh'; \
echo exec '$(BIN)/$(VM)' -i '$(LIB)/$(IMAGE) "$$@"') \
> $(BIN)/$(RUNNABLE)
man: $(RUNNABLE).1
dist: $(DISTDIR)/s48.tar.Z
tags:
etags rts/*.scm misc/*.scm