"Fossies" - the Fresh Open Source Software Archive

Member "scm/Makefile" (16 Feb 2020, 27929 Bytes) of package /linux/privat/scm-5f3.zip:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "Makefile": 5f2_vs_5f3.

    1 # "Makefile" for scm Scheme Interpreter
    2 # Copyright (C) 1990-2008, 2010 Free Software Foundation, Inc.
    3 #
    4 # This program is free software: you can redistribute it and/or modify
    5 # it under the terms of the GNU Lesser General Public License as
    6 # published by the Free Software Foundation, either version 3 of the
    7 # License, or (at your option) any later version.
    8 #
    9 # This program is distributed in the hope that it will be useful, but
   10 # WITHOUT ANY WARRANTY; without even the implied warranty of
   11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   12 # Lesser General Public License for more details.
   13 #
   14 # You should have received a copy of the GNU Lesser General Public
   15 # License along with this program.  If not, see
   16 # <http://www.gnu.org/licenses/>.
   17 
   18 # Author: Aubrey Jaffer
   19 
   20 # These are normally set in "config.status"; defaults are here so that
   21 # "make" won't complain about target redefinitions.
   22 snapdir=$(HOME)/pub/
   23 infodir=$(HOME)/info/
   24 htmldir=$(HOME)/public_html/
   25 
   26 SHELL = /bin/sh
   27 INSTALL = install
   28 INSTALL_PROGRAM = ${INSTALL}
   29 INSTALL_DATA = ${INSTALL} -m 644
   30 INSTALL_INFO = ginstall-info
   31 
   32 SCMLIT = ./scmlit
   33 SCMEXE = ./scm
   34 BUILD = ./build -hsystem
   35 
   36 TEXI2HTML = /usr/local/bin/texi2html -split -verbose
   37 TEXI2PDF = texi2pdf
   38 VIEWPDF = evince
   39 MAKEDEV = $(MAKE) -f $(HOME)/makefile.dev
   40 CHPAT = $(HOME)/bin/chpat
   41 RSYNC = rsync -av
   42 Uploadee = csail
   43 SCMOPTS = udscm[45].opt scm[45].opt
   44 
   45 # OS-X 10.6, but harmless for other OS.
   46 SETARCH = env DYLD_NO_PIE=1
   47 # Fedora-Core-1
   48 #SETARCH = setarch i386
   49 
   50 #CC = gcc
   51 #CFLAGS = -g
   52 #LIBS =
   53 #LD = $(CC) -g
   54 LD = $(CC)
   55 
   56 # VERSION is defined in "patchlvl.h"
   57 # RELEASE is for RPMs
   58 RELEASE = 1
   59 
   60 intro:	config.status
   61 	@echo
   62 	@echo "This is the scm $(VERSION) distribution.  Read \"scm.info\""
   63 	@echo "to learn how to build and install SCM.  Or browse"
   64 	@echo "      http://people.csail.mit.edu/jaffer/SCM"
   65 	@echo
   66 
   67 # ./configure --distdir=${HOME}/dist/ --snapdir=${HOME}/pub/ --htmldir=${HOME}/public_html/ --pdfdir=${HOME}/public_html/
   68 
   69 config.status:
   70 	./configure
   71 Makefile: config.status
   72 include config.status
   73 
   74 libscmdir = $(libdir)scm/
   75 windistdir = /c/Voluntocracy/dist/
   76 rpm_prefix = $(HOME)/rpmbuild/
   77 prevdocsdir = prevdocs/
   78 
   79 # This should be moved to "config.status"
   80 x11incdir=/usr/include/
   81 
   82 # directory where COPYING and InitXXX.scm reside.
   83 #IMPLPATH = `pwd`/
   84 IMPLPATH=$(srcdir)
   85 include patchlvl.h
   86 IMPLINIT = $(IMPLPATH)Init$(VERSION).scm
   87 
   88 # If pathname where InitXXX.scm resides is not known in advance then
   89 # SCM_INIT_PATH is the environment variable whose value is the
   90 # pathname where InitXXX.scm resides.
   91 
   92 hfiles = scm.h scmfig.h setjump.h patchlvl.h continue.h
   93 cfiles = scmmain.c scm.c time.c repl.c ioext.c scl.c sys.c eval.c	\
   94 	subr.c sc2.c unif.c rgx.c crs.c dynl.c record.c posix.c socket.c\
   95 	unix.c rope.c ramap.c gsubr.c edline.c continue.c	\
   96 	findexec.c script.c debug.c byte.c bytenumb.c differ.c
   97 ufiles = pre-crt0.c ecrt0.c gmalloc.c unexec.c unexelf.c unexhp9k800.c	\
   98 	unexsunos4.c unexalpha.c unexsgi.c unexmacosx.c			\
   99 	macosx-config.h lastfile.c
  100 #	cxux-crt0.s ecrt0.c gmalloc.c pre-crt0.c unexaix.c unexalpha.c \
  101 #	unexapollo.c unexconvex.c unexec.c unexelf.c unexelf1.c \
  102 #	unexencap.c unexenix.c unexfx2800.c unexhp9k800.c unexmips.c \
  103 #	unexnext.c unexnt.c unexsgi.c unexsni.c unexsunos4.c
  104 ofiles = scm.o time.o repl.o scl.o sys.o eval.o subr.o unif.o rope.o \
  105 	continue.o findexec.o script.o debug.o
  106 # continue-ia64.o
  107 ifiles = Init$(VERSION).scm Transcen.scm Link.scm Macro.scm Macexp.scm \
  108 	Tscript.scm compile.scm Iedline.scm Idiffer.scm
  109 hobfiles = hobbit.scm scmhob.scm scmhob.h
  110 turfiles = turtlegr.c turtle grtest.scm
  111 xafiles = xatoms.scm x11.scm xevent.scm keysymdef.scm
  112 xfiles = x.c x.h xgen.scm xevent.h inc2scm $(xafiles)
  113 
  114 tfiles = r4rstest.scm example.scm pi.scm pi.c split.scm bench.scm \
  115 	syntest2.scm syntest1.scm
  116 texifiles = scm.texi fdl.texi indexes.texi platform.txi features.txi
  117 dfiles = ANNOUNCE README COPYING COPYING.LESSER scm.1 scm.doc QUICKREF \
  118 	$(texifiles) scm.info Xlibscm.info Xlibscm.texi \
  119 	hobbit.info hobbit.texi
  120 mfiles = configure Makefile build.scm build build.bat requires.scm \
  121 	.gdbinit mkimpcat.scm disarm.scm scm.spec scm.nsi
  122 sfiles = setjump.mar setjump.s ugsetjump.s continue-ia64.S \
  123 	 get-contoffset-ia64.c
  124 wbfiles = wbtab.scm rwb-isam.scm
  125 catfiles = implcat slibcat
  126 afiles = $(dfiles) ChangeLog $(cfiles) $(hfiles) $(ifiles) $(tfiles)	\
  127 	$(mfiles) $(hobfiles) $(sfiles) $(ufiles) $(xfiles)		\
  128 	version.txi # $(wbfiles) $(turfiles)
  129 
  130 lsdfiles = $(ifiles) $(hobfiles) COPYING COPYING.LESSER r4rstest.scm	\
  131 	build.scm mkimpcat.scm patchlvl.h
  132 #*.sl
  133 
  134 ctagfiles = $(hfiles) $(cfiles) $(xfiles)
  135 tagfiles = $(ctagfiles) $(ifiles) $(sfiles) $(mfiles)	\
  136 	Xlibscm.texi hobbit.texi build hobbit.scm
  137 #	# $(ufiles) ChangeLog $(dfiles)
  138 
  139 installdirs:
  140 	mkdir -p $(DESTDIR)$(includedir)
  141 	mkdir -p $(DESTDIR)$(bindir)
  142 	mkdir -p $(DESTDIR)$(libdir)
  143 	mkdir -p $(DESTDIR)$(libscmdir)
  144 	mkdir -p $(DESTDIR)$(mandir)man1/
  145 	mkdir -p $(DESTDIR)$(infodir)
  146 	mkdir -p $(DESTDIR)$(pdfdir)
  147 	mkdir -p $(DESTDIR)$(dvidir)
  148 
  149 platform.txi: build.scm
  150 	$(MAKE) $(SCMLIT)
  151 	$(SCMLIT) -r database-browse -l build.scm \
  152 	-e "(browse build 'platform)" > platform.txi
  153 features.txi: build build.scm
  154 	$(MAKE) $(SCMLIT)
  155 	$(SCMLIT) -l build -e"(make-features-txi)"
  156 
  157 scm.dvi: $(texifiles) Makefile
  158 	$(TEXI2DVI) -b -c $<
  159 Xlibscm.dvi: Xlibscm.texi version.txi
  160 	$(TEXI2DVI) -b -c $<
  161 hobbit.dvi: hobbit.texi version.txi
  162 	$(TEXI2DVI) -b -c $<
  163 dvi:	scm.dvi Xlibscm.dvi hobbit.dvi
  164 xdvi:	scm.dvi
  165 	xdvi $<
  166 Xdvi:	Xlibscm.dvi
  167 	xdvi $<
  168 hobdvi:	hobbit.dvi
  169 	xdvi $<
  170 install-dvi: scm.dvi Xlibscm.dvi hobbit.dvi
  171 	$(INSTALL_DATA) $< Xlibscm.dvi hobbit.dvi $(DESTDIR)$(dvidir)
  172 
  173 scm.pdf: $(texifiles)
  174 	$(TEXI2PDF) -b -c $<
  175 Xlibscm.pdf: Xlibscm.texi version.txi
  176 	$(TEXI2PDF) -b -c $<
  177 hobbit.pdf: hobbit.texi version.txi
  178 	$(TEXI2PDF) -b -c $<
  179 pdf:	scm.pdf Xlibscm.pdf hobbit.pdf
  180 xpdf:	scm.pdf
  181 	$(VIEWPDF) $<
  182 Xpdf:	Xlibscm.pdf
  183 	$(VIEWPDF) $<
  184 hobpdf:	hobbit.pdf
  185 	$(VIEWPDF) $<
  186 install-pdf: scm.pdf Xlibscm.pdf hobbit.pdf
  187 	$(INSTALL_DATA) $< Xlibscm.pdf hobbit.pdf $(DESTDIR)$(pdfdir)
  188 
  189 scm_toc.html: $(texifiles)
  190 	$(TEXI2HTML) $<
  191 $(DESTDIR)$(htmldir)scm_toc.html: scm_toc.html installdirs
  192 	-rm -f scm_stoc.html
  193 	if [ -f $(prevdocsdir)scm_toc.html ]; \
  194 	  then hitch $(prevdocsdir)scm_\*.html scm_\*.html \
  195 		$(DESTDIR)$(htmldir); \
  196 	  else $(INSTALL_DATA) scm_*.html $(DESTDIR)$(htmldir); fi
  197 
  198 Xlibscm_toc.html:  Xlibscm.texi version.txi
  199 	$(TEXI2HTML) $<
  200 $(DESTDIR)$(htmldir)Xlibscm_toc.html: Xlibscm_toc.html installdirs
  201 	-rm -f Xlibscm_stoc.html
  202 	chpat '</HEAD>' '<LINK REL="icon" HREF="Logo/SCM.ico">\
  203 <LINK REL="shortcut icon" HREF="Logo/SCM.ico">\
  204 </HEAD>' Xlibscm_*.html
  205 	$(INSTALL_DATA) Xlibscm_*.html $(DESTDIR)$(htmldir)
  206 
  207 hobbit_toc.html: hobbit.texi version.txi
  208 	$(TEXI2HTML) $<
  209 $(DESTDIR)$(htmldir)hobbit_toc.html: hobbit_toc.html installdirs
  210 	-rm -f hobbit_stoc.html
  211 	chpat '</HEAD>' '<LINK REL="icon" HREF="Logo/SCM.ico">\
  212 <LINK REL="shortcut icon" HREF="Logo/SCM.ico">\
  213 </HEAD>' hobbit_*.html
  214 	$(INSTALL_DATA) hobbit_*.html $(DESTDIR)$(htmldir)
  215 
  216 # html: scm_toc.html Xlibscm_toc.html hobbit_toc.html
  217 
  218 # install-html: $(DESTDIR)$(htmldir)scm_toc.html \
  219 # 	$(DESTDIR)$(htmldir)Xlibscm_toc.html \
  220 # 	$(DESTDIR)$(htmldir)hobbit_toc.html
  221 
  222 html/scm: $(texifiles)
  223 	mkdir -p html
  224 	rm -rf html/scm
  225 	$(MAKEINFO) --html $< -o html/scm
  226 	if type icoize>/dev/null; then icoize ../Logo/SCM.ico html/scm/*.html; fi
  227 $(DESTDIR)$(htmldir)scm: html/scm
  228 	-rm -rf $(DESTDIR)$(htmldir)scm
  229 	mkdir -p $(DESTDIR)$(htmldir)scm
  230 	$(INSTALL_DATA) html/scm/*.html $(DESTDIR)$(htmldir)scm
  231 
  232 html/Xlibscm: Xlibscm.texi version.txi
  233 	mkdir -p html
  234 	rm -rf html/Xlibscm
  235 	$(MAKEINFO) --html $< -o html/Xlibscm
  236 	if type icoize>/dev/null; then icoize ../Logo/SCM.ico html/Xlibscm/*.html; fi
  237 $(DESTDIR)$(htmldir)Xlibscm: html/Xlibscm
  238 	-rm -rf $(DESTDIR)$(htmldir)Xlibscm
  239 	mkdir -p $(DESTDIR)$(htmldir)Xlibscm
  240 	$(INSTALL_DATA) html/Xlibscm/*.html $(DESTDIR)$(htmldir)Xlibscm
  241 
  242 html/hobbit: hobbit.texi version.txi
  243 	mkdir -p html
  244 	rm -rf html/hobbit
  245 	$(MAKEINFO) --html $< -o html/hobbit
  246 	if type icoize>/dev/null; then icoize ../Logo/SCM.ico html/hobbit/*.html; fi
  247 $(DESTDIR)$(htmldir)hobbit: html/hobbit
  248 	-rm -rf $(DESTDIR)$(htmldir)hobbit
  249 	mkdir -p $(DESTDIR)$(htmldir)hobbit
  250 	$(INSTALL_DATA) html/hobbit/*.html $(DESTDIR)$(htmldir)hobbit
  251 
  252 html: html/scm html/Xlibscm html/hobbit
  253 
  254 install-html: $(DESTDIR)$(htmldir)scm \
  255 	$(DESTDIR)$(htmldir)Xlibscm \
  256 	$(DESTDIR)$(htmldir)hobbit
  257 
  258 
  259 scm-$(VERSION).info: $(texifiles)
  260 	$(MAKEINFO) $< --no-split -o $@
  261 scm.info: scm-$(VERSION).info
  262 	if [ -f $(prevdocsdir)scm.info ]; \
  263 	  then infobar $(prevdocsdir)scm.info $< $@; \
  264 	  else cp $< $@; fi
  265 $(DESTDIR)$(infodir)scm.info: scm.info installdirs
  266 	$(INSTALL_DATA) -p $< $@
  267 	-rm -f $(DESTDIR)$(infodir)scm.info.gz
  268 	$(POST_INSTALL)    # Post-install commands follow.
  269 	-$(INSTALL_INFO) $@ $(DESTDIR)$(infodir)dir
  270 
  271 Xlibscm.info: Xlibscm.texi version.txi
  272 	$(MAKEINFO) $< --no-split -o $@
  273 $(DESTDIR)$(infodir)Xlibscm.info: Xlibscm.info installdirs
  274 	$(INSTALL_DATA) $< $@
  275 	-rm -f $(DESTDIR)$(infodir)Xlibscm.info*.gz
  276 	$(POST_INSTALL)    # Post-install commands follow.
  277 	-$(INSTALL_INFO) $@ $(DESTDIR)$(infodir)dir
  278 
  279 hobbit.info: hobbit.texi version.txi
  280 	$(MAKEINFO) $< --no-split -o hobbit.info
  281 $(DESTDIR)$(infodir)hobbit.info: hobbit.info installdirs
  282 	$(INSTALL_DATA) $< $@
  283 	-rm -f $(DESTDIR)$(infodir)hobbit.info*.gz
  284 	$(POST_INSTALL)    # Post-install commands follow.
  285 	-$(INSTALL_INFO) $@ $(DESTDIR)$(infodir)dir
  286 
  287 install-info: $(DESTDIR)$(infodir)scm.info \
  288 	  $(DESTDIR)$(infodir)Xlibscm.info \
  289 	  $(DESTDIR)$(infodir)hobbit.info
  290 info:	install-info
  291 
  292 $(DESTDIR)$(infodir)scm.info.gz: $(DESTDIR)$(infodir)scm.info
  293 	gzip -f $<
  294 $(DESTDIR)$(infodir)Xlibscm.info.gz: $(DESTDIR)$(infodir)Xlibscm.info
  295 	gzip -f $<
  296 $(DESTDIR)$(infodir)hobbit.info.gz: $(DESTDIR)$(infodir)hobbit.info
  297 	gzip -f $<
  298 install-infoz: $(DESTDIR)$(infodir)scm.info.gz \
  299 	  $(DESTDIR)$(infodir)Xlibscm.info.gz \
  300 	  $(DESTDIR)$(infodir)hobbit.info.gz
  301 infoz:	install-infoz
  302 
  303 scm.doc: scm.1
  304 	nroff -man $< | ul -tunknown >$@
  305 
  306 # configure.usage: configure
  307 # 	$(srcdir)configure --help >$@ 2>&1
  308 
  309 README:	build build.scm scm.info
  310 	$(SCMEXE) -l build -e"(make-readme)"
  311 
  312 docs: README scm.doc install-html install-pdf install-dvi install-infoz
  313 
  314 prevdocs: $(prevdocsdir)scm_toc.html $(prevdocsdir)scm.info
  315 $(prevdocsdir)scm_toc.html:
  316 $(prevdocsdir)scm.info:
  317 	cd $(prevdocsdir); unzip -a $(distdir)scm*.zip
  318 	rm -f $(prevdocsdir)scm/scm.info
  319 	cd $(prevdocsdir)scm; $(MAKE) scm.info; $(MAKE) scm_toc.html
  320 	cd $(prevdocsdir); mv -f scm/scm.info scm/*.html ./
  321 	rm -rf $(prevdocsdir)scm
  322 	-rm -f scm-$(VERSION).info
  323 
  324 alld5: udscm5.opt scmlit
  325 	if grep -ie dynamic-linking udscm5.opt>/dev/null && ! $(MAKE) dlls; \
  326 	then \
  327 	  if sed "s/dynamic-linking//g" < udscm5.opt > tmp.opt; then \
  328 	  mv -f tmp.opt udscm5.opt; fi; \
  329 	  if sed "s/dynamic-linking//g" < scm5.opt > tmp.opt; then \
  330 	  mv -f tmp.opt scm5.opt; fi \
  331 	fi
  332 	if ! $(MAKE) dscm5; then $(MAKE) scm5; fi
  333 
  334 all5: scm5.opt scmlit
  335 	if grep -ie dynamic-linking scm5.opt>/dev/null && ! $(MAKE) dlls; \
  336 	then \
  337 	  if sed "s/dynamic-linking//g" < scm5.opt > tmp.opt; then \
  338 	  mv -f tmp.opt scm5.opt; fi \
  339 	fi
  340 	$(MAKE) scm5; fi
  341 
  342 all:
  343 	if [ -f udscm5.opt -o ! -f scm5.opt ]; then $(MAKE) alld5; \
  344 	else $(MAKE) all5; fi
  345 
  346 #	$(MAKE) wbscm.so
  347 
  348 require.scm:
  349 	cp -p requires.scm require.scm
  350 
  351 # SCMLIT -- Make this first!
  352 scmlit:	$(ofiles) scmmain.o require.scm Makefile
  353 	$(LD) -o scmlit $(ofiles) scmmain.o $(LIBS)
  354 	$(MAKE) checklit
  355 scmflags.h:	scmflags
  356 scmflags:
  357 	echo "#ifndef IMPLINIT" > newflags.h
  358 	echo "#define IMPLINIT \"$(IMPLINIT)\"" >> newflags.h
  359 	echo "#endif" >> newflags.h
  360 	echo "#define CHEAP_CONTINUATIONS" >> newflags.h
  361 	echo "#define CAUTIOUS" >> newflags.h
  362 	-if (cmp -s newflags.h scmflags.h) then rm newflags.h; \
  363 		 else mv newflags.h scmflags.h; fi
  364 .c.o:
  365 	$(CC) -c $(CFLAGS) $< -o $@
  366 scm.o:	scm.c scm.h scmfig.h scmflags.h patchlvl.h
  367 scmmain.o:	scmmain.c scm.h scmfig.h scmflags.h patchlvl.h
  368 scl.o:	scl.c scm.h scmfig.h scmflags.h
  369 eval.o:	eval.c scm.h scmfig.h scmflags.h setjump.h
  370 debug.o: debug.c scm.h scmfig.h scmflags.h setjump.h
  371 unif.o:	unif.c scm.h scmfig.h scmflags.h
  372 #ramap.o:	ramap.c scm.h scmfig.h scmflags.h
  373 repl.o:	repl.c scm.h scmfig.h scmflags.h setjump.h
  374 sys.o:	sys.c scm.h scmfig.h scmflags.h setjump.h
  375 time.o:	time.c scm.h scmfig.h scmflags.h
  376 subr.o:	subr.c scm.h scmfig.h scmflags.h
  377 rope.o:	rope.c scm.h scmfig.h scmflags.h
  378 continue.o: continue.c continue.h setjump.h scm.h scmfig.h scmflags.h
  379 continue-ia64.o: continue-ia64.S get-contoffset-ia64.c
  380 	gcc -o get-contoffset-ia64 get-contoffset-ia64.c
  381 	./get-contoffset-ia64 contoffset-ia64.S
  382 	gcc -c -o continue-ia64.o continue-ia64.S
  383 
  384 # Simple build with bignums for running JACAL
  385 scm:	scmlit
  386 	$(BUILD) -s $(IMPLPATH) -F cautious bignums arrays # i/o-extensions
  387 	$(MAKE) check
  388 
  389 # R4RS interpreter (not dumpable)
  390 scm4.opt:
  391 	echo "-F cautious bignums arrays inexact" >> scm4.opt
  392 	echo "-F engineering-notation dynamic-linking" >> scm4.opt
  393 #	if type gcc; then echo "--compiler-options=\"-fno-guess-branch-probability\"" >> scm4.opt; fi
  394 scm4:	$(cfiles) $(hfiles) build.scm build scm4.opt
  395 	$(BUILD) -f scm4.opt -o scm -s $(IMPLPATH)
  396 	-rm $(ofiles) scmmain.o
  397 	$(MAKE) check
  398 
  399 # R5RS interpreter (not dumpable)
  400 scm5.opt:
  401 	echo "-F cautious bignums arrays inexact" >> scm5.opt
  402 	echo "-F engineering-notation dynamic-linking" >> scm5.opt
  403 	echo "-F macro" >> scm5.opt
  404 #	if type gcc; then echo "--compiler-options=\"-fno-guess-branch-probability\"" >> scm5.opt; fi
  405 scm5:	$(cfiles) $(hfiles) build.scm build scm5.opt
  406 	$(BUILD) -f scm5.opt -o scm -s $(IMPLPATH)
  407 	-rm $(ofiles) scmmain.o
  408 	$(MAKE) checkmacro
  409 
  410 # http://www.opensubscriber.com/message/emacs-devel@gnu.org/1007118.html
  411 # Kernels later than 2.6.11 must do (as root) before dumping:
  412 #echo 0 > /proc/sys/kernel/randomize_va_space
  413 
  414 # dumpable R4RS interpreter
  415 udscm4.opt:
  416 	$(MAKE) scm4.opt
  417 	cat scm4.opt > udscm4.opt
  418 	echo "-F dump" >> udscm4.opt
  419 #	if type gcc; then echo "--compiler-options=\"-fno-guess-branch-probability\"" >> udscm4.opt; fi
  420 udscm4:	$(cfiles) $(hfiles) build.scm build udscm4.opt
  421 	$(BUILD) -f udscm4.opt -o udscm4 -s $(IMPLPATH)
  422 	-rm $(ofiles) scmmain.o
  423 	strip udscm4
  424 dscm4:	udscm4 $(ifiles) require.scm
  425 	if [ -f /proc/sys/kernel/randomize_va_space -a\
  426 	     "`cat /proc/sys/kernel/randomize_va_space`" != "0" ]; then {\
  427 	   cat /proc/sys/kernel/randomize_va_space > randomize_va_space.tmp;\
  428 	   echo 0 > /proc/sys/kernel/randomize_va_space;\
  429 	} fi
  430 	-rm -f slibcat implcat scm~
  431 	-mv scm scm~
  432 	echo "(quit)" | $(SETARCH) ./udscm4 -no-init-file -o scm
  433 	if [ -f randomize_va_space.tmp ]; then {\
  434 	   cat randomize_va_space.tmp > /proc/sys/kernel/randomize_va_space;\
  435 	   rm randomize_va_space.tmp;\
  436 	} fi
  437 
  438 # dumpable R5RS interpreter
  439 udscm5.opt:
  440 	$(MAKE) scm5.opt
  441 	cat scm5.opt > udscm5.opt
  442 	echo "-F dump" >> udscm5.opt
  443 udscm5:	$(cfiles) $(ufiles) $(hfiles) build.scm build udscm5.opt
  444 	$(BUILD) -f udscm5.opt -o udscm5 -s $(IMPLPATH)
  445 	-rm $(ofiles) scmmain.o
  446 	strip udscm5
  447 dscm5:	udscm5 $(ifiles) require.scm
  448 	if [ -f /proc/sys/kernel/randomize_va_space -a\
  449 	     "`cat /proc/sys/kernel/randomize_va_space`" != "0" ]; then {\
  450 	   cat /proc/sys/kernel/randomize_va_space > randomize_va_space.tmp;\
  451 	   echo 0 > /proc/sys/kernel/randomize_va_space;\
  452 	} fi
  453 	-rm -f slibcat implcat scm~
  454 	-mv scm scm~
  455 	echo "(quit)" | $(SETARCH) ./udscm5 -no-init-file -r5 -o scm
  456 	if [ -f randomize_va_space.tmp ]; then {\
  457 	   cat randomize_va_space.tmp > /proc/sys/kernel/randomize_va_space;\
  458 	   rm randomize_va_space.tmp;\
  459 	} fi
  460 	$(MAKE) checkmacro
  461 
  462 # R5RS interpreter for debugging with GDB.
  463 gdb.opt: udscm5.opt
  464 	cat udscm5.opt > gdb.opt
  465 	echo "-F debug" >> gdb.opt
  466 	echo "--compiler-options=-Wall" >> gdb.opt
  467 	echo "--linker-options=-Wall" >> gdb.opt
  468 	echo "-D NO_ENV_CACHE" >> gdb.opt
  469 #	echo "-DTEST_FARLOC -DTEST_SCM2PTR" >> gdb.opt
  470 udgdbscm: gdb.opt $(cfiles) $(ufiles) $(hfiles) build.scm build
  471 	$(BUILD) -f gdb.opt -o udgdbscm -s $(IMPLPATH)
  472 gdbscm: udgdbscm $(ifiles) require.scm
  473 	echo "(quit)" | $(SETARCH) ./udgdbscm -no-init-file -r5 -o gdbscm
  474 
  475 # R4RS interpreter for profiling
  476 pg.opt: udscm4.opt
  477 	cat udscm4.opt >> pg.opt
  478 	echo "--compiler-options=-pg" >> pg.opt
  479 	echo "--linker-options=-pg" >> pg.opt
  480 	echo "-DLACK_SETITIMER" >> pg.opt
  481 udpgscm: pg.opt
  482 	$(BUILD) -f pg.opt -o udpgscm -s $(IMPLPATH)
  483 pgscm:  udpgscm
  484 	echo "(quit)" | $(SETARCH) ./udpgscm -no-init-file -o pgscm
  485 
  486 # R4RS SCM library
  487 libscm.opt:
  488 	echo "-F cautious bignums arrays inexact" >> libscm.opt
  489 	echo "-F engineering-notation" >> libscm.opt
  490 	echo "-F dynamic-linking" >> libscm.opt
  491 libscm.a:	libscm.opt scm.h scmfig.h
  492 	$(BUILD) -t lib -f libscm.opt
  493 libtest:	libscm.a libtest.c
  494 	$(LD) -o libtest libtest.c libscm.a -ldl -lm -lc
  495 	./libtest
  496 
  497 # DLLs for dynamic linking
  498 dlls.opt:
  499 	echo "--compiler-options=-Wall" >> dlls.opt
  500 	echo "--linker-options=-Wall" >> dlls.opt
  501 dlls:	dlls.opt
  502 	$(BUILD) -t dll -f dlls.opt -F rev2-procedures	#-c sc2.c
  503 	$(BUILD) -t dll -f dlls.opt -F byte	      	#-c byte.c
  504 	$(BUILD) -t dll -f dlls.opt -F array-for-each 	#-c ramap.c
  505 	$(BUILD) -t dll -f dlls.opt -F differ	      	#-c differ.c
  506 	$(BUILD) -t dll -f dlls.opt -F generalized-c-arguments	#-c gsubr.c
  507 	$(BUILD) -t dll -f dlls.opt -F record		#-c record.c
  508 	-$(BUILD) -t dll -f dlls.opt -F byte-number inexact bignums
  509 	-$(BUILD) -t dll -f dlls.opt -F i/o-extensions	#-c ioext.c
  510 	-$(BUILD) -t dll -f dlls.opt -F posix		#-c posix.c
  511 	-$(BUILD) -t dll -f dlls.opt -F socket		#-c socket.c
  512 	-$(BUILD) -t dll -f dlls.opt -F unix		#-c unix.c
  513 	-$(BUILD) -t dll -f dlls.opt -F regex		#-c rgx.c
  514 	-$(BUILD) -t dll -f dlls.opt -F edit-line
  515 	-$(MAKE) x.so
  516 
  517 #	-$(MAKE) turtlegr.so
  518 #	-$(BUILD) -t dll -f dlls.opt -F curses		#-c crs.c
  519 mydlls: dlls			# legacy
  520 
  521 rwb-isam.scm wbtab.scm: ../wb/rwb-isam.scm ../wb/wbtab.scm
  522 	-cp -f ../wb/rwb-isam.scm ../wb/wbtab.scm ./
  523 wbscm.so: dlls.opt build.scm scm.h scmfig.h ../wb/c/*.c $(wbfiles)
  524 	$(MAKE) $(SCMLIT)
  525 	$(BUILD) -t dll -f dlls.opt -F wb
  526 	$(SCMLIT) -lmkimpcat.scm
  527 
  528 turtlegr.so: dlls.opt scm.h scmfig.h
  529 	$(BUILD) -t dll -f dlls.opt -F turtlegr
  530 
  531 x.so:	x.c x.h xevent.h dlls.opt scm.h scmfig.h
  532 	$(BUILD) -t dll -f dlls.opt -F x
  533 # Generate x11 include and Scheme files
  534 x11.scm:	inc2scm Makefile
  535 	rm -f x11.scm
  536 	$(SCMLIT) -l inc2scm x11.scm x: $(x11incdir) \
  537 	 X11/X.h X11/cursorfont.h X11/Xlib.h X11/Xutil.h
  538 keysymdef.scm:	inc2scm Makefile
  539 	rm -f keysymdef.scm
  540 	$(SCMLIT) -l inc2scm keysymdef.scm x: $(x11incdir) \
  541 	 X11/keysym.h X11/keysymdef.h
  542 xevent.h xevent.scm xatoms.scm:	xgen.scm Makefile
  543 	$(SCMLIT) -l xgen.scm $(x11incdir)X11/Xlib.h
  544 # x.h:	x.c xevent.h
  545 # 	if [ -x "$(CPROTO)" ]; then $(CPROTO) x.c > x.h; fi
  546 
  547 # **************** Tests and Performance ****************
  548 # Check SCMLIT; SCM
  549 Checklit: require.scm
  550 	$(SCMLIT) --no-symbol-case-fold -fr4rstest.scm -e'(test-sc4)(test-delay)(gc)' \
  551 	-e '(or (null? errs) (quit 1))' < /dev/null
  552 checklit: require.scm
  553 	$(SCMLIT) -fr4rstest.scm -e'(test-sc4)(test-delay)(gc)' \
  554 	-e '(or (null? errs) (quit 1))' < /dev/null
  555 Check:	r4rstest.scm require.scm
  556 	$(SCMEXE) --no-symbol-case-fold -fr4rstest.scm -e'(test-sc4)(test-cont)(test-delay)(gc)' \
  557 	-e '(or (null? errs) (quit 1))' < /dev/null
  558 check:	r4rstest.scm require.scm
  559 	$(SCMEXE) -fr4rstest.scm -e'(test-sc4)(test-cont)(test-delay)(gc)' \
  560 	-e '(or (null? errs) (quit 1))' < /dev/null
  561 checkmacro: syntest1.scm syntest2.scm r4rstest.scm
  562 	$(SCMEXE) -rmacro -fsyntest1.scm -fsyntest2.scm \
  563 	 -fr4rstest.scm -e'(test-sc4)(test-cont)(test-delay)' -fsyntest1 \
  564 	-e '(or (null? errs) (quit 1))' < /dev/null
  565 
  566 # Measuare running speed of SCM; SCMLIT.  Results are appended to file
  567 # "BenchLog"
  568 bench:
  569 	echo `whoami`@`hostname` testing scm \
  570 	 `$(SCMEXE) -e'(display *scm-version*)'` >> BenchLog
  571 	echo  on `date` >> BenchLog
  572 	ls -l scm >> BenchLog
  573 	size scm >> BenchLog
  574 	uname -a >> BenchLog
  575 	$(SCMEXE) -lbench.scm
  576 	-cat prng.log >> BenchLog
  577 	echo >> BenchLog
  578 	-cat pi.log >> BenchLog
  579 	echo >> BenchLog
  580 	echo
  581 	tail -20 BenchLog
  582 	-rm -f pi.log prng.log
  583 benchlit:
  584 	echo `whoami`@`hostname` testing scmlit \
  585 	 `$(SCMLIT) -e'(display *scm-version*)'` >> BenchLog
  586 	echo  on `date` >> BenchLog
  587 	ls -l scmlit >> BenchLog
  588 	size scmlit >> BenchLog
  589 	uname -a >> BenchLog
  590 	$(SCMLIT) -lbench.scm
  591 	-cat prng.log >> BenchLog
  592 	echo >> BenchLog
  593 	-cat pi.log >> BenchLog
  594 	echo >> BenchLog
  595 	echo
  596 	tail -20 BenchLog
  597 	-rm -f pi.log prng.log
  598 report:
  599 	$(SCMLIT) -e"(slib:report #t)"
  600 	$(SCMEXE) -e"(slib:report #t)"
  601 
  602 ################ INSTALL DEFINITIONS ################
  603 
  604 install-man: scm.1 installdirs
  605 	-$(INSTALL_DATA) $< $(DESTDIR)$(mandir)man1/
  606 
  607 install-lib: $(lsdfiles) installdirs
  608 	$(INSTALL_DATA) $(lsdfiles) $(DESTDIR)$(libscmdir)
  609 	$(INSTALL_PROGRAM) build $(DESTDIR)$(libscmdir)
  610 	if [ -f x.so ]; \
  611 		then $(INSTALL_DATA) $(xafiles) $(DESTDIR)$(libscmdir); fi
  612 	if [ -f byte.so ]; \
  613 	 	then $(INSTALL_DATA) *.so $(DESTDIR)$(libscmdir); fi
  614 	if [ -f wbscm.so ]; \
  615 		then $(INSTALL_DATA) $(wbfiles) $(DESTDIR)$(libscmdir); fi
  616 #	test -f $(DESTDIR)$(libscmdir)require.scm || \ what was this doing?
  617 		$(INSTALL_DATA) requires.scm $(DESTDIR)$(libscmdir)require.scm
  618 	if [ -f libscm.a ]; \
  619 		then $(INSTALL_DATA) libscm.a $(DESTDIR)$(libdir)libscm.a; fi
  620 
  621 install: install-man install-lib install-infoz installdirs
  622 	$(INSTALL_PROGRAM) scm scmlit $(DESTDIR)$(bindir)
  623 	-strip $(DESTDIR)$(bindir)scmlit
  624 	$(INSTALL_DATA) scm.h scmfig.h scmflags.h $(DESTDIR)$(includedir)
  625 #	$(DESTDIR)$(bindir)scm -br new-catalog
  626 
  627 uninstall:
  628 	$(PRE_UNINSTALL)     # Pre-uninstall commands follow.
  629 	-$(INSTALL_INFO) --delete $(DESTDIR)$(infodir)scm.info $(DESTDIR)$(infodir)dir
  630 	-$(INSTALL_INFO) --delete $(DESTDIR)$(infodir)Xlibscm.info $(DESTDIR)$(infodir)dir
  631 	-$(INSTALL_INFO) --delete $(DESTDIR)$(infodir)hobbit.info $(DESTDIR)$(infodir)dir
  632 	$(NORMAL_UNINSTALL)  # Normal commands follow.
  633 	-rm $(DESTDIR)$(bindir)scm $(DESTDIR)$(bindir)scmlit
  634 	-rm $(DESTDIR)$(mandir)man1/scm.1
  635 	-rm $(DESTDIR)$(includedir)scm.h \
  636 	    $(DESTDIR)$(includedir)scmfig.h \
  637 	    $(DESTDIR)$(includedir)scmflags.h
  638 	-rm $(DESTDIR)$(libdir)libscm.a
  639 	-(cd $(DESTDIR)$(libscmdir); \
  640 	  rm $(lsdfiles) build $(xafiles) *.so require.scm \
  641 	     $(wbfiles) $(catfiles))
  642 	-rm $(DESTDIR)$(infodir)scm.info.gz \
  643 	    $(DESTDIR)$(infodir)Xlibscm.info.gz \
  644 	    $(DESTDIR)$(infodir)hobbit.info.gz
  645 	$(POST_UNINSTALL)     # Post-uninstall commands follow.
  646 	-rmdir $(DESTDIR)$(libscmdir)
  647 
  648 ################ WINDOWS INSTALLER DEFINITIONS ################
  649 
  650 winscm5.opt:
  651 	echo "-F arrays array-for-each byte i/o-extensions" >> winscm5.opt
  652 	echo "-F bignums inexact engineering-notation" >> winscm5.opt
  653 	echo "-F cautious rev2-procedures macro" >> winscm5.opt
  654 	echo "-F wb-no-threads" >> winscm5.opt
  655 gw32scmwb.sh:	scmlit winscm5.opt build.scm Makefile version.txi
  656 	./build -p gnu-win32 -f winscm5.opt -w gw32scmwb.sh
  657 scm.exe:	gw32scmwb.sh
  658 	./gw32scmwb.sh
  659 
  660 hobbit.html: hobbit.texi
  661 	$(MAKEINFO) --html --no-split hobbit.texi
  662 scm.html: $(texifiles)
  663 	$(MAKEINFO) --html --no-split scm.texi
  664 
  665 ## to build a windows installer
  666 ## make sure makeinfo and NSIS are available on the commandline
  667 w32install:	scm.exe hobbit.html scm.html
  668 	makensis scm.nsi
  669 
  670 #### Stuff for maintaining SCM below ####
  671 
  672 ver = $(VERSION)
  673 
  674 temp/scm:	$(afiles)
  675 	-rm -rf temp
  676 	mkdir -p temp/scm
  677 	ln $(afiles) temp/scm
  678 
  679 release:	dist pdf	# rpm
  680 	cvs tag -F scm-$(VERSION)
  681 	$(INSTALL_DATA) ANNOUNCE $(htmldir)SCM_ANNOUNCE.txt
  682 	$(RSYNC) $(htmldir)SCM.html $(htmldir)SCM_ANNOUNCE.txt	\
  683 	 $(htmldir)hobbit.pdf $(htmldir)Xlibscm.pdf		\
  684 	 $(Uploadee):public_html/
  685 	$(RSYNC) $(distdir)README $(distdir)scm-$(VERSION).zip		\
  686 	 $(distdir)scm-$(VERSION)-$(RELEASE).*.rpm $(Uploadee):dist/
  687 # upload $(distdir)README $(distdir)scm-$(VERSION).zip ftp.gnu.org:gnu/jacal/
  688 #	 $(distdir)scm-$(VERSION)-$(RELEASE).x86_64.rpm
  689 
  690 upzip:	$(snapdir)scm.zip
  691 	$(RSYNC) $(snapdir)scm.zip $(Uploadee):pub/
  692 	$(RSYNC) r4rstest.scm $(HOME)/dist/
  693 	$(RSYNC) r4rstest.scm $(Uploadee):dist/
  694 
  695 dist:	$(distdir)scm-$(VERSION).zip
  696 $(distdir)scm-$(VERSION).zip:	temp/scm
  697 	$(MAKEDEV) DEST=$(distdir) PROD=scm ver=-$(VERSION) zip
  698 
  699 upgnu:	$(distdir)scm-$(VERSION).tar.gz
  700 	cd $(distdir); gnupload --to ftp.gnu.org:scm scm-$(VERSION).tar.gz
  701 tar.gz:	$(distdir)scm-$(VERSION).tar.gz
  702 $(distdir)scm-$(VERSION).tar.gz:	temp/scm/
  703 	$(MAKEDEV) DEST=$(distdir) PROD=scm ver=-$(VERSION) tar.gz
  704 
  705 rpm:	pubzip
  706 	cp -f $(snapdir)scm.zip $(rpm_prefix)SOURCES/scm-$(VERSION).zip
  707 	rpmbuild -ba scm.spec	# --clean --target i386
  708 	rm $(rpm_prefix)SOURCES/scm-$(VERSION).zip
  709 	mv $(rpm_prefix)RPMS/*/scm-$(VERSION)-$(RELEASE).*.rpm	\
  710 	   $(rpm_prefix)SRPMS/scm-$(VERSION)-$(RELEASE).src.rpm	\
  711 	   $(distdir)
  712 
  713 shar:	scm.shar
  714 scm.shar:	temp/scm
  715 	$(MAKEDEV) PROD=scm shar
  716 dclshar:	scm.com
  717 com:	scm.com
  718 scm.com:	temp/scm
  719 	$(MAKEDEV) PROD=scm com
  720 zip:	scm.zip
  721 scm.zip:	temp/scm
  722 	$(MAKEDEV) PROD=scm zip
  723 doszip:	$(windistdir)scm-$(VERSION).zip
  724 $(windistdir)scm-$(VERSION).zip: temp/scm $(turfiles) SCM.ico scm.html hobbit.html
  725 	cp -f ../wb/wbtab.scm ../wb/rwb-isam.scm temp/scm/
  726 	$(MAKEDEV) DEST=$(windistdir) PROD=scm ver=-$(VERSION) zip
  727 	-cd ..; zip -9ur $(windistdir)scm-$(VERSION).zip \
  728 		scm/turtle scm/turtlegr.c scm/grtest.scm \
  729 		scm/SCM.ico \
  730 		scm/scm.html scm/hobbit.html
  731 	zip -d $(windistdir)scm-$(VERSION).zip scm/scm.info scm/Xlibscm.info scm/hobbit.info
  732 pubzip:	$(snapdir)scm.zip
  733 $(snapdir)scm.zip:	temp/scm
  734 	$(MAKEDEV) DEST=$(snapdir) PROD=scm zip
  735 
  736 diffs:	pubdiffs
  737 pubdiffs:	temp/scm
  738 	$(MAKEDEV) DEST=$(snapdir) PROD=scm pubdiffs
  739 distdiffs:	temp/scm
  740 	$(MAKEDEV) DEST=$(distdir) PROD=scm ver=$(ver) distdiffs
  741 
  742 CITERS = ANNOUNCE hobbit.texi hobbit.scm \
  743 	../jacal/ANNOUNCE ../jacal/jacal.texi \
  744 	../wb/ANNOUNCE ../wb/README ../wb/wb.texi \
  745 	../synch/ANNOUNCE \
  746 	$(distdir)README \
  747 	$(windistdir)unzipall.bat $(windistdir)buildall \
  748 	$(htmldir)JACAL.html $(htmldir)README.html \
  749 	$(htmldir)SIMSYNCH.html $(htmldir)SLIB.html \
  750 	$(htmldir)FreeSnell/ANNOUNCE $(htmldir)FreeSnell/index.html
  751 CITES = scm.spec scm.nsi ../wb/wb.spec $(htmldir)SCM.html
  752 
  753 updates:	Init$(ver).scm
  754 	$(CHPAT) scm-$(VERSION) scm-$(ver) $(CITERS)
  755 	$(CHPAT) $(VERSION) $(ver) $(CITES)
  756 	$(MAKE) README
  757 
  758 Init$(ver).scm:
  759 	mv -f Init$(VERSION).scm Init$(ver).scm
  760 	$(CHPAT) $(VERSION) $(ver) patchlvl.h Init$(ver).scm
  761 
  762 new:	updates
  763 	echo @set SCMVERSION $(ver) > version.txi
  764 	echo @set SCMDATE `date +"%B %Y"` >> version.txi
  765 	echo `date -I` \ Aubrey Jaffer \ \<`whoami`@`hostname`\>> change
  766 	echo>> change
  767 	echo \	\* patchlvl.h \(SCMVERSION\): Bumped from $(VERSION) to $(ver).>>change
  768 	echo>> change
  769 	cat ChangeLog >> change
  770 	mv -f change ChangeLog
  771 	cvs remove Init$(VERSION).scm
  772 	cvs add Init$(ver).scm
  773 	cvs commit -m 'Init$(VERSION).scm changed to Init$(ver).scm' \
  774 		Init$(VERSION).scm Init$(ver).scm
  775 	cvs commit -m '(SCMVERSION): Bumped from $(VERSION) to $(ver).'
  776 	cvs tag -F scm-$(ver)
  777 
  778 lint:	lints
  779 lints:	$(cfiles) $(hfiles)
  780 	lint $(CPPFLAGS) $(ALL_CFLAGS) $(cfiles) | tee lints
  781 #	lint $(CPPFLAGS) $(ALL_CFLAGS) $(cfiles) | tee lintes
  782 
  783 #seds to help find names not unique in first 8 characters (name8s)
  784 # for BSD nm format
  785 SED_TO_STRIP_NM=sed -e '/.*\.o$$/d' -e 's/.* _//' -e 's/.* T //'
  786 #old, bad for T [^_] on suns: SED_TO_STRIP_NM=sed -e '/.*\.o$$/d' -e 's/.* _//'
  787 # For a System V nm where plain C identifiers have _ prepended:
  788 #SED_TO_STRIP_NM=sed -e '/^_[A-Za-z][A-za-z0-9_]*[	 |].*|extern|!d' -e 's/|/ /g' -e 's/^_//'
  789 # For a System V nm where plain C identifiers have nothing prepended:
  790 #SED_TO_STRIP_NM=sed -e '/^[A-Za-z][A-za-z0-9_]*[	 |].*|extern|!d' -e 's/|/ /g'
  791 
  792 name8:	name8s
  793 name8s:	scmlit
  794 	nm scmlit |\
  795 	$(SED_TO_STRIP_NM) |\
  796 	sort -u|\
  797 	awk '{	if (substr(l,1,8)==substr($$1,1,8)) {\
  798 			if (p) print l;\
  799 			print $$1;p=0;stat=1\
  800 		}else p=1;\
  801 		l=$$1\
  802 	     }END{exit stat}' -
  803 
  804 ctags:	$(ctagfiles)
  805 	etags $(ctagfiles)
  806 
  807 TAGS:	$(tagfiles)
  808 	etags $(tagfiles)
  809 tags:	TAGS
  810 
  811 mostlyclean:
  812 clean:
  813 	-rm -f core a.out ramap.o ramap.obj $(ofiles) scmmain.o lints
  814 	-rm -rf *temp
  815 distclean:	clean
  816 	-rm -f $(EXECFILES) *.o *.obj a.out TAGS implcat slibcat gdbscm
  817 realclean:	distclean
  818 	-rm -f scm.doc scm.html hobbit.html scm.exe scmlit.exe scm~ SCM-*.exe
  819 realempty:	temp/scm
  820 	-rm -f $(afiles)
  821 myclean:	clean
  822 	-rm -f *~ *.bak *.orig *.rej tmp* \#* *\#