Makefile.in 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  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. # 1. As below: build the linker on the scheme48vm and scheme48.image
  54. # that are in the current directory.
  55. # 2. LINKER_VM = $(RUNNABLE) $(BIG_HEAP)
  56. # LINKER_RUNNABLE = $(RUNNABLE)
  57. # These settings requires you to already have a $(RUNNABLE)
  58. # command. This is desirable if you are making changes to the
  59. # system that might break scheme48vm and/or scheme48.image. But it
  60. # requires you to have squirreled away a previous working version
  61. # of scheme48.
  62. BIG_HEAP = -h 6000000
  63. LINKER_VM = ./$(VM) $(BIG_HEAP)
  64. LINKER_RUNNABLE = $(LINKER_VM) -i $(IMAGE)
  65. LINKER_IMAGE = build/linker.image
  66. LINKER = $(LINKER_VM) -i $(LINKER_IMAGE)
  67. START_LINKER = echo ',batch' && echo ',bench on'
  68. # --------------------
  69. # You shouldn't have to change anything below this point, except for possibly
  70. # the external code rules.
  71. # Targets:
  72. IMAGE = scheme48.image
  73. INITIAL = $(srcdir)/build/initial.image
  74. VM = scheme48vm
  75. UNIX_OBJS = c/unix/misc.o c/unix/io.o c/unix/fd-io.o c/unix/event.o
  76. OBJS = c/scheme48vm.o c/scheme48heap.o \
  77. c/scheme48read-image.o c/scheme48write-image.o \
  78. c/extension.o c/external.o c/bignum.o
  79. FAKEHS = c/fake/dlfcn.h c/fake/sigact.h c/fake/strerror.h \
  80. c/fake/sys-select.h
  81. # Sources:
  82. CONFIG_FILES = scheme/interfaces.scm scheme/packages.scm \
  83. scheme/vm/shared-interfaces.scm \
  84. scheme/low-packages.scm scheme/rts-packages.scm \
  85. scheme/comp-packages.scm scheme/initial-packages.scm
  86. # Rules:
  87. # The following is the first rule and therefore the "make" command's
  88. # default target.
  89. enough: $(VM) $(IMAGE) go
  90. # --------------------
  91. # External code to include in the VM
  92. # After changing any of these you should delete `scheme48vm' and remake it.
  93. EXTERNAL_OBJECTS = $(POSIX_OBJECTS) $(SOCKET_OBJECTS) $(LOOKUP_OBJECTS) \
  94. $(ASM_OBJECTS) $(SRFI_OBJECTS)
  95. EXTERNAL_LD_FLAGS = $(POSIX_LD_FLAGS) $(SOCKET_LD_FLAGS)
  96. EXTERNAL_INITIALIZERS = $(POSIX_INITIALIZERS) $(SOCKET_INITIALIZERS) \
  97. $(LOOKUP_INITIALIZERS) $(ASM_INITIALIZERS) \
  98. $(SRFI_INITIALIZERS)
  99. # Rules for any external code.
  100. # POSIX rules; this could have its own Makefile, but I don't want to bother.
  101. posix_dir = c/posix
  102. $(posix_dir)/user.o $(posix_dir)/regexp.o \
  103. $(posix_dir)/proc-env.o $(posix_dir)/io.o: \
  104. c/scheme48.h c/c-mods.h $(posix_dir)/posix.h
  105. $(posix_dir)/proc.o: \
  106. c/scheme48.h c/c-mods.h \
  107. c/event.h $(posix_dir)/posix.h $(posix_dir)/s48_signals.h
  108. $(posix_dir)/dir.o: \
  109. c/scheme48.h c/scheme48heap.h c/c-mods.h \
  110. c/event.h c/fd-io.h $(posix_dir)/posix.h
  111. POSIX_OBJECTS = $(posix_dir)/user.o $(posix_dir)/regexp.o \
  112. $(posix_dir)/proc-env.o $(posix_dir)/proc.o \
  113. $(posix_dir)/io.o $(posix_dir)/dir.o
  114. POSIX_LD_FLAGS =
  115. POSIX_INITIALIZERS = s48_init_posix_dir s48_init_posix_user \
  116. s48_init_posix_regexp s48_init_posix_proc_env \
  117. s48_init_posix_io s48_init_posix_proc
  118. # End of POSIX rules
  119. # Socket rules
  120. c/unix/socket.o: c/scheme48.h c/fd-io.h c/event.h
  121. SOCKET_OBJECTS = c/unix/socket.o
  122. SOCKET_LD_FLAGS =
  123. SOCKET_INITIALIZERS = s48_init_socket
  124. # End of socket rules
  125. # Lookup rules (this is just for compatibility with old code)
  126. c/unix/dynamo.o: c/scheme48.h
  127. LOOKUP_OBJECTS = c/unix/dynamo.o
  128. LOOKUP_INITIALIZERS = s48_init_external_lookup
  129. # End of lookup rules
  130. # Native-code glue rules
  131. ASM_OBJECTS = c/fake/glue.o
  132. ASM_INITIALIZERS =
  133. # Real definitions to be used when a. native code works and b. it is supported
  134. # on the machine we're compiling on
  135. #ASM_OBJECTS = c/glue.o c/asm-glue.o
  136. #ASM_INITIALIZERS = s48_init_asm_glue
  137. # End of native-code glue rules
  138. # SRFI rules
  139. SRFI_OBJECTS = c/srfi-27.c
  140. SRFI_INITIALIZERS = s48_init_srfi_27
  141. # End of SRFI rules
  142. # End of external rules
  143. # --------------------
  144. $(VM): c/main.o $(OBJS) $(UNIX_OBJS) $(LIBOBJS) $(EXTERNAL_OBJECTS)
  145. rm -f /tmp/s48_external_$$$$.c && \
  146. $(srcdir)/build/build-external-modules /tmp/s48_external_$$$$.c \
  147. $(EXTERNAL_INITIALIZERS) && \
  148. $(CC) $(LDFLAGS) $(CFLAGS) -o $@ c/main.o $(OBJS) $(UNIX_OBJS) \
  149. /tmp/s48_external_$$$$.c \
  150. $(LIBOBJS) $(LIBS) \
  151. $(EXTERNAL_OBJECTS) $(EXTERNAL_LD_FLAGS) && \
  152. rm -f /tmp/s48_external_$$$$.c
  153. c/main.o: c/main.c c/scheme48vm.h c/scheme48heap.h
  154. $(CC) -c $(CFLAGS) -o $@ \
  155. -DDEFAULT_IMAGE_NAME=\"$(LIB)/$(IMAGE)\" \
  156. $(CPPFLAGS) $(DEFS) $(srcdir)/c/main.c
  157. c/scheme48vm.o: c/prescheme.h c/scheme48vm.h c/scheme48heap.h \
  158. c/scheme48image.h c/bignum.h c/event.h \
  159. c/io.h c/fd-io.h \
  160. c/scheme48vm-prelude.h c/c-mods.h
  161. c/scheme48heap.o: c/prescheme.h c/scheme48vm.h c/scheme48heap.h \
  162. c/scheme48vm-prelude.h c/c-mods.h \
  163. c/event.h c/io.h c/fd-io.h
  164. c/scheme48read-image.o: c/prescheme.h c/scheme48vm.h c/scheme48heap.h \
  165. c/scheme48vm-prelude.h c/c-mods.h
  166. c/scheme48write-image.o: c/prescheme.h c/scheme48vm.h c/scheme48heap.h \
  167. c/scheme48vm-prelude.h c/c-mods.h
  168. c/bignum.o: c/bignum.h c/bignumint.h c/scheme48.h
  169. c/extension.o: c/sysdep.h $(FAKEHS) c/scheme48.h c/scheme48vm.h
  170. c/external.o: c/sysdep.h $(FAKEHS) c/scheme48.h c/c-mods.h
  171. c/unix/event.o: c/sysdep.h $(FAKEHS) c/c-mods.h \
  172. c/scheme48vm.h c/scheme48heap.h \
  173. c/event.h c/fd-io.h \
  174. c/c-mods.h
  175. c/unix/fd-io.o: c/sysdep.h $(FAKEHS) c/c-mods.h \
  176. c/scheme48vm.h c/scheme48heap.h \
  177. c/event.h c/fd-io.h
  178. c/unix/misc.o: c/sysdep.h $(FAKEHS)
  179. c/unix/io.o: c/io.h
  180. c/fake/libdl1.o: c/fake/dlfcn.h
  181. c/fake/libdl2.o: c/fake/dlfcn.h
  182. c/fake/strerror.o: c/fake/strerror.h
  183. # --------------------
  184. # Make scheme48.image from initial.image and library .scm files.
  185. #
  186. # For bootstrap reasons, initial.image is *not* listed as a source,
  187. # even though it really is.
  188. $(IMAGE): $(VM) scheme/env/init-defpackage.scm scheme/more-interfaces.scm \
  189. scheme/link-packages.scm scheme/env-packages.scm \
  190. scheme/more-packages.scm \
  191. scheme/sort/interfaces.scm scheme/sort/packages.scm \
  192. scheme/posix/packages.scm scheme/srfi/packages.scm \
  193. $(usual-files) build/initial.debug build/build-usual-image
  194. $(srcdir)/build/build-usual-image $(srcdir) "`(cd $(srcdir) && echo $$PWD)`/scheme" '$(IMAGE)' './$(VM)' \
  195. '$(INITIAL)'
  196. ### Fake targets: all clean install man dist
  197. install: enough dirs inst-script inst-vm inst-misc inst-man inst-inc inst-image
  198. inst-vm:
  199. $(INSTALL_PROGRAM) $(VM) $(LIB)
  200. inst-image:
  201. rm -f '/tmp/$(IMAGE)' && \
  202. $(srcdir)/build/build-usual-image $(srcdir) '$(LIB)' \
  203. '/tmp/$(IMAGE)' './$(VM)' '$(INITIAL)' && \
  204. $(INSTALL_DATA) /tmp/$(IMAGE) $(LIB) && \
  205. rm /tmp/$(IMAGE)
  206. inst-man:
  207. if [ -d $(mandir) -a -w $(mandir) ]; then \
  208. sed 's=LBIN=$(bindir)=g' $(srcdir)/doc/scheme48.man | \
  209. sed 's=LLIB=$(LIB)=g' | \
  210. sed 's=LS48=$(RUNNABLE)=g' >$(MANPAGE) && \
  211. $(INSTALL_DATA) $(MANPAGE) $(mandir) && \
  212. rm $(MANPAGE); \
  213. else \
  214. echo "$(mandir) not writable dir, not installing man page" \
  215. >&2; \
  216. fi
  217. inst-inc:
  218. $(INSTALL_DATA) $(srcdir)/c/scheme48.h $(incdir)
  219. inst-misc:
  220. for stub in env big sort opt misc link posix srfi; do \
  221. for f in $(srcdir)/scheme/$$stub/*.scm; do \
  222. $(INSTALL_DATA) $$f $(LIB)/$$stub || exit 1; \
  223. done; \
  224. done && \
  225. for f in $(srcdir)/scheme/rts/*num.scm \
  226. $(srcdir)/scheme/rts/jar-defrecord.scm; do \
  227. $(INSTALL_DATA) $$f $(LIB)/rts || exit 1; \
  228. done
  229. inst-script:
  230. script=$(bindir)/$(RUNNABLE) && \
  231. echo '#!/bin/sh' >$$script && \
  232. echo >>$$script && \
  233. echo 'lib=$(LIB)' >>$$script && \
  234. echo 'exec $$lib/$(VM) -o $$lib/$(VM) -i $$lib/$(IMAGE) "$$@"' \
  235. >>$$script && \
  236. chmod +x $$script
  237. # Script to run scheme48 in this directory.
  238. go:
  239. echo '#!/bin/sh' >$@ && \
  240. echo >>$@ && \
  241. echo "lib=`pwd`" >>$@ && \
  242. echo 'exec $$lib/$(VM) -o $$lib/$(VM) -i $$lib/$(IMAGE) "$$@"' \
  243. >>$@ && \
  244. chmod +x $@
  245. dirs:
  246. for dir in $(libdir) $(bindir) $(incdir); do \
  247. [ -d $$dir -a -w $$dir ] || { \
  248. echo "$$dir not a writable directory" >&2; \
  249. exit 1; \
  250. }; \
  251. done
  252. { mkdir -p $(LIB) && [ -w $(LIB) ]; } || { \
  253. echo "$(LIB) not a writable directory" >&2; \
  254. exit 1; \
  255. }
  256. for dir in rts env big sort opt misc link posix srfi; do \
  257. { mkdir -p $(LIB)/$$dir && [ -w $(LIB)/$$dir ]; } || { \
  258. echo "$(LIB)/$$dir not a writable directory" >&2; \
  259. exit 1; \
  260. }; \
  261. done
  262. configure: configure.in
  263. autoheader && autoconf
  264. clean:
  265. -rm -f $(VM) *.o c/unix/*.o c/posix/*.o c/*.o c/fake/*.o \
  266. TAGS $(IMAGE) \
  267. build/*.tmp $(MANPAGE) build/linker.image \
  268. scheme/debug/*.image scheme/debug/*.debug config.cache \
  269. scheme/vm/scheme48vm.c scheme/vm/scheme48heap.c \
  270. go $(distname)
  271. distclean: clean
  272. rm -f Makefile config.log config.status c/sysdep.h
  273. check: $(VM) $(IMAGE) scheme/debug/check.scm
  274. ( \
  275. echo ',batch'; \
  276. echo ',translate =scheme48 scheme'; \
  277. echo ',config ,load scheme/debug/test.scm'; \
  278. echo ',exec ,load scheme/debug/check.scm'; \
  279. echo ',exec (done)' \
  280. ) | ./$(VM) -i $(IMAGE)
  281. # --------------------
  282. # Rules from here on down are not essential for the basic installation
  283. # procedure, and are not expected to work when srcdir is not the
  284. # distribution directory.
  285. all: vm linker
  286. $(MAKE) image
  287. vm: $(VM)
  288. linker: $(LINKER_IMAGE)
  289. image: $(INITIAL)
  290. $(MAKE) $(IMAGE)
  291. tags:
  292. etags scheme/vm/interp/arch.scm scheme/rts/*.scm scheme/bcomp/*.scm \
  293. scheme/*.scm scheme/env/*.scm scheme/big/*.scm scheme/link/*.scm \
  294. scheme/opt/*.scm scheme/debug/*.scm scheme/misc/*.scm scheme/sort/*.scm
  295. # --------------------
  296. # Distribution...
  297. # DISTFILES should include all sources.
  298. DISTFILES = README COPYING INSTALL configure \
  299. acconfig.h configure.in Makefile.in install-sh \
  300. doc/*.ps doc/*.txt doc/html/*.html doc/scheme48.man \
  301. doc/src/*.tex doc/src/*.sty doc/src/*.scm \
  302. emacs/README build/*-version-number build/*.exec \
  303. build/*.lisp build/build-usual-image build/filenames.make \
  304. build/filenames.scm build/initial.debug \
  305. build/initial.image build/initial.scm \
  306. build/build-external-modules \
  307. c/*.[ch] c/*/*.[ch] c/scheme48.h.in \
  308. emacs/*.el gdbinit \
  309. scheme/*.scm scheme/*/*.scm scheme/vm/*/*.scm \
  310. ps-compiler/minor-version-number \
  311. ps-compiler/doc/node.txt ps-compiler/doc/todo.txt \
  312. ps-compiler/*.scm ps-compiler/*/*.scm \
  313. ps-compiler/prescheme/primop/*.scm \
  314. ps-compiler/prescheme/test/*.scm \
  315. c/sysdep.h.in
  316. distname = $(RUNNABLE)-1.`cat $(srcdir)/build/minor-version-number`
  317. dist: build/initial.image
  318. distname=$(distname) && \
  319. distfile=$(distdir)/$$distname.tgz && \
  320. if [ -d $(distdir) ] && \
  321. [ -w $$distfile -o -w $(distdir) ]; then \
  322. rm -f $$distname && \
  323. ln -s . $$distname && \
  324. files='' && \
  325. for i in $(DISTFILES); do \
  326. if [ "$$i" != "c/sysdep.h" ]; then \
  327. files="$$files $$distname/$$i"; \
  328. fi \
  329. done && \
  330. tar -cf - $$files | \
  331. gzip --best >$$distfile && \
  332. rm $$distname; \
  333. else \
  334. echo "Can't write $$distfile" >&2; \
  335. exit 1; \
  336. fi
  337. # Increment the minor version number
  338. inc:
  339. f=build/minor-version-number && \
  340. expr `cat $$f` + 1 >$$f.tmp && \
  341. mv $$f.tmp $$f && \
  342. cp $$f doc/src/version-number.tex && \
  343. echo '(define version-info "1.'`cat $$f`'")' \
  344. >scheme/env/version-info.scm
  345. # --------------------
  346. # Generate build/filenames.make from *packages.scm
  347. #
  348. # This hack traces the module dependencies described in the
  349. # various configuration files and converts them into dependency lists
  350. # that "make" can use for its purposes.
  351. #
  352. # Since the distribution comes with a filenames.make, this rule
  353. # shouldn't be invoked for simple installations. But it will be used
  354. # if you change any of the *-packages.scm files.
  355. #
  356. # You can actually run the forms in filenames.scm in any Scheme
  357. # implementation that has syntax-rules and explicit-renaming low-level
  358. # macros (e.g., most versions of Scheme 48 and Pseudoscheme).
  359. # If there are errors running this script, and you need to debug,
  360. # don't use the initial.image, use something that has a reasonable
  361. # environment.
  362. #
  363. # If this fails and you don't feel like debugging or fixing the problem,
  364. # try "touch filenames.make" and hope for the best.
  365. PACKAGES=scheme/packages.scm scheme/rts-packages.scm scheme/alt-packages.scm \
  366. scheme/comp-packages.scm scheme/initial-packages.scm \
  367. scheme/link-packages.scm scheme/env-packages.scm \
  368. scheme/sort/packages.scm scheme/more-packages.scm \
  369. build/filenames.scm
  370. $(srcdir)/build/filenames.make: $(PACKAGES)
  371. $(MAKE) $(VM) PACKAGES=
  372. cd $(srcdir) && \
  373. $(RUNNABLE) -a batch <build/filenames.scm
  374. # or: ./$(VM) -i $(srcdir)/$(INITIAL) -a batch <build/filenames.scm
  375. # --------------------
  376. # Static linker
  377. #
  378. # The linker is capable of rebuilding an image from sources, even
  379. # across an incompatible change in VM data representations.
  380. build/linker.image: $(linker-files) scheme/alt/init-defpackage.scm
  381. (echo ',batch'; \
  382. echo ',bench on'; \
  383. echo ',open signals handle features'; \
  384. echo ',open bitwise ascii code-vectors'; \
  385. echo ',open cells record-types'; \
  386. echo ',load $(linker-files)'; \
  387. echo ',load scheme/alt/init-defpackage.scm'; \
  388. echo ',dump build/linker.image' \
  389. ) | $(LINKER_RUNNABLE)
  390. # Or, to bootstrap from Lucid Common Lisp: (last tested with
  391. # Pseudoscheme 2.9 and Scheme 48 version 0.19)
  392. PSEUDODIR = ../pseudo
  393. link/linker-in-lucid: build/lucid-script.lisp $(linker-files) \
  394. scheme/alt/pseudoscheme-features.scm \
  395. scheme/alt/pseudoscheme-record.scm
  396. (echo \(defvar pseudoscheme-directory \"$(PSEUDODIR)/\"\); \
  397. cat build/lucid-script.lisp; \
  398. echo \(dump-linker\) \(lcl:quit\)) \
  399. | lisp
  400. # --------------------
  401. # Initial image
  402. #
  403. # The initial.image is built by the static linker. The image contains
  404. # Scheme, the byte-code compiler, and a minimal command processor, but
  405. # no debugging environment to speak of.
  406. $(INITIAL): $(LINKER_IMAGE) $(CONFIG_FILES) build/initial.scm $(initial-files)
  407. ($(START_LINKER); \
  408. echo '(load-configuration "scheme/interfaces.scm")'; \
  409. echo '(load-configuration "scheme/vm/shared-interfaces.scm")'; \
  410. echo '(load-configuration "scheme/packages.scm")'; \
  411. echo '(flatload initial-structures)'; \
  412. echo '(load "build/initial.scm")'; \
  413. echo '(link-initial-system)' \
  414. ) | $(LINKER)
  415. # --------------------
  416. # Various small images for debugging low-level changes
  417. LOAD_DEBUG = \
  418. $(START_LINKER); \
  419. echo \(load-configuration \"scheme/interfaces.scm\"\); \
  420. echo \(load-configuration \"scheme/packages.scm\"\); \
  421. echo \(flatload debug-structures\)
  422. scheme/debug/tiny.image: $(LINKER_IMAGE) scheme/debug/tiny-packages.scm \
  423. scheme/debug/tiny.scm
  424. ($(START_LINKER); \
  425. echo \(load-configuration \"scheme/debug/tiny-packages.scm\"\); \
  426. echo \(link-simple-system \'\(scheme/debug tiny\) \'start tiny-system\)) \
  427. | $(LINKER)
  428. scheme/debug/low-test.image: $(LINKER_IMAGE) scheme/debug/low-test-packages.scm \
  429. scheme/debug/low-test.scm
  430. ($(START_LINKER); \
  431. echo \(load-configuration \"scheme/debug/low-test-packages.scm\"\); \
  432. echo \(link-simple-system \'\(scheme/debug low-test\) \'start low-test-system\)) \
  433. | $(LINKER)
  434. scheme/debug/little.image: $(LINKER_IMAGE) $(CONFIG_FILES) scheme/debug-packages.scm
  435. ($(LOAD_DEBUG); echo \(link-little-system\)) \
  436. | time $(LINKER)
  437. scheme/debug/mini.image: $(LINKER_IMAGE) $(CONFIG_FILES)
  438. ($(LOAD_DEBUG); echo \(link-mini-system\)) \
  439. | $(LINKER)
  440. scheme/debug/medium.image: $(LINKER_IMAGE) $(CONFIG_FILES)
  441. ($(LOAD_DEBUG); echo \(flatload compiler-structures\); \
  442. echo \(link-medium-system\)) \
  443. | $(LINKER)
  444. # The following have not been updated for the new directory organization
  445. c/smain.o: c/main.c
  446. $(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) -DSTATIC_AREAS -o $@ $(srcdir)/c/main.c
  447. mini: mini-heap.o smain.o
  448. $(CC) $(LDFLAGS) $(CFLAGS) -o $@ c/smain.o mini-heap.o $(OBJS) $(LIBS)
  449. mini-heap.o: mini-heap.c
  450. $(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) -o $@ $(srcdir)/mini-heap.c
  451. mini-heap.c: scheme/debug/mini1.image
  452. (echo ,exec ,load misc/load-static.scm; \
  453. echo \(do-it 150000 \"$(srcdir)/scheme/debug/mini1.image\" \"$@\"\)) \
  454. | $(RUNNABLE) -h 3000000 -a batch
  455. scheme/debug/mini1.image: $(VM) scheme/debug/mini.image
  456. echo "(write-image \"scheme/debug/mini1.image\" \
  457. (usual-resumer (lambda (args) \
  458. (command-processor #f args))) \
  459. \"foo\")" \
  460. | ./$(VM) -i scheme/debug/mini.image -a batch
  461. # --------------------
  462. # Generate scheme48.h from VM sources
  463. c/scheme48.h: c/scheme48.h.in scheme/vm/interp/arch.scm \
  464. scheme/vm/data/data.scm scheme/link/generate-c-header.scm
  465. (echo ',bench'; \
  466. echo ',batch'; \
  467. echo ',load-package big-scheme'; \
  468. echo ',open big-scheme'; \
  469. echo ',load scheme/link/generate-c-header.scm'; \
  470. echo "(make-c-header-file \"$@\" \
  471. \"$(srcdir)/c/scheme48.h.in\" \
  472. \"$(srcdir)/scheme/vm/interp/arch.scm\" \
  473. \"$(srcdir)/scheme/vm/data/data.scm\" \
  474. \"$(srcdir)/scheme/rts/record.scm\")" \
  475. ) | $(RUNNABLE)
  476. # An old version of the above for legacy code.
  477. c/old-scheme48.h: scheme/vm/interp/arch.scm scheme/vm/data/data.scm \
  478. scheme/link/generate-old-c-header.scm
  479. (echo ',bench'; \
  480. echo ',batch'; \
  481. echo ',load-package big-scheme'; \
  482. echo ',open big-scheme'; \
  483. echo ',load scheme/link/generate-old-c-header.scm'; \
  484. echo "(make-c-header-file \"$@\" \
  485. \"$(srcdir)/scheme/vm/interp/arch.scm\" \
  486. \"$(srcdir)/scheme/vm/data/data.scm\")" \
  487. ) | $(RUNNABLE)
  488. # Generate vm (scheme48vm.c and scheme48heap.c) from VM sources.
  489. # Never called automatically. Do not use unless you are sure you
  490. # know what you are doing.
  491. # Afterwards, you should probably make c/scheme48.h.
  492. i-know-what-i-am-doing:
  493. cd ps-compiler && \
  494. (echo ',batch'; \
  495. echo ',config ,load ../scheme/prescheme/interface.scm'; \
  496. echo ',config ,load ../scheme/prescheme/package-defs.scm'; \
  497. echo ',exec ,load load-ps-compiler.scm'; \
  498. echo ',exec ,load compile-vm-no-gc.scm'; \
  499. echo ',exec ,load compile-gc.scm'; \
  500. echo ',exit' \
  501. ) | $(RUNNABLE) -h 8000000 && \
  502. mv ../scheme/vm/scheme48vm.c ../scheme/vm/scheme48heap.c \
  503. ../scheme/vm/scheme48write-image.c \
  504. ../scheme/vm/scheme48read-image.c ../c