Makefile.in 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. # Scheme 48 Makefile
  2. # Documentation in files INSTALL and doc/install.txt
  3. SHELL = /bin/sh
  4. ### Filled in by `configure' ###
  5. srcdir = @srcdir@
  6. VPATH = @srcdir@
  7. CC = @CC@
  8. DEFS = @DEFS@
  9. LIBS = @LIBS@
  10. CFLAGS = @CFLAGS@
  11. CPPFLAGS =
  12. INSTALL = @INSTALL@
  13. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  14. INSTALL_DATA = @INSTALL_DATA@
  15. LDFLAGS = @LDFLAGS@
  16. LIBOBJS = @LIBOBJS@
  17. prefix = @prefix@
  18. exec_prefix = @exec_prefix@
  19. ### End of `configure' section###
  20. bindir = $(exec_prefix)/bin
  21. libdir = $(exec_prefix)/lib
  22. incdir = $(exec_prefix)/include
  23. manext = 1
  24. mandir = $(prefix)/man/man$(manext)
  25. # HP 9000 series, if you don't have gcc
  26. # CC = cc
  27. # CFLAGS = -Aa -O +Obb1800
  28. # DEFS = -D_HPUX_SOURCE -Dhpux
  29. # Ultrix
  30. # LDFLAGS = -N
  31. .c.o:
  32. $(CC) -c $(CPPFLAGS) $(DEFS) -I ./c -I$(srcdir)/c $(CFLAGS) -o $@ $<
  33. # You might want to change RUNNABLE to "s48"
  34. RUNNABLE = scheme48
  35. MANPAGE = $(RUNNABLE).$(manext)
  36. LIB = $(libdir)/$(RUNNABLE)
  37. distdir = /tmp
  38. # If make barfs on this include line, just comment it out. It's only
  39. # really needed if you want to build the linker or rebuild initial.image.
  40. include $(srcdir)/build/filenames.make
  41. #
  42. #NetBSD make wants to see this instead:
  43. #.include "$(srcdir)/build/filenames.make"
  44. # Static linker:
  45. #
  46. # You only need the linker if you're going to make changes to the
  47. # things that go into the initial.image, which in general means the
  48. # files in rts/. If you decide you need to use the linker, then you
  49. # gots your choice; it can run in just about any version of Scheme 48
  50. # or Pseudoscheme. (It has also been made to run in Scheme->C.) It
  51. # doesn't matter a whole lot which Scheme you use as long as it's not
  52. # broken or unavailable. The two best choices are:
  53. #
  54. # 1. As below.
  55. # These settings requires you to already have a $(RUNNABLE)
  56. # command. This is desirable if you are making changes to the
  57. # system that might break scheme48vm and/or scheme48.image. But it
  58. # requires you to have squirreled away a previous working version
  59. # of scheme48. The settings assume a pre-Unicode version; if you
  60. # want to use an installed Unicode-capable Scheme 48 (1.4 or later),
  61. # you need to use this setting:
  62. # LINKER_WRITEBYTE = ,open (subset i/o (write-byte))
  63. #
  64. # 2. LINKER_VM = ./$(VM) $(BIG_HEAP)
  65. # LINKER_RUNNABLE = $(LINKER_VM) -i $(IMAGE)
  66. # LINKER_WRITEBYTE = ,open (subset i/o (write-byte))
  67. # This builds the linker on the scheme48vm and scheme48.image
  68. # that are in the current directory.
  69. BIG_HEAP = -h 8000000
  70. LINKER_VM = $(RUNNABLE) $(BIG_HEAP)
  71. LINKER_RUNNABLE = $(LINKER_VM)
  72. LINKER_WRITEBYTE = ,load scheme/link/write-byte.scm
  73. START_LINKER = echo ',batch'; \
  74. echo ',bench on'; \
  75. echo ',open signals handle features'; \
  76. echo ',open bitwise ascii code-vectors'; \
  77. echo '$(LINKER_WRITEBYTE)'; \
  78. echo ',open cells record-types'; \
  79. echo ',load $(linker-files)'; \
  80. echo ',load scheme/alt/init-defpackage.scm'
  81. # --------------------
  82. # You shouldn't have to change anything below this point, except for possibly
  83. # the external code rules.
  84. # Targets:
  85. IMAGE = scheme48.image
  86. INITIAL = $(srcdir)/build/initial.image
  87. VM = scheme48vm
  88. UNIX_OBJS = c/unix/misc.o c/unix/io.o c/unix/fd-io.o c/unix/event.o
  89. OBJS = c/scheme48vm.o c/scheme48heap.o \
  90. c/scheme48read-image.o c/scheme48write-image.o \
  91. c/extension.o c/free.o c/double_to_string.o \
  92. c/external.o c/external-lib.o c/bignum.o c/init.o
  93. FAKEHS = c/fake/dlfcn.h c/fake/sigact.h c/fake/strerror.h \
  94. c/fake/sys-select.h
  95. # Sources:
  96. CONFIG_FILES = scheme/interfaces.scm scheme/packages.scm \
  97. scheme/vm/shared-interfaces.scm \
  98. scheme/low-packages.scm scheme/rts-packages.scm \
  99. scheme/comp-packages.scm scheme/initial-packages.scm
  100. # Rules:
  101. # The following is the first rule and therefore the "make" command's
  102. # default target.
  103. enough: vm $(IMAGE) script-interpreter go
  104. # --------------------
  105. # External code to include in the VM
  106. # After changing any of these you should delete `scheme48vm' and remake it.
  107. EXTERNAL_OBJECTS = $(POSIX_OBJECTS) $(SOCKET_OBJECTS) $(DYNLINK_OBJECTS) \
  108. $(SYSEXITS_OBJECTS) $(LOOKUP_OBJECTS) $(ASM_OBJECTS) \
  109. $(SRFI_OBJECTS)
  110. EXTERNAL_LD_FLAGS = $(POSIX_LD_FLAGS) $(SOCKET_LD_FLAGS) $(DYNLINK_LD_FLAGS) \
  111. $(SYSEXITS_LD_FLAGS)
  112. EXTERNAL_INITIALIZERS = s48_initialize_external s48_init_external_libs \
  113. $(POSIX_INITIALIZERS) $(SOCKET_INITIALIZERS) \
  114. $(DYNLINK_INITIALIZERS) \
  115. $(SYSEXITS_INITIALIZERS) \
  116. $(LOOKUP_INITIALIZERS) $(ASM_INITIALIZERS) \
  117. $(SRFI_INITIALIZERS)
  118. # Rules for any external code.
  119. # POSIX rules; this could have its own Makefile, but I don't want to bother.
  120. posix_dir = c/posix
  121. $(posix_dir)/user.o $(posix_dir)/regexp.o \
  122. $(posix_dir)/proc-env.o $(posix_dir)/io.o: \
  123. c/scheme48.h c/c-mods.h $(posix_dir)/posix.h
  124. $(posix_dir)/proc.o: \
  125. c/scheme48.h c/c-mods.h \
  126. c/event.h $(posix_dir)/posix.h $(posix_dir)/s48_signals.h
  127. $(posix_dir)/dir.o: \
  128. c/scheme48.h c/scheme48heap.h c/c-mods.h \
  129. c/event.h c/fd-io.h $(posix_dir)/posix.h
  130. POSIX_OBJECTS = $(posix_dir)/user.o $(posix_dir)/regexp.o \
  131. $(posix_dir)/proc-env.o $(posix_dir)/proc.o \
  132. $(posix_dir)/io.o $(posix_dir)/dir.o
  133. POSIX_LD_FLAGS =
  134. POSIX_INITIALIZERS = s48_init_posix_dir s48_init_posix_user \
  135. s48_init_posix_regexp s48_init_posix_proc_env \
  136. s48_init_posix_io s48_init_posix_proc
  137. # End of POSIX rules
  138. # Socket rules
  139. c/unix/socket.o: c/scheme48.h c/fd-io.h c/event.h
  140. SOCKET_OBJECTS = c/unix/socket.o
  141. SOCKET_LD_FLAGS =
  142. SOCKET_INITIALIZERS = s48_init_socket
  143. # End of socket rules
  144. # Dynamic linking rules
  145. c/unix/dynlink.o: c/scheme48.h
  146. DYNLINK_OBJECTS = c/unix/dynlink.o
  147. # configure adds -ldl or -mld to the regular libraries
  148. DYNLINK_LD_FLAGS =
  149. DYNLINK_INITIALIZERS = s48_init_dynlink
  150. # End of dynamic linking rules
  151. # Sysexits (this is for the implementation of SRFI 22)
  152. SYSEXITS_OBJECTS = c/unix/sysexits.o
  153. SYSEXITS_LD_FLAGS =
  154. SYSEXITS_INITIALIZERS = s48_init_sysexits
  155. # Lookup rules (this is just for compatibility with old code)
  156. c/unix/dynamo.o: c/scheme48.h
  157. LOOKUP_OBJECTS = c/unix/dynamo.o
  158. LOOKUP_INITIALIZERS = s48_init_external_lookup
  159. # End of lookup rules
  160. # Native-code glue rules
  161. ASM_OBJECTS = c/fake/glue.o
  162. ASM_INITIALIZERS =
  163. # Real definitions to be used when a. native code works and b. it is supported
  164. # on the machine we're compiling on
  165. #ASM_OBJECTS = c/glue.o c/asm-glue.o
  166. #ASM_INITIALIZERS = s48_init_asm_glue
  167. # End of native-code glue rules
  168. # SRFI rules
  169. SRFI_OBJECTS = c/srfi-27.o
  170. SRFI_INITIALIZERS = s48_init_srfi_27
  171. # End of SRFI rules
  172. # End of external rules
  173. # --------------------
  174. $(VM): c/main.o $(OBJS) $(UNIX_OBJS) $(LIBOBJS) $(EXTERNAL_OBJECTS)
  175. rm -f /tmp/s48_external_$$$$.c && \
  176. $(srcdir)/build/build-external-modules /tmp/s48_external_$$$$.c \
  177. $(EXTERNAL_INITIALIZERS) && \
  178. $(CC) $(LDFLAGS) $(CFLAGS) -o $@ c/main.o $(OBJS) $(UNIX_OBJS) \
  179. /tmp/s48_external_$$$$.c \
  180. $(LIBOBJS) $(LIBS) \
  181. $(EXTERNAL_OBJECTS) $(EXTERNAL_LD_FLAGS) && \
  182. rm -f /tmp/s48_external_$$$$.c
  183. script-interpreter: c/script-interpreter.o
  184. $(CC) $(LDFLAGS) $(CFLAGS) -o $@ c/script-interpreter.o
  185. c/main.o: c/main.c c/scheme48vm.h c/scheme48heap.h
  186. $(CC) -c $(CFLAGS) -o $@ \
  187. -DDEFAULT_IMAGE_NAME=\"$(LIB)/$(IMAGE)\" \
  188. $(CPPFLAGS) $(DEFS) $(srcdir)/c/main.c
  189. c/scheme48vm.o: c/prescheme.h c/scheme48vm.h c/scheme48heap.h \
  190. c/scheme48image.h c/bignum.h c/event.h \
  191. c/io.h c/fd-io.h \
  192. c/scheme48vm-prelude.h c/c-mods.h
  193. c/scheme48heap.o: c/prescheme.h c/scheme48vm.h c/scheme48heap.h \
  194. c/scheme48vm-prelude.h c/c-mods.h \
  195. c/event.h c/io.h c/fd-io.h
  196. c/scheme48read-image.o: c/prescheme.h c/scheme48vm.h c/scheme48heap.h \
  197. c/scheme48vm-prelude.h c/c-mods.h
  198. c/scheme48write-image.o: c/prescheme.h c/scheme48vm.h c/scheme48heap.h \
  199. c/scheme48vm-prelude.h c/c-mods.h
  200. c/bignum.o: c/bignum.h c/bignumint.h c/scheme48.h
  201. c/extension.o: c/sysdep.h $(FAKEHS) c/scheme48.h c/scheme48vm.h
  202. c/free.o: c/sysdep.h
  203. c/external.o: c/sysdep.h $(FAKEHS) c/scheme48.h c/c-mods.h
  204. c/external-lib.o: c/scheme48.h c/scheme48vm.h
  205. c/unix/sysexits.o: c/sysdep.h $(FAKEHS) c/scheme48.h
  206. c/unix/event.o: c/sysdep.h $(FAKEHS) c/scheme48vm.h c/scheme48heap.h \
  207. c/event.h c/fd-io.h
  208. c/unix/fd-io.o: c/sysdep.h $(FAKEHS) c/scheme48vm.h c/scheme48heap.h \
  209. c/event.h c/fd-io.h
  210. c/unix/misc.o: c/sysdep.h $(FAKEHS)
  211. c/unix/io.o: c/io.h
  212. c/script-interpreter.o: c/sysdep.h $(FAKEHS) c/script-interpreter.c
  213. $(CC) -c $(CFLAGS) -o $@ \
  214. -DRUNNABLE=\"$(bindir)/$(RUNNABLE)\" \
  215. $(CPPFLAGS) $(DEFS) \
  216. -I ./c -I$(srcdir)/c \
  217. $(srcdir)/c/script-interpreter.c
  218. c/fake/libdl1.o: c/fake/dlfcn.h
  219. c/fake/libdl2.o: c/fake/dlfcn.h
  220. c/fake/strerror.o: c/fake/strerror.h
  221. # --------------------
  222. # Make scheme48.image from initial.image and library .scm files.
  223. #
  224. # For bootstrap reasons, initial.image is *not* listed as a source,
  225. # even though it really is.
  226. $(IMAGE): $(VM) scheme/env/init-defpackage.scm scheme/more-interfaces.scm \
  227. scheme/link-packages.scm scheme/env-packages.scm \
  228. scheme/more-packages.scm \
  229. scheme/sort/interfaces.scm scheme/sort/packages.scm \
  230. scheme/cml/interfaces.scm scheme/cml/packages.scm \
  231. scheme/posix/packages.scm scheme/srfi/packages.scm \
  232. $(usual-files) build/initial.debug build/build-usual-image
  233. $(srcdir)/build/build-usual-image $(srcdir) "`(cd $(srcdir) && echo $$PWD)`/scheme" '$(IMAGE)' './$(VM)' \
  234. '$(INITIAL)'
  235. ### Fake targets: all clean install man dist
  236. install: enough dirs \
  237. inst-script inst-vm inst-misc inst-man inst-inc inst-image \
  238. inst-script-interpreters
  239. inst-vm:
  240. $(INSTALL_PROGRAM) $(VM) $(LIB)
  241. inst-image:
  242. rm -f '/tmp/$(IMAGE)' && \
  243. $(srcdir)/build/build-usual-image $(srcdir) '$(LIB)' \
  244. '/tmp/$(IMAGE)' './$(VM)' '$(INITIAL)' && \
  245. $(INSTALL_DATA) /tmp/$(IMAGE) $(LIB) && \
  246. rm /tmp/$(IMAGE)
  247. inst-man:
  248. $(srcdir)/mkinstalldirs $(mandir)
  249. sed 's=LBIN=$(bindir)=g' $(srcdir)/doc/scheme48.man | \
  250. sed 's=LLIB=$(LIB)=g' | \
  251. sed 's=LS48=$(RUNNABLE)=g' >$(MANPAGE) && \
  252. $(INSTALL_DATA) $(MANPAGE) $(mandir) && \
  253. rm $(MANPAGE); \
  254. inst-inc:
  255. $(INSTALL_DATA) $(srcdir)/c/scheme48.h $(incdir)
  256. $(INSTALL_DATA) $(srcdir)/c/scheme48write-barrier.h $(incdir)
  257. inst-misc:
  258. for stub in env big sort opt misc link posix cml srfi; do \
  259. for f in $(srcdir)/scheme/$$stub/*.scm; do \
  260. $(INSTALL_DATA) $$f $(LIB)/$$stub || exit 1; \
  261. done; \
  262. done && \
  263. for f in $(srcdir)/scheme/rts/*num.scm \
  264. $(srcdir)/scheme/rts/jar-defrecord.scm; do \
  265. $(INSTALL_DATA) $$f $(LIB)/rts || exit 1; \
  266. done
  267. inst-script:
  268. script=$(bindir)/$(RUNNABLE) && \
  269. echo '#!/bin/sh' >$$script && \
  270. echo >>$$script && \
  271. echo 'lib=$(LIB)' >>$$script && \
  272. echo 'exec $$lib/$(VM) -o $$lib/$(VM) -i $$lib/$(IMAGE) "$$@"' \
  273. >>$$script && \
  274. chmod +x $$script
  275. inst-script-interpreters:
  276. for dialect in r5rs srfi-7; do \
  277. $(INSTALL_PROGRAM) script-interpreter $(bindir)/scheme-$$dialect; \
  278. done
  279. # Script to run scheme48 in this directory.
  280. go:
  281. echo '#!/bin/sh' >$@ && \
  282. echo >>$@ && \
  283. echo "lib=\"`pwd`\"" >>$@ && \
  284. echo 'exec "$$lib"/$(VM) -o "$$lib"/$(VM) -i "$$lib"/$(IMAGE) "$$@"' \
  285. >>$@ && \
  286. chmod +x $@
  287. dirs:
  288. for dir in $(libdir) $(bindir) $(incdir); do \
  289. $(srcdir)/mkinstalldirs $$dir || exit 1; \
  290. done
  291. $(srcdir)/mkinstalldirs $(LIB)
  292. for dir in rts env big sort opt misc link posix cml srfi; do \
  293. $(srcdir)/mkinstalldirs $(LIB)/$$dir || exit 1; \
  294. done
  295. configure: configure.in
  296. autoheader && autoconf
  297. clean:
  298. -rm -f $(VM) script-interpreter \
  299. *.o c/unix/*.o c/posix/*.o c/*.o c/fake/*.o \
  300. TAGS $(IMAGE) \
  301. build/*.tmp $(MANPAGE) build/linker.image \
  302. scheme/debug/*.image scheme/debug/*.debug config.cache \
  303. scheme/vm/scheme48vm.c scheme/vm/scheme48heap.c \
  304. go $(distname)
  305. distclean: clean
  306. rm -f Makefile config.log config.status c/sysdep.h
  307. check: $(VM) $(IMAGE) scheme/debug/check.scm
  308. ( \
  309. echo ',batch'; \
  310. echo ',config ,load =scheme48/debug/test.scm'; \
  311. echo ',exec ,load =scheme48/debug/check.scm'; \
  312. echo ',exec (done)' \
  313. ) | ./$(VM) -i $(IMAGE)
  314. # --------------------
  315. # Rules from here on down are not essential for the basic installation
  316. # procedure.
  317. all: vm image script-interpreter go
  318. vm: $(VM)
  319. image: $(INITIAL)
  320. $(MAKE) $(IMAGE)
  321. test: check
  322. tags:
  323. find . -name "*.scm" -o -name "*.c" -o -name "*.h" | etags -
  324. # --------------------
  325. # Distribution...
  326. # DISTFILES should include all sources.
  327. DISTFILES = README COPYING.rtf COPYING INSTALL WINDOWS.txt \
  328. configure acconfig.h configure.in Makefile.in \
  329. scheme48.sln scheme48.vcproj \
  330. mkinstalldirs install-sh \
  331. doc/*.ps doc/*.pdf doc/*.txt \
  332. doc/html/*.html doc/html/*.css doc/html/*.gif \
  333. doc/src/*.tex doc/src/*.sty doc/src/*.scm \
  334. doc/scheme48.man \
  335. emacs/README \
  336. build/*.scm build/*-version-number build/*.exec \
  337. build/*.lisp build/build-usual-image build/filenames.make \
  338. build/initial.debug build/initial.image \
  339. build/build-external-modules \
  340. build/*.bat build/*.sh build/*.rc \
  341. build/dummy build/*.wxs \
  342. build/*.bmp build/*.ico \
  343. c/*.[ch] c/*/*.[ch] c/scheme48.h.in \
  344. emacs/*.el gdbinit \
  345. scheme/*.scm scheme/*/*.scm scheme/vm/*/*.scm \
  346. ps-compiler/minor-version-number \
  347. ps-compiler/doc/node.txt ps-compiler/doc/todo.txt \
  348. ps-compiler/*.scm ps-compiler/*/*.scm \
  349. ps-compiler/prescheme/primop/*.scm \
  350. ps-compiler/prescheme/test/*.scm \
  351. c/sysdep.h.in
  352. distname = $(RUNNABLE)-1.`cat $(srcdir)/build/minor-version-number`
  353. dist: build/initial.image c/scheme48.h
  354. distname=$(distname) && \
  355. distfile=$(distdir)/$$distname.tgz && \
  356. if [ -d $(distdir) ] && \
  357. [ -w $$distfile -o -w $(distdir) ]; then \
  358. cd $(srcdir) && \
  359. rm -f $$distname && \
  360. ln -s . $$distname && \
  361. files='' && \
  362. for i in $(DISTFILES); do \
  363. if [ "$$i" != "c/sysdep.h" ]; then \
  364. files="$$files $$distname/$$i"; \
  365. fi \
  366. done && \
  367. tar -cf - $$files | \
  368. gzip --best >$$distfile && \
  369. rm $$distname; \
  370. else \
  371. echo "Can't write $$distfile" >&2; \
  372. exit 1; \
  373. fi
  374. # Increment the minor version number
  375. inc:
  376. f=build/minor-version-number && \
  377. expr `cat $$f` + 1 >$$f.tmp && \
  378. mv $$f.tmp $$f && \
  379. cp $$f doc/src/version-number.tex && \
  380. echo '(define version-info "1.'`cat $$f`'")' \
  381. >scheme/env/version-info.scm
  382. # --------------------
  383. # Generate build/filenames.make from *packages.scm
  384. #
  385. # This hack traces the module dependencies described in the
  386. # various configuration files and converts them into dependency lists
  387. # that "make" can use for its purposes.
  388. #
  389. # Since the distribution comes with a filenames.make, this rule
  390. # shouldn't be invoked for simple installations. But it will be used
  391. # if you change any of the *-packages.scm files.
  392. #
  393. # You can actually run the forms in filenames.scm in any Scheme
  394. # implementation that has syntax-rules and explicit-renaming low-level
  395. # macros (e.g., most versions of Scheme 48 and Pseudoscheme).
  396. # If there are errors running this script, and you need to debug,
  397. # don't use the initial.image, use something that has a reasonable
  398. # environment.
  399. #
  400. # If this fails and you don't feel like debugging or fixing the problem,
  401. # try "touch filenames.make" and hope for the best.
  402. PACKAGES=scheme/packages.scm scheme/rts-packages.scm scheme/alt-packages.scm \
  403. scheme/comp-packages.scm scheme/initial-packages.scm \
  404. scheme/link-packages.scm scheme/env-packages.scm \
  405. scheme/sort/packages.scm scheme/more-packages.scm \
  406. scheme/cml/packages.scm \
  407. build/filenames.scm
  408. $(srcdir)/build/filenames.make: $(PACKAGES)
  409. # uncomment this if you activate the line below:
  410. # $(MAKE) $(VM) PACKAGES=
  411. cd $(srcdir) && \
  412. $(RUNNABLE) -a batch <build/filenames.scm
  413. # or: ./$(VM) -i $(srcdir)/$(INITIAL) -a batch <build/filenames.scm
  414. # --------------------
  415. # Static linker
  416. #
  417. # The linker is capable of rebuilding an image from sources, even
  418. # across an incompatible change in VM data representations.
  419. # Bootstrap from Lucid Common Lisp: (last tested with
  420. # Pseudoscheme 2.9 and Scheme 48 version 0.19)
  421. PSEUDODIR = ../pseudo
  422. link/linker-in-lucid: build/lucid-script.lisp $(linker-files) \
  423. scheme/alt/pseudoscheme-features.scm \
  424. scheme/alt/pseudoscheme-record.scm
  425. (echo \(defvar pseudoscheme-directory \"$(PSEUDODIR)/\"\); \
  426. cat build/lucid-script.lisp; \
  427. echo \(dump-linker\) \(lcl:quit\)) \
  428. | lisp
  429. # --------------------
  430. # Initial image
  431. #
  432. # The initial.image is built by the static linker. The image contains
  433. # Scheme, the byte-code compiler, and a minimal command processor, but
  434. # no debugging environment to speak of.
  435. $(INITIAL): $(CONFIG_FILES) build/initial.scm $(initial-files) $(linker-files)
  436. cd $(srcdir) && \
  437. ($(START_LINKER); \
  438. echo '(load-configuration "scheme/interfaces.scm")'; \
  439. echo '(load-configuration "scheme/vm/shared-interfaces.scm")'; \
  440. echo '(load-configuration "scheme/packages.scm")'; \
  441. echo '(flatload initial-structures)'; \
  442. echo '(load "build/initial.scm")'; \
  443. echo '(link-initial-system)' \
  444. ) | $(LINKER_RUNNABLE)
  445. # --------------------
  446. # Various small images for debugging low-level changes
  447. LOAD_DEBUG = \
  448. $(START_LINKER); \
  449. echo \(load-configuration \"scheme/interfaces.scm\"\); \
  450. echo \(load-configuration \"scheme/packages.scm\"\); \
  451. echo \(load-configuration \"scheme/vm/shared-interfaces.scm\"\); \
  452. echo \(flatload debug-structures\)
  453. scheme/debug/tiny.image: scheme/debug/tiny-packages.scm \
  454. scheme/debug/tiny.scm
  455. cd $(srcdir) && \
  456. ($(START_LINKER); \
  457. echo \(load-configuration \"scheme/debug/tiny-packages.scm\"\); \
  458. echo \(link-simple-system \'\(scheme/debug tiny\) \'start tiny-system\)) \
  459. | $(LINKER_RUNNABLE)
  460. scheme/debug/low-test.image: scheme/debug/low-test-packages.scm \
  461. scheme/debug/low-test.scm
  462. cd $(srcdir) && \
  463. ($(START_LINKER); \
  464. echo \(load-configuration \"scheme/debug/low-test-packages.scm\"\); \
  465. echo \(link-simple-system \'\(scheme/debug low-test\) \'start low-test-system\)) \
  466. | $(LINKER_RUNNABLE)
  467. scheme/debug/little.image: $(CONFIG_FILES) scheme/debug-packages.scm
  468. cd $(srcdir) && \
  469. ($(LOAD_DEBUG); echo \(link-little-system\)) \
  470. | $(LINKER_RUNNABLE)
  471. scheme/debug/mini.image: $(CONFIG_FILES)
  472. cd $(srcdir) && \
  473. ($(LOAD_DEBUG); echo \(link-mini-system\)) \
  474. | $(LINKER_RUNNABLE)
  475. scheme/debug/medium.image: $(CONFIG_FILES)
  476. cd $(srcdir) && \
  477. ($(LOAD_DEBUG); echo \(flatload compiler-structures\); \
  478. echo \(link-medium-system\)) \
  479. | $(LINKER_RUNNABLE)
  480. # The following have not been updated for the new directory organization
  481. c/smain.o: c/main.c
  482. $(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) -DSTATIC_AREAS -o $@ $(srcdir)/c/main.c
  483. mini: mini-heap.o smain.o
  484. $(CC) $(LDFLAGS) $(CFLAGS) -o $@ c/smain.o mini-heap.o $(OBJS) $(LIBS)
  485. mini-heap.o: mini-heap.c
  486. $(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) -o $@ $(srcdir)/mini-heap.c
  487. mini-heap.c: scheme/debug/mini1.image
  488. (echo ,exec ,load misc/load-static.scm; \
  489. echo \(do-it 150000 \"$(srcdir)/scheme/debug/mini1.image\" \"$@\"\)) \
  490. | $(RUNNABLE) -h 3000000 -a batch
  491. scheme/debug/mini1.image: $(VM) scheme/debug/mini.image
  492. echo "(write-image \"scheme/debug/mini1.image\" \
  493. (usual-resumer (lambda (args) \
  494. (command-processor #f args))) \
  495. \"foo\")" \
  496. | ./$(VM) -i scheme/debug/mini.image -a batch
  497. # --------------------
  498. # Generate unicode-info.scm, srfi-14-base-char-set.scm, and unicode-normalization-info
  499. # from UnicodeData.txt
  500. # Get fresh UnicodeData.txt from http://www.unicode.org.
  501. scheme/rts/syntax-info.scm: build/UnicodeData.txt \
  502. build/PropList.txt \
  503. build/SpecialCasing.txt \
  504. build/CaseFolding.txt \
  505. build/CompositionExclusions.txt \
  506. scheme/link/unicode-data.scm \
  507. scheme/env/unicode-category.scm \
  508. scheme/big/compact-table.scm
  509. cd $(srcdir) && \
  510. (echo ',batch'; \
  511. echo ',config ,load scheme/link/unicode-data-packages.scm'; \
  512. echo ",in unicode-data (create-unicode-tables \"build/UnicodeData.txt\" \"build/PropList.txt\" \"build/SpecialCasing.txt\" \"build/CaseFolding.txt\" \"build/CompositionExclusions.txt\" \"scheme/env/unicode-info.scm\" \"scheme/rts/syntax-info.scm\" \"scheme/big/unicode-normalization-info.scm\" \"scheme/srfi/srfi-14-base-char-sets.scm\")" \
  513. ) | $(RUNNABLE) -h 6000000
  514. # --------------------
  515. # Generate scheme48.h from VM sources
  516. c/scheme48.h: c/scheme48.h.in scheme/vm/interp/arch.scm \
  517. scheme/vm/data/data.scm scheme/link/generate-c-header.scm
  518. cd $(srcdir) && \
  519. (echo ',bench'; \
  520. echo ',batch'; \
  521. echo ',load-package big-scheme'; \
  522. echo ',open big-scheme'; \
  523. echo ',load scheme/link/generate-c-header.scm'; \
  524. echo "(make-c-header-file \"$@\" \
  525. \"c/scheme48.h.in\" \
  526. \"scheme/vm/interp/arch.scm\" \
  527. \"scheme/vm/data/data.scm\" \
  528. \"scheme/rts/record.scm\")" \
  529. ) | $(RUNNABLE)
  530. # An old version of the above for legacy code.
  531. c/old-scheme48.h: scheme/vm/interp/arch.scm scheme/vm/data/data.scm \
  532. scheme/link/generate-old-c-header.scm
  533. (echo ',bench'; \
  534. echo ',batch'; \
  535. echo ',load-package big-scheme'; \
  536. echo ',open big-scheme'; \
  537. echo ',load scheme/link/generate-old-c-header.scm'; \
  538. echo "(make-c-header-file \"$@\" \
  539. \"$(srcdir)/scheme/vm/interp/arch.scm\" \
  540. \"$(srcdir)/scheme/vm/data/data.scm\")" \
  541. ) | $(RUNNABLE)
  542. # Generate vm (scheme48vm.c and scheme48heap.c) from VM sources.
  543. # Never called automatically. Do not use unless you are sure you
  544. # know what you are doing.
  545. # Afterwards, you should probably make c/scheme48.h.
  546. i-know-what-i-am-doing:
  547. cd $(srcdir)/ps-compiler && \
  548. (echo ',batch'; \
  549. echo ',config ,load ../scheme/prescheme/interface.scm'; \
  550. echo ',config ,load ../scheme/prescheme/package-defs.scm'; \
  551. echo ',exec ,load load-ps-compiler.scm'; \
  552. echo ',exec ,load compile-vm-no-gc.scm'; \
  553. echo ',exec ,load compile-gc.scm'; \
  554. echo ',exit' \
  555. ) | $(RUNNABLE) -h 8000000 && \
  556. mv ../scheme/vm/scheme48vm.c ../scheme/vm/scheme48heap.c \
  557. ../scheme/vm/scheme48write-image.c \
  558. ../scheme/vm/scheme48read-image.c ../c