summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile204
1 files changed, 129 insertions, 75 deletions
diff --git a/Makefile b/Makefile
index 57f6594..47ce75c 100644
--- a/Makefile
+++ b/Makefile
@@ -43,9 +43,10 @@
SHELL = /bin/sh
#CC = gcc
-CFLAGS = -g
+#CFLAGS = -g
#LIBS =
-LD = $(CC) -g
+#LD = $(CC) -g
+LD = $(CC)
SCMLIT = ./scmlit
SCMEXE = ./scm
@@ -59,7 +60,7 @@ intro:
@echo
@echo "This is the scm$(VERSION) distribution. Read \"scm.info\""
@echo "to learn how to build and install SCM. Or browse"
- @echo " http://swissnet.ai.mit.edu/~jaffer/SCM.html"
+ @echo " http://swissnet.ai.mit.edu/~jaffer/SCM"
@echo
$(MAKE) scm
@@ -85,7 +86,7 @@ IMPLINIT = $(IMPLPATH)Init$(VERSION).scm
cfiles = scmmain.c scm.c time.c repl.c ioext.c scl.c sys.c eval.c \
subr.c sc2.c unif.c rgx.c crs.c dynl.c record.c posix.c socket.c\
unix.c rope.c ramap.c gsubr.c edline.c Iedline.scm continue.c \
- findexec.c script.c debug.c
+ findexec.c script.c debug.c byte.c
ofiles = scm.o time.o repl.o scl.o sys.o eval.o subr.o unif.o rope.o \
continue.o findexec.o script.o debug.o
# ramap.o
@@ -102,6 +103,7 @@ all: require.scm
require.scm:
cp -p requires.scm require.scm
+# SCMLIT -- try making this first!
scmlit: $(ofiles) scmmain.o require.scm Makefile
$(LD) -o scmlit $(ofiles) scmmain.o $(LIBS)
$(MAKE) checklit
@@ -113,7 +115,6 @@ scmflags:
echo "/*#define CAUTIOUS*/" >> newflags.h
-if (diff newflags.h scmflags.h) then rm newflags.h; \
else mv newflags.h scmflags.h; fi
-
.c.o:
$(CC) -c $(CFLAGS) $< -o $@
scm.o: scm.c scm.h scmfig.h scmflags.h patchlvl.h
@@ -128,25 +129,33 @@ sys.o: sys.c scm.h scmfig.h scmflags.h setjump.h
time.o: time.c scm.h scmfig.h scmflags.h
subr.o: subr.c scm.h scmfig.h scmflags.h
rope.o: rope.c scm.h scmfig.h scmflags.h
-continue.o: continue.c continue.h setjump.h scmflags.h
+continue.o: continue.c continue.h setjump.h scm.h scmfig.h scmflags.h
-udscm4: $(cfiles) $(hfiles) build.scm build
- $(BUILD) -o udscm4 -s $(IMPLPATH) \
- -Fcautious bignums arrays inexact dump dynamic-linking \
- engineering-notation
- rm $(ofiles) scmmain.o
+# Simple build with bignums for running JACAL
+scm:
+ $(BUILD) -s $(IMPLPATH) -F cautious bignums arrays # i/o-extensions
+ $(MAKE) check
-udscm5: $(cfiles) $(hfiles) build.scm build Makefile
- $(BUILD) -o udscm5 -s $(IMPLPATH) \
- -Fcautious bignums arrays inexact dump dynamic-linking \
- macro engineering-notation #-DNO_SYM_GC
+# R4RS interpreter
+udscm4.opt:
+ echo "-F cautious bignums arrays inexact" >> udscm4.opt
+ echo "-F engineering-notation dump dynamic-linking" >> udscm4.opt
+udscm4: $(cfiles) $(hfiles) build.scm build udscm4.opt
+ $(BUILD) -f udscm4.opt -o udscm4 -s $(IMPLPATH)
rm $(ofiles) scmmain.o
-
myscm4: udscm4 $(ifiles) require.scm
-rm slibcat implcat
-mv scm scm~
echo "(quit)" | ./udscm4 -no-init-file -o scm
+# R5RS interpreter
+udscm5.opt: udscm4.opt
+ cat udscm4.opt >> udscm5.opt
+ echo "-F macro" >> udscm5.opt
+# echo "-DNO_SYM_GC" >> udscm5.opt
+udscm5: $(cfiles) $(hfiles) build.scm build Makefile udscm5.opt
+ $(BUILD) -f udscm5.opt -o udscm5 -s $(IMPLPATH)
+ rm $(ofiles) scmmain.o
myscm5: udscm5 $(ifiles) require.scm
-rm slibcat implcat
-mv scm scm~
@@ -154,30 +163,60 @@ myscm5: udscm5 $(ifiles) require.scm
$(MAKE) check
$(MAKE) checkmacro
-scm: scmlit
- $(BUILD) -s $(IMPLPATH) -Fcautious bignums arrays
- $(MAKE) check
+# R5RS interpreter for debugging with GDB.
+gdb.opt: udscm5.opt
+ cat udscm5.opt >> gdb.opt
+ echo "-F debug" >> gdb.opt
+ echo "--compiler-options=-Wall" >> gdb.opt
+ echo "--linker-options=-Wall" >> gdb.opt
+ echo "-D NO_ENV_CACHE" >> gdb.opt
+# echo "-DTEST_FARLOC -DTEST_SCM2PTR" >> gdb.opt
+udgdbscm: gdb.opt
+ $(BUILD) -f gdb.opt -o udgdbscm -s $(IMPLPATH)
+gdbscm: udgdbscm
+ echo "(quit)" | ./udgdbscm -no-init-file -r5 -o gdbscm
+# R4RS interpreter for profiling
+pg.opt: udscm4.opt
+ cat udscm4.opt >> pg.opt
+ echo "--compiler-options=-pg" >> pg.opt
+ echo "--linker-options=-pg" >> pg.opt
+ echo "-DLACK_SETITIMER" >> pg.opt
+udpgscm: pg.opt
+ $(BUILD) -f pg.opt -o udpgscm -s $(IMPLPATH)
+pgscm: udpgscm
+ echo "(quit)" | ./udpgscm -no-init-file -o pgscm
+
+# R4RS SCM library
+libscm.opt:
+ echo "-F cautious bignums arrays inexact" >> libscm.opt
+ echo "-F engineering-notation" >> libscm.opt
+ echo "-F dynamic-linking" >> libscm.opt
mylib: libscm.a
-libscm.a:
- $(BUILD) -Fcautious bignums arrays inexact \
- dynamic-linking -t lib
+libscm.a: libscm.opt
+ $(BUILD) -t lib -f libscm.opt
libtest: libscm.a libtest.c
- gcc -o libtest libtest.c libscm.a -ldl -lm -lc
+ $(LD) -o libtest libtest.c libscm.a -ldl -lm -lc
./libtest
-pgscm:
- $(BUILD) -s $(IMPLPATH) -Fcautious bignums arrays \
- inexact engineering-notation dump dynamic-linking -o udscm \
- --compiler-options=-pg --linker-options=-pg -DLACK_SETITIMER
- echo "(quit)" | ./udscm -no-init-file -o pgscm
-mydebug:
- $(BUILD) -oudgdbscm -s $(IMPLPATH) \
- -F cautious bignums arrays inexact engineering-notation dump \
- dynamic-linking macro debug \
- --compiler-options=-Wall --linker-options=-Wall \
- -DNO_ENV_CACHE #-DTEST_FARLOC -DTEST_SCM2PTR
- echo "(quit)" | ./udgdbscm -no-init-file -r5 -o gdbscm
+# DLLs for dynamic linking
+dlls.opt:
+ echo "--compiler-options=-Wall" >> dlls.opt
+ echo "--linker-options=-Wall" >> dlls.opt
+mydlls: dlls.opt
+ if [ -f /usr/lib/libreadline.so ]; \
+ then $(BUILD) -t dll -f dlls.opt -F edit-line; fi
+ $(BUILD) -t dll -f dlls.opt -F curses
+ $(BUILD) -t dll -f dlls.opt -c sc2.c rgx.c record.c gsubr.c \
+ ioext.c posix.c unix.c socket.c ramap.c byte.c
+
+myturtle: dlls.opt
+ $(BUILD) -t dll -f dlls.opt -F turtlegr
+
+x.so: x.c x.h xevent.h dlls.opt
+ $(BUILD) -t dll -f dlls.opt -F x
+
+# Generate x11 include and Scheme files
incdir=/usr/include/
x11.scm: inc2scm
rm -f x11.scm
@@ -190,20 +229,8 @@ xevent.h xevent.scm xatoms.scm: xgen.scm Makefile
$(SCMLIT) -l xgen.scm $(incdir)X11/Xlib.h
x.h: x.c xevent.h
if [ ! -z "$(CPROTO)" ]; then $(CPROTO) x.c > x.h; fi
-x.so: x.c x.h xevent.h
- $(BUILD) -Fx -t dll --compiler-options=-Wall
-mydlls:
- if [ -f /usr/lib/libreadline.so ]; \
- then $(BUILD) -Fedit-line -t dll; fi
- $(BUILD) -Fcurses -t dll
- $(BUILD) -t dll -c sc2.c rgx.c record.c gsubr.c \
- ioext.c posix.c unix.c socket.c ramap.c
-myturtle:
- $(BUILD) -Fturtlegr -t dll
-
-implcat: *.so mkimpcat.scm
- $(SCMLIT) -lmkimpcat.scm
+# Check SCM; SCMLIT function.
checklit:
$(SCMLIT) -fr4rstest.scm -e'(test-sc4)(test-cont)(test-delay)(gc)' \
-e '(or (null? errs) (quit 1))'
@@ -214,6 +241,9 @@ checkmacro: syntest1.scm syntest2.scm r4rstest.scm
$(SCMEXE) -rmacro -fsyntest1.scm -fsyntest2.scm \
-fr4rstest.scm -e'(test-sc4)(test-cont)(test-delay)' -fsyntest1 \
-e '(or (null? errs) (quit 1))'
+
+# Measuare running speed of SCM; SCMLIT. Results are appended to file
+# "BenchLog"
bench:
echo `whoami`@`hostname` testing scm \
`$(SCMEXE) -e'(display *scm-version*)'` >> BenchLog
@@ -222,10 +252,13 @@ bench:
size scm >> BenchLog
uname -a >> BenchLog
$(SCMEXE) -lbench.scm
- cat bench.log >> BenchLog
+ -cat prng.log >> BenchLog
+ echo >> BenchLog
+ -cat pi.log >> BenchLog
echo >> BenchLog
echo
tail -20 BenchLog
+ -rm -f pi.log prng.log
benchlit:
echo `whoami`@`hostname` testing scmlit \
`$(SCMLIT) -e'(display *scm-version*)'` >> BenchLog
@@ -234,14 +267,20 @@ benchlit:
size scmlit >> BenchLog
uname -a >> BenchLog
$(SCMLIT) -lbench.scm
- cat bench.log >> BenchLog
+ -cat prng.log >> BenchLog
+ echo >> BenchLog
+ -cat pi.log >> BenchLog
echo >> BenchLog
echo
tail -20 BenchLog
+ -rm -f pi.log prng.log
report:
$(SCMLIT) -e"(slib:report #t)"
$(SCMEXE) -e"(slib:report #t)"
+implcat: *.so mkimpcat.scm
+ $(SCMLIT) -lmkimpcat.scm
+
htmldir=../public_html/
dvidir=../dvi/
dvi: $(dvidir)scm.dvi $(dvidir)Xlibscm.dvi $(dvidir)hobbit.dvi
@@ -265,11 +304,11 @@ $(dvidir)hobbit.dvi: version.txi hobbit.texi $(dvidir)hobbit.fn Makefile
$(dvidir)hobbit.fn:
cd $(dvidir);export TEXINPUTS=$(srcdir):;tex $(srcdir)hobbit.texi
xdvi: $(dvidir)scm.dvi
- xdvi -s 6 $(dvidir)scm.dvi
+ xdvi -s 3 $(dvidir)scm.dvi
Xdvi: $(dvidir)Xlibscm.dvi
- xdvi -s 6 $(dvidir)Xlibscm.dvi
+ xdvi -s 3 $(dvidir)Xlibscm.dvi
hobdvi: $(dvidir)hobbit.dvi
- xdvi -s 6 $(dvidir)hobbit.dvi
+ xdvi -s 3 $(dvidir)hobbit.dvi
pdf: $(htmldir)scm.pdf $(htmldir)Xlibscm.pdf $(htmldir)hobbit.pdf
$(htmldir)scm.pdf: version.txi scm.texi platform.txi features.txi\
@@ -292,12 +331,13 @@ hobpdf: $(htmldir)hobbit.pdf
PREVDOCS = prevdocs/
html: $(htmldir)scm_toc.html $(htmldir)Xlibscm_toc.html $(htmldir)hobbit_toc.html
+TEXI2HTML = /usr/local/bin/texi2html -split -verbose
scm_toc.html: version.txi scm.texi platform.txi features.txi
- texi2html -split -verbose scm.texi
+ ${TEXI2HTML} scm.texi
Xlibscm_toc.html: version.txi Xlibscm.texi
- texi2html -split -verbose Xlibscm.texi
+ ${TEXI2HTML} Xlibscm.texi
hobbit_toc.html: version.txi hobbit.texi
- texi2html -split -verbose hobbit.texi
+ ${TEXI2HTML} hobbit.texi
$(htmldir)scm_toc.html: scm_toc.html Makefile
-rm -f scm_stoc.html
@@ -361,14 +401,14 @@ Xlibscm.info: version.txi Xlibscm.texi
makeinfo Xlibscm.texi --no-split -o Xlibscm.info
$(infodir)Xlibscm.info: Xlibscm.info
cp Xlibscm.info $(infodir)Xlibscm.info
- -install-info $(infodir)Xlibscm.info $(infodir)/dir
+ -install-info $(infodir)Xlibscm.info $(infodir)dir
-rm $(infodir)Xlibscm.info*.gz
hobbit.info: version.txi hobbit.texi
makeinfo hobbit.texi --no-split -o hobbit.info
$(infodir)hobbit.info: hobbit.info
cp hobbit.info $(infodir)hobbit.info
- -install-info $(infodir)hobbit.info $(infodir)/dir
+ -install-info $(infodir)hobbit.info $(infodir)dir
-rm $(infodir)hobbit.info*.gz
infoz: installinfoz
@@ -392,8 +432,8 @@ install: scm.1
-cp $(ifiles) $(hobfiles) COPYING r4rstest.scm $(libscmdir)
test -f $(libscmdir)require.scm || \
cp requires.scm $(libscmdir)require.scm
- -cp build build.scm mkimpcat.scm Iedline.scm *.sl *.so $(xafiles)\
- $(libscmdir)
+ -cp build build.scm mkimpcat.scm Iedline.scm *.sl *.so patchlvl.h\
+ $(xafiles) $(libscmdir)
installlib:
test -d $(includedir) || mkdir $(includedir)
@@ -402,14 +442,26 @@ installlib:
cp libscm.a $(libdir)libscm.a
uninstall:
- -rm $(bindir)scm
+ -rm $(bindir)scm $(bindir)scmlit
-rm $(man1dir)scm.1
-rm $(includedir)scm.h $(includedir)scmfig.h $(includedir)scmflags.h
-rm $(libdir)libscm.a
-# -rm $(libscmdir)Init$(VERSION).scm
-# -rm $(libscmdir)Link.scm
-# -rm $(libscmdir)Transcen.scm
-# -rm $(libscmdir)COPYING
+ -rm $(libscmdir)Transcen.scm\
+ $(libscmdir)Link.scm\
+ $(libscmdir)Macro.scm\
+ $(libscmdir)Macexp.scm\
+ $(libscmdir)Tscript.scm\
+ $(libscmdir)compile.scm\
+ $(libscmdir)hobbit.scm\
+ $(libscmdir)scmhob.scm\
+ $(libscmdir)scmhob.h\
+ $(libscmdir)COPYING\
+ $(libscmdir)r4rstest.scm
+ -rm $(libscmdir)Init$(VERSION).scm
+
+uninstallinfo:
+ -rm $(infodir)scm.info.gz $(infodir)Xlibscm.info.gz\
+ $(infodir)hobbit.info.gz
scm.doc: scm.1
nroff -man $< | ul -tunknown >$@
@@ -418,7 +470,7 @@ scm.doc: scm.1
ver = $(VERSION)
version.txi: patchlvl.h
- echo @set SCMVERSION $(VERSION) > version.txi
+ echo @set SCMVERSION $(ver) > version.txi
echo @set SCMDATE `date +"%B %Y"` >> version.txi
RM_R = rm -rf
@@ -438,7 +490,7 @@ tfiles = r4rstest.scm example.scm pi.scm pi.c split.scm bench.scm \
syntest2.scm syntest1.scm
dfiles = ANNOUNCE README COPYING scm.1 scm.doc QUICKREF \
scm.info scm.texi Xlibscm.info Xlibscm.texi hobbit.info hobbit.texi \
- ChangeLog
+ version.txi platform.txi features.txi ChangeLog
mfiles = Makefile build.scm build build.bat requires.scm \
.gdbinit mkimpcat.scm disarm.scm scm.spec
vfiles = setjump.mar setjump.s
@@ -448,6 +500,7 @@ afiles = $(dfiles) $(cfiles) $(hfiles) $(ifiles) $(tfiles) $(mfiles) \
makedev = make -f $(HOME)/makefile.dev
CHPAT=$(HOME)/bin/chpat
RSYNC=rsync -avessh
+UPLOADEE=swissnet_upload
dest = $(HOME)/dist/
temp/scm: $(afiles)
-$(RM_R) temp
@@ -455,13 +508,13 @@ temp/scm: $(afiles)
mkdir temp/scm
ln $(afiles) temp/scm
-release: dist rpm
+release: dist pdf # rpm
cvs tag -F scm$(VERSION)
cp $(srcdir)ANNOUNCE $(htmldir)SCM_ANNOUNCE.txt
- $(RSYNC) $(htmldir)SCM.html $(htmldir)SCM_ANNOUNCE.txt nestle.ai.mit.edu:public_html/
+ $(RSYNC) $(htmldir)SCM.html $(htmldir)SCM_ANNOUNCE.txt $(UPLOADEE):public_html/
$(RSYNC) $(dest)README $(dest)scm$(VERSION).zip \
$(dest)scm-$(VERSION)-$(RELEASE).src.rpm $(dest)scm-$(VERSION)-$(RELEASE).i386.rpm \
- nestle.ai.mit.edu:dist/
+ $(htmldir)hobbit.pdf $(htmldir)Xlibscm.pdf $(UPLOADEE):dist/
# upload $(dest)README $(dest)scm$(VERSION).zip ftp.gnu.org:gnu/jacal/
# $(MAKE) indiana
indiana:
@@ -478,7 +531,7 @@ postnews:
-t "SCM$(VERSION) Released" -d world
upzip: $(HOME)/pub/scm.zip
- $(RSYNC) $(HOME)/pub/scm.zip nestle.ai.mit.edu:pub/
+ $(RSYNC) $(HOME)/pub/scm.zip $(UPLOADEE):pub/
dist: $(dest)scm$(VERSION).zip
$(dest)scm$(VERSION).zip: temp/scm
@@ -573,9 +626,9 @@ lints: $(cfiles) $(hfiles)
SED_TO_STRIP_NM=sed -e '/.*\.o$$/d' -e 's/.* _//' -e 's/.* T //'
#old, bad for T [^_] on suns: SED_TO_STRIP_NM=sed -e '/.*\.o$$/d' -e 's/.* _//'
# For a System V nm where plain C identifiers have _ prepended:
-#SED_TO_STRIP_NM=sed -e '/^_[A-Za-z][A-za-z0-9_]*[ |].*|extern|!d' -e 's/|/ /g' -e 's/^_//'
+#SED_TO_STRIP_NM=sed -e '/^_[A-Za-z][A-za-z0-9_]*[ |].*|extern|!d' -e 's/|/ /g' -e 's/^_//'
# For a System V nm where plain C identifiers have nothing prepended:
-#SED_TO_STRIP_NM=sed -e '/^[A-Za-z][A-za-z0-9_]*[ |].*|extern|!d' -e 's/|/ /g'
+#SED_TO_STRIP_NM=sed -e '/^[A-Za-z][A-za-z0-9_]*[ |].*|extern|!d' -e 's/|/ /g'
name8: name8s
name8s: scmlit
@@ -594,8 +647,9 @@ ctags: $(ctagfiles)
etags $(ctagfiles)
TAGFILES = $(hfiles) $(cfiles) $(ifiles) $(vfiles)\
- version.txi scm.texi Xlibscm.texi hobbit.texi build $(xfiles) $(mfiles)
-# # $(ufiles) ChangeLog hobbit.scm
+ version.txi scm.texi Xlibscm.texi hobbit.texi build $(xfiles) $(mfiles)\
+ hobbit.scm
+# # $(ufiles) ChangeLog
TAGS: $(TAGFILES)
etags $(TAGFILES)
tags: TAGS