Makefile.in 20 KB

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