Makefile.in 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010
  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. LD = @LD@
  9. DEFS = @DEFS@
  10. LIBS = @LIBS@
  11. CFLAGS = @CFLAGS@
  12. CPPFLAGS = @CPPFLAGS@
  13. INSTALL = @INSTALL@
  14. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  15. INSTALL_DATA = @INSTALL_DATA@
  16. LDFLAGS = @LDFLAGS@
  17. LDFLAGS_VM = @LDFLAGS_VM@
  18. LIBOBJS = @LIBOBJS@
  19. GC_OBJS = @GC_OBJS@
  20. ADDITIONAL_EXTERNALS = @ADDITIONAL_EXTERNALS@
  21. ADDITIONAL_EXTERNAL_OBJS = @ADDITIONAL_EXTERNAL_OBJS@
  22. ASM_OBJECTS = @ASM_OBJECTS@
  23. ASM_STYLE = @ASM_STYLE@
  24. HOST_ARCHITECTURE = @host@
  25. BIT_SUFFIX = @BIT_SUFFIX@
  26. prefix = @prefix@
  27. exec_prefix = @exec_prefix@
  28. bindir = @bindir@
  29. libdir = @libdir@
  30. incdir = @includedir@
  31. manext = 1
  32. mandir = @mandir@/man$(manext)
  33. docdir = @docdir@
  34. datarootdir = @datarootdir@
  35. datadir = @datadir@
  36. DYNAMIC_EXTERNALS_CFLAGS=@DYNAMIC_EXTERNALS_CFLAGS@
  37. DYNAMIC_EXTERNALS_LDFLAGS=@DYNAMIC_EXTERNALS_LDFLAGS@
  38. DYNAMIC_EXTERNALS_LDFLAGS_IN_PLACE=@DYNAMIC_EXTERNALS_LDFLAGS_IN_PLACE@
  39. ### End of `configure' section###
  40. # HP 9000 series, if you don't have gcc
  41. # CC = cc
  42. # CFLAGS = -Aa -O +Obb1800
  43. # DEFS = -D_HPUX_SOURCE -Dhpux
  44. # Ultrix
  45. # LDFLAGS = -N
  46. COMPILING_ITSELF_DEFS = $(DEFS) -D__COMPILING_SCHEME48_ITSELF__ -DS48_HOST_ARCHITECTURE=\"$(HOST_ARCHITECTURE)\"
  47. .c.o:
  48. $(CC) -c $(CPPFLAGS) $(COMPILING_ITSELF_DEFS) -I ./c -I$(srcdir)/c -I$(srcdir)/c/net -I$(srcdir)/c/bibop $(CFLAGS) -o $@ $<
  49. # You might want to change RUNNABLE to "s48"
  50. VERSION = 1.`cat $(srcdir)/build/minor-version-number`
  51. RUNNABLE = scheme48
  52. CONFIG_SCRIPT = scheme48-config
  53. MANPAGE = $(RUNNABLE).$(manext)
  54. LIB = $(libdir)/scheme48-$(VERSION)
  55. SHARE = $(datadir)/scheme48-$(VERSION)
  56. distdir = /tmp
  57. # If make barfs on this include line, just comment it out. It's only
  58. # really needed if you want to build the linker or rebuild initial.image.
  59. include $(srcdir)/build/filenames.make
  60. #
  61. #NetBSD make wants to see this instead:
  62. #.include "$(srcdir)/build/filenames.make"
  63. # Static linker:
  64. #
  65. # You only need the linker if you're going to make changes to the
  66. # things that go into the initial.image, which in general means the
  67. # files in rts/. If you decide you need to use the linker, then you
  68. # gots your choice; it can run in just about any version of Scheme 48
  69. # or Pseudoscheme. (It has also been made to run in Scheme->C.) It
  70. # doesn't matter a whole lot which Scheme you use as long as it's not
  71. # broken or unavailable. The two best choices are:
  72. #
  73. # 1. As below.
  74. # These settings requires you to already have a $(RUNNABLE)
  75. # command. This is desirable if you are making changes to the
  76. # system that might break scheme48vm and/or scheme48.image. But it
  77. # requires you to have squirreled away a previous working version
  78. # of scheme48. The settings assume a Unicode version; if you want
  79. # to use an installed non-Unicode-capable Scheme 48 (1.4 or earlier),
  80. # you need to use this setting:
  81. # LINKER_WRITEBYTE = ,load scheme/alt/write-byte.scm
  82. #
  83. # 2. LINKER_VM = ./$(VM) $(BIG_HEAP)
  84. # LINKER_RUNNABLE = $(LINKER_VM) -i $(IMAGE)
  85. # LINKER_WRITEBYTE = ,open (subset i/o (write-byte)) (subset ports (set-port-crlf?!))
  86. # This builds the linker on the scheme48vm and scheme48.image
  87. # that are in the current directory.
  88. BIG_HEAP = -h 9000000
  89. LINKER_VM = $(RUNNABLE) $(BIG_HEAP)
  90. LINKER_RUNNABLE = $(LINKER_VM)
  91. LINKER_WRITEBYTE = ,open (subset i/o (write-byte)) (subset ports (set-port-crlf?!))
  92. START_LINKER-32 = echo ',batch'; \
  93. echo ',bench on'; \
  94. echo ',open signals features code-quote'; \
  95. echo ',open bitwise ascii code-vectors srfi-27'; \
  96. echo '$(LINKER_WRITEBYTE)'; \
  97. echo ',config ,load scheme/platform-interfaces.scm'; \
  98. echo ',config ,load scheme/rts-packages-32.scm'; \
  99. echo ',open platform'; \
  100. echo ',open cells records record-types'; \
  101. echo ',open cells records record-types'; \
  102. echo ',open (subset primitives (record checked-record-ref checked-record-set!))'; \
  103. echo ',open (subset low-proposals (provisional-checked-record-ref provisional-checked-record-set!))'; \
  104. echo ',load scheme/alt/low-exception.scm'; \
  105. echo ',load $(linker-files)'; \
  106. echo ',load scheme/alt/init-defpackage.scm'
  107. START_LINKER-64 = echo ',batch'; \
  108. echo ',bench on'; \
  109. echo ',open signals features code-quote'; \
  110. echo ',open bitwise ascii code-vectors srfi-27'; \
  111. echo '$(LINKER_WRITEBYTE)'; \
  112. echo ',config ,load scheme/platform-interfaces.scm'; \
  113. echo ',config ,load scheme/rts-packages-64.scm'; \
  114. echo ',open platform'; \
  115. echo ',open cells records record-types'; \
  116. echo ',open (subset primitives (record checked-record-ref checked-record-set!))'; \
  117. echo ',open (subset low-proposals (provisional-checked-record-ref provisional-checked-record-set!))'; \
  118. echo ',load scheme/alt/low-exception.scm'; \
  119. echo ',load $(linker-files)'; \
  120. echo ',load scheme/alt/init-defpackage.scm'
  121. # --------------------
  122. # You shouldn't have to change anything below this point.
  123. # Targets:
  124. IMAGE = scheme48.image
  125. INITIAL = $(srcdir)/build/initial.image
  126. VM = scheme48vm
  127. LIBSCHEME48 = c/libscheme48.a
  128. POSIX_EXTERNAL = c/posix.so
  129. SRFI_27_EXTERNAL = c/srfi-27.so
  130. FFI_TEST_EXTERNAL = c/ffi-test.so
  131. EXTERNALS = $(POSIX_EXTERNAL) $(SRFI_27_EXTERNAL) $(FFI_TEST_EXTERNAL) $(ADDITIONAL_EXTERNALS)
  132. UNIX_OBJS = c/unix/misc.o c/unix/io.o c/unix/fd-io.o c/unix/event.o
  133. OBJS = c/scheme48vm-$(BIT_SUFFIX).o \
  134. c/extension.o c/free.o c/double_to_string.o c/random.o c/bignum.o c/ffi.o \
  135. c/external.o c/external-lib.o c/external-init.o c/init.o
  136. FAKEHS = c/fake/dlfcn.h c/fake/sigact.h c/fake/strerror.h \
  137. c/fake/sys-select.h c/fake/langinfo.h
  138. SCHEME48HS = c/scheme48.h c/scheme48arch.h c/scheme48write-barrier.h
  139. # Sources:
  140. CONFIG_FILES = scheme/interfaces.scm scheme/packages.scm \
  141. scheme/vm/shared-interfaces.scm \
  142. scheme/low-packages.scm scheme/rts-packages.scm \
  143. scheme/comp-packages.scm scheme/initial-packages.scm
  144. # Rules:
  145. .PHONY: enough all clean install man doc dist
  146. # The following is the first rule and therefore the "make" command's
  147. # default target.
  148. enough: Makefile vm $(LIBSCHEME48) $(IMAGE) script-interpreter go
  149. enough: $(EXTERNALS)
  150. Makefile: ${srcdir}/Makefile.in config.status
  151. ./config.status
  152. $(MAKE) clean
  153. $(MAKE)
  154. # --------------------
  155. # External code to include in the VM
  156. # After changing any of these you should delete `scheme48vm' and remake it.
  157. EXTERNAL_OBJECTS = c/net/socket.o c/net/address.o c/net/net.o c/unix/socket.o \
  158. c/unix/dynlink.o \
  159. c/unix/sysexits.o $(ASM_OBJECTS) \
  160. $(ADDITIONAL_EXTERNAL_OBJS)
  161. # POSIX rules; this could have its own Makefile, but I don't want to bother.
  162. posix_dir = c/posix
  163. CC_POSIX = $(CC) -c $(CPPFLAGS) $(DEFS) -I ./c -I$(srcdir)/c -I$(srcdir)/c/bibop $(CFLAGS) $(DYNAMIC_EXTERNALS_CFLAGS) -o $@ $<
  164. $(posix_dir)/user.o: c/posix/user.c \
  165. $(SCHEME48HS) c/c-mods.h $(posix_dir)/posix.h
  166. $(CC_POSIX)
  167. $(posix_dir)/regexp.o: c/posix/regexp.c \
  168. $(SCHEME48HS) c/c-mods.h $(posix_dir)/posix.h
  169. $(CC_POSIX)
  170. $(posix_dir)/proc-env.o: c/posix/proc-env.c \
  171. $(SCHEME48HS) c/c-mods.h $(posix_dir)/posix.h
  172. $(CC_POSIX)
  173. $(posix_dir)/io.o: c/posix/io.c \
  174. $(SCHEME48HS) c/c-mods.h $(posix_dir)/posix.h
  175. $(CC_POSIX)
  176. $(posix_dir)/proc.o: c/posix/proc.c \
  177. $(SCHEME48HS) c/c-mods.h \
  178. c/event.h $(posix_dir)/posix.h $(posix_dir)/s48_signals.h
  179. $(CC_POSIX)
  180. $(posix_dir)/errno.o: c/posix/errno.c \
  181. $(SCHEME48HS) c/c-mods.h \
  182. c/event.h $(posix_dir)/posix.h $(posix_dir)/s48_errno.h
  183. $(CC_POSIX)
  184. $(posix_dir)/syslog.o: c/posix/syslog.c \
  185. $(SCHEME48HS)
  186. $(CC_POSIX)
  187. $(posix_dir)/posix.o: c/posix/posix.c
  188. $(CC_POSIX)
  189. $(posix_dir)/dir.o: c/posix/dir.c \
  190. $(SCHEME48HS) c/scheme48heap.h c/c-mods.h \
  191. c/event.h c/fd-io.h $(posix_dir)/posix.h
  192. $(CC_POSIX)
  193. $(posix_dir)/time.o: c/posix/time.c \
  194. $(SCHEME48HS) c/c-mods.h $(posix_dir)/posix.h
  195. $(CC_POSIX)
  196. POSIX_OBJECTS = $(posix_dir)/user.o $(posix_dir)/regexp.o \
  197. $(posix_dir)/proc-env.o $(posix_dir)/proc.o \
  198. $(posix_dir)/io.o $(posix_dir)/dir.o \
  199. $(posix_dir)/posix.o $(posix_dir)/time.o \
  200. $(posix_dir)/errno.o $(posix_dir)/syslog.o
  201. $(POSIX_EXTERNAL) : $(POSIX_OBJECTS)
  202. $(LD) -o $@ $(POSIX_OBJECTS) $(DYNAMIC_EXTERNALS_LDFLAGS_IN_PLACE)
  203. # End of POSIX rules
  204. c/srfi-27.o: c/srfi-27.c $(SCHEME48HS)
  205. $(CC) -c $(CPPFLAGS) $(DEFS) -I ./c -I$(srcdir)/c -I$(srcdir)/c/bibop $(CFLAGS) $(DYNAMIC_EXTERNALS_CFLAGS) -o $@ $<
  206. $(SRFI_27_EXTERNAL) : c/srfi-27.o
  207. $(LD) -o $@ c/srfi-27.o $(DYNAMIC_EXTERNALS_LDFLAGS_IN_PLACE)
  208. c/ffi-test/ffi-test.o: c/ffi-test/ffi-test.c c/ffi-test/ffi-test.h $(SCHEME48HS)
  209. $(CC) -c $(CPPFLAGS) $(DEFS) -I ./c -I$(srcdir)/c -I$(srcdir)/c/bibop $(CFLAGS) $(DYNAMIC_EXTERNALS_CFLAGS) -o $@ $<
  210. $(FFI_TEST_EXTERNAL) : c/ffi-test/ffi-test.o
  211. $(LD) -o $@ c/ffi-test/ffi-test.o $(DYNAMIC_EXTERNALS_LDFLAGS_IN_PLACE)
  212. # Native-code glue rules
  213. # Fake definitions if there is no support for native code
  214. FAKE_ASM_OBJECTS = c/fake/glue.o
  215. # Real definitions to be used when a. native code works and b. it is supported
  216. # on the machine we're compiling on
  217. # Does currently not work because of the new GC infrastructure
  218. X86_ASM_OBJECTS = c/glue.o c/asm-glue.o
  219. # Assumes s48-compiler/ in the working directory
  220. c/glue.o: c/glue_$(ASM_STYLE).s
  221. gcc -c -o $@ $<
  222. c/glue_$(ASM_STYLE).s: s48-compiler/assembler/x86/x86-glue.scm
  223. (echo ',batch'; \
  224. echo ',open srfi-23'; \
  225. echo ',load $<'; \
  226. echo '(glue-code "$@" (quote $(ASM_STYLE)))'; \
  227. echo ',exit' \
  228. ) | $(RUNNABLE)
  229. # End of native-code glue rules
  230. # Two-space copier objects
  231. GC_TWOSPACE_OBJS = c/scheme48-twospace-heap-$(BIT_SUFFIX).o
  232. c/scheme48-twospace-heap-$(BIT_SUFFIX).o: c/prescheme.h c/scheme48vm.h c/scheme48heap.h \
  233. c/scheme48vm-prelude.h c/c-mods.h \
  234. c/event.h c/io.h c/fd-io.h
  235. # The BIBOP Garbage Collector
  236. GC_BIBOP_OBJS = c/scheme48-bibop-heap-$(BIT_SUFFIX).o \
  237. c/bibop/page_alloc.o c/bibop/memory_map.o c/bibop/areas.o \
  238. c/bibop/generation_gc.o c/bibop/find_all.o c/bibop/check_heap.o \
  239. c/bibop/utils.o c/bibop/area_roots.o c/bibop/remset.o
  240. bibop: $(GC_BIBOP_OBJS)
  241. c/scheme48-bibop-heap-$(BIT_SUFFIX).o: c/prescheme.h c/scheme48vm.h c/scheme48heap.h \
  242. c/scheme48vm-prelude.h \
  243. c/bibop/bibop.h \
  244. c/c-mods.h c/event.h c/io.h c/fd-io.h
  245. c/bibop/page_alloc.o: c/bibop/page_alloc.h c/bibop/page_constants.h \
  246. c/bibop/memory.h
  247. c/bibop/memory_map.o: c/bibop/memory_map.h c/bibop/utils.h \
  248. c/bibop/page_constants.h
  249. c/bibop/areas.o: c/bibop/areas.h c/bibop/page_constants.h c/bibop/utils.h \
  250. c/bibop/memory_map.h c/bibop/area_roots.h c/bibop/gc_config.h \
  251. c/bibop/remset.h
  252. c/bibop/generation_gc.o: c/bibop/generation_gc.h c/bibop/page_constants.h \
  253. c/bibop/areas.h c/bibop/memory.h c/bibop/data.h c/bibop/utils.h \
  254. c/bibop/memory_map.h c/bibop/check_heap.h c/bibop/area_roots.h \
  255. c/bibop/measure.h c/bibop/measure.ci \
  256. c/bibop/gc_config.h c/bibop/remset.h \
  257. $(SCHEME48HS)
  258. c/bibop/find_all.o: c/bibop/find_all.h c/bibop/generation_gc.h c/bibop/areas.h \
  259. c/bibop/data.h c/bibop/memory.h \
  260. $(SCHEME48HS)
  261. c/bibop/check_heap.o: c/bibop/check_heap.h c/scheme48.h c/bibop/generation_gc.h\
  262. c/bibop/utils.h c/bibop/data.h c/bibop/memory.h c/bibop/memory_map.h \
  263. $(SCHEME48HS)
  264. c/bibop/area_roots.o: c/bibop/area_roots.h c/bibop/areas.h c/bibop/memory.h \
  265. c/bibop/memory_map.h c/bibop/measure.h c/bibop/gc_config.h \
  266. c/bibop/remset.h
  267. c/bibop/remset.o: c/bibop/remset.h c/bibop/memory.h c/scheme48.h \
  268. c/bibop/utils.h c/bibop/data.h c/bibop/generation_gc.h \
  269. c/bibop/gc_config.h \
  270. $(SCHEME48HS)
  271. # End of BIBOP GC rules
  272. $(VM): c/main.o $(LIBSCHEME48) c/scheme48.exp c/scheme48.def
  273. $(CC) $(LDFLAGS) $(LDFLAGS_VM) $(CFLAGS) -o $@ c/main.o $(LIBSCHEME48) $(LIBS)
  274. # Cygwin
  275. if test -x /usr/bin/dlltool; then \
  276. dlltool --dllname $(VM).exe --output-lib $(VM).a --def $(srcdir)/c/scheme48.def; \
  277. fi
  278. $(LIBSCHEME48): $(OBJS) $(GC_OBJS) $(UNIX_OBJS) $(LIBOBJS) $(EXTERNAL_OBJECTS)
  279. rm -f $@; \
  280. ar cq $@ $(OBJS) $(GC_OBJS) $(UNIX_OBJS) $(LIBOBJS) $(EXTERNAL_OBJECTS)
  281. ranlib $@
  282. script-interpreter: c/script-interpreter.o
  283. $(CC) $(LDFLAGS) $(CFLAGS) -o $@ c/script-interpreter.o
  284. c/main.o: c/main.c c/scheme48vm.h c/scheme48heap.h
  285. $(CC) -c $(CFLAGS) -o $@ \
  286. -DDEFAULT_IMAGE_NAME=\"$(LIB)/$(IMAGE)\" \
  287. $(CPPFLAGS) $(COMPILING_ITSELF_DEFS) $(srcdir)/c/main.c
  288. c/scheme48vm-$(BIT_SUFFIX).o: c/prescheme.h c/scheme48vm.h \
  289. c/scheme48heap.h \
  290. c/scheme48image.h c/bignum.h c/event.h \
  291. c/io.h c/fd-io.h \
  292. c/scheme48vm-prelude.h c/c-mods.h \
  293. $(SCHEME48HS)
  294. c/bignum.o: c/bignum.h c/bignumint.h $(SCHEME48HS)
  295. c/extension.o: c/sysdep.h $(FAKEHS) $(SCHEME48HS) c/scheme48vm.h
  296. c/free.o: c/sysdep.h
  297. c/ffi.o: c/ffi.h $(SCHEME48HS)
  298. c/external.o: c/sysdep.h $(FAKEHS) $(SCHEME48HS) c/c-mods.h c/ffi.h
  299. c/external-lib.o: $(SCHEME48HS)
  300. c/unix/event.o: c/sysdep.h $(FAKEHS) c/c-mods.h \
  301. c/scheme48vm.h c/scheme48heap.h \
  302. c/event.h c/fd-io.h \
  303. c/c-mods.h
  304. c/unix/fd-io.o: c/sysdep.h $(FAKEHS) c/c-mods.h \
  305. c/scheme48vm.h c/scheme48heap.h \
  306. c/event.h c/fd-io.h
  307. c/unix/misc.o: c/sysdep.h $(FAKEHS)
  308. c/unix/io.o: c/io.h
  309. c/net/address.o: $(SCHEME48HS) c/net/address.h
  310. c/net/socket.o: $(SCHEME48HS) c/net/address.h c/net/socket.h
  311. c/unix/socket.o: $(SCHEME48HS) c/net/address.h c/net/socket.h c/fd-io.h c/event.h
  312. c/net/net.o: $(SCHEME48HS)
  313. c/unix/dynlink.o: $(SCHEME48HS)
  314. c/script-interpreter.o: c/sysdep.h $(FAKEHS) c/script-interpreter.c
  315. $(CC) -c $(CFLAGS) -o $@ \
  316. -DRUNNABLE=\"$(bindir)/$(RUNNABLE)\" \
  317. $(CPPFLAGS) $(DEFS) \
  318. -I ./c -I$(srcdir)/c \
  319. $(srcdir)/c/script-interpreter.c
  320. c/fake/strerror.o: c/fake/strerror.h
  321. c/fake/langinfo.o: c/fake/langinfo.h
  322. # --------------------
  323. # Make scheme48.image from initial.image and library .scm files.
  324. #
  325. # For bootstrap reasons, initial.image is *not* listed as a source,
  326. # even though it really is.
  327. $(IMAGE): $(VM) scheme/env/init-defpackage.scm scheme/more-interfaces.scm \
  328. scheme/link-packages.scm \
  329. scheme/env-packages.scm \
  330. scheme/more-packages.scm \
  331. scheme/sort/interfaces.scm scheme/sort/packages.scm \
  332. scheme/r6rs/packages.scm \
  333. scheme/cml/interfaces.scm scheme/cml/packages.scm \
  334. scheme/net/packages.scm \
  335. scheme/posix/packages.scm scheme/srfi/packages.scm \
  336. $(usual-files) build/initial.debug build/build-usual-image
  337. $(srcdir)/build/build-usual-image $(srcdir) \
  338. "`(cd $(srcdir) && pwd)`/scheme" "`pwd`/c" '$(IMAGE)' './$(VM)' \
  339. '$(INITIAL)-$(BIT_SUFFIX)'
  340. # --------------------
  341. # Documentation
  342. MANUAL_SRC = doc/src/manual.tex doc/src/bibliography.tex \
  343. doc/src/bibliography.tex \
  344. doc/src/code.tex doc/src/command.tex doc/src/external.tex \
  345. doc/src/hacks.tex doc/src/intro.tex \
  346. doc/src/meeting.tex doc/src/module.tex doc/src/myindex.tex \
  347. doc/src/posix.tex doc/src/proto.tex doc/src/summary.tex \
  348. doc/src/thread.tex doc/src/unicode.tex doc/src/user-guide.tex \
  349. doc/src/utilities.tex doc/src/version-number.tex doc/src/matter.sty \
  350. doc/manual.pdf: $(MANUAL_SRC)
  351. cd $(srcdir)/doc/src && pdflatex manual && \
  352. makeindex manual && \
  353. pdflatex manual && pdflatex manual
  354. mv $(srcdir)/doc/src/manual.pdf $(srcdir)/doc
  355. doc/manual.ps: $(MANUAL_SRC)
  356. cd $(srcdir)/doc/src && latex manual && \
  357. makeindex manual && \
  358. latex manual && latex manual && \
  359. dvips manual
  360. mv $(srcdir)/doc/src/manual.ps $(srcdir)/doc
  361. doc/html/manual.html: doc/manual.pdf
  362. cd $(srcdir)/doc/src && tex2page manual && tex2page manual && tex2page manual
  363. doc: doc/manual.pdf doc/manual.ps doc/html/manual.html
  364. install: enough dirs
  365. # install the VM
  366. $(INSTALL_PROGRAM) $(VM) $(DESTDIR)$(LIB)
  367. if test -e $(VM).a; then $(INSTALL_PROGRAM) $(VM).a $(DESTDIR)$(LIB); fi
  368. # build and install the image
  369. rm -f '/tmp/$(IMAGE)'
  370. $(srcdir)/build/build-usual-image $(srcdir) "$(SHARE)" "$(LIB)" \
  371. "/tmp/$(IMAGE)" "./$(VM)" "$(INITIAL)-$(BIT_SUFFIX)"
  372. $(INSTALL_DATA) /tmp/$(IMAGE) $(DESTDIR)$(LIB)
  373. rm /tmp/$(IMAGE)
  374. # install the man pages
  375. $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)
  376. sed 's=LBIN=$(bindir)=g' $(srcdir)/doc/scheme48.man | \
  377. sed "s=LLIB=$(LIB)=g" | \
  378. sed "s=LS48=$(RUNNABLE)=g" >$(MANPAGE)
  379. $(INSTALL_DATA) $(MANPAGE) $(DESTDIR)$(mandir)
  380. rm $(MANPAGE)
  381. # install the include files
  382. $(INSTALL_DATA) $(srcdir)/c/scheme48.h $(DESTDIR)$(incdir)
  383. $(INSTALL_DATA) c/scheme48arch.h $(DESTDIR)$(incdir)
  384. $(INSTALL_DATA) $(srcdir)/c/scheme48write-barrier.h $(DESTDIR)$(incdir)
  385. $(INSTALL_DATA) $(srcdir)/c/scheme48.exp $(DESTDIR)$(incdir)
  386. $(INSTALL_DATA) $(srcdir)/c/scheme48.def $(DESTDIR)$(incdir)
  387. $(INSTALL_DATA) $(srcdir)/c/scheme48-external.exp $(DESTDIR)$(incdir)
  388. # install Scheme source files
  389. for stub in env big sort opt misc link posix net cml srfi r6rs; do \
  390. for f in $(srcdir)/scheme/$$stub/*.scm; do \
  391. $(INSTALL_DATA) $$f $(DESTDIR)$(SHARE)/$$stub || exit 1; \
  392. done; \
  393. done
  394. for f in $(srcdir)/scheme/rts/*num.scm \
  395. $(srcdir)/scheme/rts/jar-defrecord.scm; do \
  396. $(INSTALL_DATA) $$f $(DESTDIR)$(SHARE)/rts || exit 1; \
  397. done
  398. # install the scheme48 script
  399. script=$(DESTDIR)$(bindir)/$(RUNNABLE) && \
  400. LIB=$(LIB) && \
  401. echo "#!/bin/sh" >$$script && \
  402. echo >>$$script && \
  403. echo "lib=$$LIB" >>$$script && \
  404. echo 'exec $$lib/$(VM) -i $$lib/$(IMAGE) "$$@"' \
  405. >>$$script && \
  406. chmod +x $$script
  407. # install the script interpreter front end
  408. for dialect in r5rs srfi-7; do \
  409. $(INSTALL_PROGRAM) script-interpreter \
  410. $(DESTDIR)$(bindir)/scheme-$$dialect; \
  411. done
  412. # install the scheme48-config script
  413. config_script=$(DESTDIR)$(bindir)/$(CONFIG_SCRIPT) && \
  414. sed -e 's,@incdir\@,$(incdir),g' \
  415. -e 's,@libdir\@,$(libdir),g' \
  416. -e 's,@CC\@,$(CC),g' \
  417. -e 's,@LD\@,$(LD),g' \
  418. -e 's,@DYNAMIC_EXTERNALS_CFLAGS\@,$(DYNAMIC_EXTERNALS_CFLAGS),g' \
  419. -e 's,@DYNAMIC_EXTERNALS_LDFLAGS\@,$(DYNAMIC_EXTERNALS_LDFLAGS),g' \
  420. < $(srcdir)/build/$(CONFIG_SCRIPT).in > $$config_script && \
  421. chmod +x $$config_script
  422. # install the external modules
  423. $(INSTALL_PROGRAM) $(EXTERNALS) $(DESTDIR)$(LIB)/
  424. # install the documentation
  425. $(srcdir)/mkinstalldirs $(DESTDIR)$(docdir)
  426. $(INSTALL_DATA) $(srcdir)/COPYING $(docdir)
  427. install-doc: dirs doc
  428. $(srcdir)/mkinstalldirs $(DESTDIR)$(docdir)
  429. $(INSTALL_DATA) $(srcdir)/COPYING $(docdir)
  430. $(INSTALL_DATA) $(srcdir)/doc/manual.pdf $(docdir)
  431. $(INSTALL_DATA) $(srcdir)/doc/manual.ps $(docdir)
  432. for f in $(srcdir)/doc/html/*; do \
  433. $(INSTALL_DATA) $$f $(DESTDIR)$(docdir) || exit 1; \
  434. done
  435. # Script to run scheme48 in this directory.
  436. go:
  437. echo '#!/bin/sh' >$@ && \
  438. echo >>$@ && \
  439. echo "lib=\"`pwd`\"" >>$@ && \
  440. echo 'exec "$$lib"/$(VM) -i "$$lib"/$(IMAGE) "$$@"' \
  441. >>$@ && \
  442. chmod +x $@
  443. # Exports file for AIX and Cygwin
  444. CAT_EXPORTS = cat $(srcdir)/c/scheme48.h $(srcdir)/c/fd-io.h $(srcdir)/c/event.h $(srcdir)/c/bibop/*.h | egrep '^S48_EXTERN' | sed 's,^S48_EXTERN.*\(s48_[a-zA-Z0-9_ ]*\)(.*$$,\1,' | sed 's,^S48_EXTERN.*\(ps_[a-zA-Z0-9_ ]*\)(.*$$,\1,' | sed 's,^S48_EXTERN.*\(s48_[a-zA-Z0-9_ ]*\).*$$,\1,'
  445. c/scheme48.exp: c/scheme48.h c/fd-io.h c/event.h
  446. echo '#!..' > $(srcdir)/c/scheme48.exp && \
  447. $(CAT_EXPORTS) >> $(srcdir)/c/scheme48.exp
  448. c/scheme48.def: c/scheme48.h c/fd-io.h c/event.h
  449. echo 'EXPORTS' > $(srcdir)/c/scheme48.def && \
  450. $(CAT_EXPORTS) >> $(srcdir)/c/scheme48.def
  451. dirs:
  452. for dir in $(libdir) $(bindir) $(incdir) $(datadir); do \
  453. $(srcdir)/mkinstalldirs $(DESTDIR)$$dir || exit 1; \
  454. done
  455. $(srcdir)/mkinstalldirs $(DESTDIR)$(LIB)
  456. for dir in rts env big sort opt misc link posix net cml srfi r6rs; do \
  457. $(srcdir)/mkinstalldirs $(DESTDIR)$(SHARE)/$$dir || exit 1; \
  458. done
  459. configure: configure.in
  460. ACLOCAL="aclocal -I m4" autoreconf -v -i
  461. clean:
  462. -rm -f $(VM) script-interpreter \
  463. *.o c/unix/*.o c/posix/*.o c/net/*.o c/*.o \
  464. $(EXTERNALS) \
  465. c/fake/*.o c/bibop/*.o \
  466. c/*.a c/glue_gnu.s c/glue_darwin.s c/scheme48.exp \
  467. TAGS $(IMAGE) \
  468. $(srcdir)/build/*.tmp $(srcdir)/$(MANPAGE) \
  469. $(srcdir)/scheme/debug/*.image \
  470. $(srcdir)/scheme/debug/*.debug \
  471. $(srcdir)/scheme/vm/scheme48vm-??.c \
  472. $(srcdir)/scheme/vm/scheme48*heap-??.c \
  473. go $(distname)
  474. distclean: clean
  475. rm -f Makefile config.log config.status config-cache \
  476. c/sysdep.h c/scheme48arch.h
  477. check: $(EXTERNALS)
  478. check: $(VM) $(IMAGE) scheme/debug/check.scm
  479. ( \
  480. echo ',batch'; \
  481. echo ',exec ,load =scheme48/debug/check.scm'; \
  482. echo ',config ,load =scheme48/test-packages.scm'; \
  483. echo ',open core-test'; \
  484. echo ',open big-test'; \
  485. echo ',open sockets-test'; \
  486. echo ',open tconc-queue-test'; \
  487. echo ',open transport-link-cell-test'; \
  488. echo ',open tlc-table-test'; \
  489. echo ',open env-test'; \
  490. echo ',config ,load =scheme48/sort/test-packages.scm'; \
  491. echo ',open sort-test'; \
  492. echo ',config ,load =scheme48/misc/packages.scm'; \
  493. echo ',config ,load =scheme48/misc/test-packages.scm'; \
  494. echo ',open misc-test'; \
  495. echo ',config ,load =scheme48/r6rs/test-packages.scm'; \
  496. echo ',open r6rs-test'; \
  497. echo ',config ,load =scheme48/cml/test-packages.scm'; \
  498. echo ',open cml-test'; \
  499. echo ',config ,load =scheme48/srfi/test-packages.scm'; \
  500. echo ',open srfi-test'; \
  501. echo ',config ,load =scheme48/posix/test-packages.scm'; \
  502. echo ',open posix-test'; \
  503. echo ',config ,load =scheme48/ffi-test/test-packages.scm'; \
  504. echo ',open ffi-test'; \
  505. echo ',open test-suites'; \
  506. echo '(define-test-suite all-tests (compiler-tests core-tests big-tests tcp-sockets-tests tconc-queue-tests transport-link-cell-tests tlc-table-tests tlc-table-weak-tests tlc-table-string-tests sort-tests misc-tests env-tests r6rs-tests cml-tests srfi-tests posix-tests ffi-tests))'; \
  507. echo '(run-test-suite all-tests)' \
  508. ) | ./$(VM) -i $(IMAGE) $(BIG_HEAP)
  509. # --------------------
  510. # Rules from here on down are not essential for the basic installation
  511. # procedure.
  512. all: vm image $(LIBSCHEME48) script-interpreter go doc
  513. libscheme48: $(LIBSCHEME48)
  514. vm: $(VM)
  515. image: $(INITIAL)-$(BIT_SUFFIX)
  516. $(MAKE) $(IMAGE)
  517. test: check
  518. tags:
  519. find . -name "*.scm" -o -name "*.c" -o -name "*.h" | etags -
  520. # --------------------
  521. # Distribution...
  522. # DISTFILES should include all sources.
  523. DISTFILES = README COPYING.rtf COPYING INSTALL WINDOWS.txt \
  524. configure configure.in config.sub config.guess \
  525. acconfig.h Makefile.in \
  526. scheme48.sln scheme48.vcproj \
  527. mkinstalldirs install-sh \
  528. doc/*.ps doc/*.pdf doc/*.txt \
  529. doc/html/*.html doc/html/*.css doc/html/*.gif \
  530. doc/src/*.tex doc/src/*.sty doc/src/*.scm \
  531. doc/scheme48.man \
  532. emacs/README \
  533. build/*.scm build/*-version-number build/*.exec \
  534. build/*.lisp build/build-usual-image build/filenames.make \
  535. build/initial.debug \
  536. build/initial.image-32 build/initial.image-64 \
  537. build/*.bat build/*.sh build/*.rc \
  538. build/UnicodeData.txt build/PropList.txt \
  539. build/SpecialCasing.txt build/CaseFolding.txt \
  540. build/CompositionExclusions.txt \
  541. build/dummy build/*.wxs \
  542. build/*.bmp build/*.ico \
  543. build/scheme48-config.in \
  544. c/*.[ch] c/*/*.[ch] c/*/*.ci c/*.exp c/*.def \
  545. c/scheme48.h.in \
  546. c/scheme48write-barrier.h c/scheme48arch.h.in \
  547. emacs/*.el gdbinit \
  548. scheme/*.scm scheme/*/*.scm scheme/vm/*/*.scm \
  549. ps-compiler/minor-version-number \
  550. ps-compiler/doc/node.txt ps-compiler/doc/todo.txt \
  551. ps-compiler/*.scm ps-compiler/*/*.scm \
  552. ps-compiler/prescheme/primop/*.scm \
  553. ps-compiler/prescheme/test/*.scm \
  554. c/sysdep.h.in
  555. distname = scheme48-$(VERSION)
  556. dist: build/initial.image-32 build/initial.image-64 c/scheme48.h
  557. distname=$(distname) && \
  558. distfile=$(distdir)/$$distname.tgz && \
  559. if [ -d $(distdir) ] && \
  560. [ -w $$distfile -o -w $(distdir) ]; then \
  561. cd $(srcdir) && \
  562. rm -f $$distname && \
  563. ln -s . $$distname && \
  564. files='' && \
  565. for i in $(DISTFILES); do \
  566. if [ "$$i" != "c/sysdep.h" ]; then \
  567. files="$$files $$distname/$$i"; \
  568. fi \
  569. done && \
  570. tar -cf - $$files | \
  571. gzip --best >$$distfile && \
  572. rm $$distname; \
  573. else \
  574. echo "Can't write $$distfile" >&2; \
  575. exit 1; \
  576. fi
  577. # Increment the minor version number
  578. inc:
  579. f=build/minor-version-number && \
  580. expr `cat $$f` + 1 >$$f.tmp && \
  581. mv $$f.tmp $$f && \
  582. cp $$f doc/src/version-number.tex && \
  583. echo '(define version-info "1.'`cat $$f`'")' \
  584. >scheme/env/version-info.scm
  585. # --------------------
  586. # Generate build/filenames.make from *packages.scm
  587. #
  588. # This hack traces the module dependencies described in the
  589. # various configuration files and converts them into dependency lists
  590. # that "make" can use for its purposes.
  591. #
  592. # Since the distribution comes with a filenames.make, this rule
  593. # shouldn't be invoked for simple installations. But it will be used
  594. # if you change any of the *-packages.scm files.
  595. #
  596. # You can actually run the forms in extract-filenames.scm in any Scheme
  597. # implementation that has syntax-rules and explicit-renaming low-level
  598. # macros (e.g., most versions of Scheme 48 and Pseudoscheme).
  599. # If there are errors running this script, and you need to debug,
  600. # don't use the initial.image, use something that has a reasonable
  601. # environment.
  602. #
  603. # If this fails and you don't feel like debugging or fixing the problem,
  604. # try "touch filenames.make" and hope for the best.
  605. PACKAGES=scheme/packages.scm scheme/rts-packages.scm scheme/alt-packages.scm \
  606. scheme/comp-packages.scm scheme/initial-packages.scm \
  607. scheme/link-packages.scm \
  608. scheme/env-packages.scm \
  609. scheme/sort/packages.scm scheme/more-packages.scm \
  610. scheme/cml/packages.scm scheme/r6rs/packages.scm
  611. $(srcdir)/build/filenames.make: $(PACKAGES) build/extract-filenames.scm
  612. # uncomment this if you activate the line below:
  613. # $(MAKE) $(VM) PACKAGES=
  614. cd $(srcdir) && \
  615. $(RUNNABLE) -a batch <build/extract-filenames.scm
  616. # or: ./$(VM) -i $(srcdir)/$(INITIAL)-$(BIT_SUFFIX) -a batch <build/extract-filenames.scm
  617. # --------------------
  618. # Static linker
  619. #
  620. # The linker is capable of rebuilding an image from sources, even
  621. # across an incompatible change in VM data representations.
  622. # Bootstrap from Lucid Common Lisp: (last tested with
  623. # Pseudoscheme 2.9 and Scheme 48 version 0.19)
  624. PSEUDODIR = ../pseudo
  625. link/linker-in-lucid: build/lucid-script.lisp $(linker-files) \
  626. scheme/alt/pseudoscheme-features.scm \
  627. scheme/alt/pseudoscheme-record.scm
  628. (echo \(defvar pseudoscheme-directory \"$(PSEUDODIR)/\"\); \
  629. cat build/lucid-script.lisp; \
  630. echo \(dump-linker\) \(lcl:quit\)) \
  631. | lisp
  632. # --------------------
  633. # Initial image
  634. #
  635. # The initial.image is built by the static linker. The image contains
  636. # Scheme, the byte-code compiler, and a minimal command processor, but
  637. # no debugging environment to speak of.
  638. $(INITIAL)-32: $(CONFIG_FILES) build/initial.scm \
  639. scheme/platform-interfaces.scm scheme/rts-packages-32.scm \
  640. scheme/alt/low-exception.scm \
  641. scheme/alt/init-defpackage.scm \
  642. $(initial-files) $(linker-files)
  643. cd $(srcdir) && \
  644. ($(START_LINKER-32); \
  645. echo '(load-configuration "scheme/platform-interfaces.scm")'; \
  646. echo '(load-configuration "scheme/rts-packages-32.scm")'; \
  647. echo '(load-configuration "scheme/interfaces.scm")'; \
  648. echo '(load-configuration "scheme/vm/shared-interfaces.scm")'; \
  649. echo '(load-configuration "scheme/packages.scm")'; \
  650. echo '(flatload initial-structures)'; \
  651. echo '(load "build/initial.scm")'; \
  652. echo '(link-initial-system)' \
  653. ) | $(LINKER_RUNNABLE)
  654. mv $(INITIAL) $@
  655. $(INITIAL)-64: $(CONFIG_FILES) build/initial.scm \
  656. scheme/platform-interfaces.scm scheme/rts-packages-64.scm \
  657. scheme/alt/low-exception.scm \
  658. scheme/alt/init-defpackage.scm \
  659. $(initial-files) $(linker-files)
  660. cd $(srcdir) && \
  661. ($(START_LINKER-64); \
  662. echo '(load-configuration "scheme/platform-interfaces.scm")'; \
  663. echo '(load-configuration "scheme/rts-packages-64.scm")'; \
  664. echo '(load-configuration "scheme/interfaces.scm")'; \
  665. echo '(load-configuration "scheme/vm/shared-interfaces.scm")'; \
  666. echo '(load-configuration "scheme/packages.scm")'; \
  667. echo '(flatload initial-structures)'; \
  668. echo '(load "build/initial.scm")'; \
  669. echo '(link-initial-system)' \
  670. ) | $(LINKER_RUNNABLE)
  671. mv $(INITIAL) $@
  672. # --------------------
  673. # Various small images for debugging low-level changes
  674. LOAD_DEBUG = \
  675. $(START_LINKER-32); \
  676. echo \(load-configuration \"scheme/interfaces.scm\"\); \
  677. echo \(load-configuration \"scheme/packages.scm\"\); \
  678. echo \(load-configuration \"scheme/vm/shared-interfaces.scm\"\); \
  679. echo \(flatload debug-structures\)
  680. scheme/debug/tiny.image: scheme/debug/tiny-packages.scm \
  681. scheme/debug/tiny.scm
  682. cd $(srcdir) && \
  683. ($(START_LINKER-32); \
  684. echo \(load-configuration \"scheme/debug/tiny-packages.scm\"\); \
  685. echo \(link-simple-system \'\(scheme/debug tiny\) \'start tiny-system\)) \
  686. | $(LINKER_RUNNABLE)
  687. scheme/debug/low-test.image: scheme/debug/low-test-packages.scm \
  688. scheme/debug/low-test.scm
  689. cd $(srcdir) && \
  690. ($(START_LINKER-32); \
  691. echo \(load-configuration \"scheme/debug/low-test-packages.scm\"\); \
  692. echo \(link-simple-system \'\(scheme/debug low-test\) \'start low-test-system\)) \
  693. | $(LINKER_RUNNABLE)
  694. scheme/debug/bignum-test.image: scheme/debug/low-test-packages.scm \
  695. scheme/debug/bignum-test.scm
  696. cd $(srcdir) && \
  697. ($(START_LINKER-32); \
  698. echo \(load-configuration \"scheme/debug/low-test-packages.scm\"\); \
  699. echo \(link-simple-system \'\(scheme/debug bignum-test\) \'start bignum-test-system\)) \
  700. | $(LINKER_RUNNABLE)
  701. scheme/debug/little.image: $(CONFIG_FILES) scheme/debug-packages.scm
  702. cd $(srcdir) && \
  703. ($(LOAD_DEBUG); echo \(link-little-system\)) \
  704. | $(LINKER_RUNNABLE)
  705. scheme/debug/mini.image: $(CONFIG_FILES)
  706. cd $(srcdir) && \
  707. ($(LOAD_DEBUG); echo \(link-mini-system\)) \
  708. | $(LINKER_RUNNABLE)
  709. scheme/debug/medium.image: $(CONFIG_FILES)
  710. cd $(srcdir) && \
  711. ($(LOAD_DEBUG); echo \(flatload compiler-structures\); \
  712. echo \(link-medium-system\)) \
  713. | $(LINKER_RUNNABLE)
  714. # The following have not been updated for the new directory organization
  715. c/smain.o: c/main.c
  716. $(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) -DSTATIC_AREAS -o $@ $(srcdir)/c/main.c
  717. mini: mini-heap.o smain.o
  718. $(CC) $(LDFLAGS) $(CFLAGS) -o $@ c/smain.o mini-heap.o $(OBJS) $(LIBS)
  719. mini-heap.o: mini-heap.c
  720. $(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) -o $@ $(srcdir)/mini-heap.c
  721. mini-heap.c: scheme/debug/mini1.image
  722. (echo ,exec ,load misc/load-static.scm; \
  723. echo \(do-it 150000 \"$(srcdir)/scheme/debug/mini1.image\" \"$@\"\)) \
  724. | $(RUNNABLE) -h 3000000 -a batch
  725. scheme/debug/mini1.image: $(VM) scheme/debug/mini.image
  726. echo "(write-image \"scheme/debug/mini1.image\" \
  727. (usual-resumer (lambda (args) \
  728. (command-processor #f args))) \
  729. \"foo\")" \
  730. | ./$(VM) -i scheme/debug/mini.image -a batch
  731. # --------------------
  732. # Generate unicode-info.scm, srfi-14-base-char-set.scm, and unicode-normalization-info
  733. # from UnicodeData.txt
  734. # Get fresh UnicodeData.txt from http://www.unicode.org.
  735. scheme/rts/syntax-info.scm: build/UnicodeData.txt \
  736. build/PropList.txt \
  737. build/SpecialCasing.txt \
  738. build/CaseFolding.txt \
  739. build/CompositionExclusions.txt \
  740. scheme/link/unicode-data.scm \
  741. scheme/env/unicode-category.scm \
  742. scheme/big/compact-table.scm
  743. cd $(srcdir) && \
  744. (echo ',batch'; \
  745. echo ',config ,load scheme/link/unicode-data-packages.scm'; \
  746. 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\")" \
  747. ) | $(RUNNABLE) -h 6000000
  748. # --------------------
  749. # Generate scheme48.h from VM sources
  750. c/scheme48.h: c/scheme48.h.in scheme/vm/interp/arch.scm \
  751. scheme/vm/data/data.scm scheme/link/generate-c-header.scm
  752. cd $(srcdir) && \
  753. (echo ',bench'; \
  754. echo ',batch'; \
  755. echo ',load-package big-scheme'; \
  756. echo ',open big-scheme'; \
  757. echo ',load scheme/link/generate-c-header.scm'; \
  758. echo "(make-c-header-file \"$@\" \
  759. \"c/scheme48.h.in\" \
  760. \"scheme/vm/interp/arch.scm\" \
  761. \"scheme/vm/data/data.scm\" \
  762. \"scheme/rts/record.scm\")" \
  763. ) | $(RUNNABLE)
  764. # An old version of the above for legacy code.
  765. c/old-scheme48.h: scheme/vm/interp/arch.scm scheme/vm/data/data.scm \
  766. scheme/link/generate-old-c-header.scm
  767. (echo ',bench'; \
  768. echo ',batch'; \
  769. echo ',load-package big-scheme'; \
  770. echo ',open big-scheme'; \
  771. echo ',load scheme/link/generate-old-c-header.scm'; \
  772. echo "(make-c-header-file \"$@\" \
  773. \"$(srcdir)/scheme/vm/interp/arch.scm\" \
  774. \"$(srcdir)/scheme/vm/data/data.scm\")" \
  775. ) | $(RUNNABLE)
  776. # Generate VM and GC from VM sources.
  777. # Never called automatically. Do not use unless you are sure you
  778. # know what you are doing.
  779. # Afterwards, you should probably make c/scheme48.h.
  780. i-know-what-i-am-doing: \
  781. compile-vm-32 compile-twospace-gc-32 compile-bibop-gc-32 \
  782. compile-vm-64 compile-twospace-gc-64 compile-bibop-gc-64
  783. # compiles VM without GC
  784. compile-vm-32:
  785. cd $(srcdir)/ps-compiler && \
  786. (echo ',batch'; \
  787. echo ',config ,load ../scheme/platform-interfaces.scm'; \
  788. echo ',config ,load ../scheme/rts-packages-32.scm'; \
  789. echo ',config ,load ../scheme/prescheme/interface.scm'; \
  790. echo ',config ,load ../scheme/prescheme/package-defs.scm'; \
  791. echo ',exec ,load load-ps-compiler.scm'; \
  792. echo ',exec ,load compile-vm-no-gc-32.scm'; \
  793. echo ',exit' \
  794. ) | $(RUNNABLE) -h 12000000 && \
  795. mv ../scheme/vm/scheme48vm-32.c ../c
  796. compile-vm-64:
  797. cd $(srcdir)/ps-compiler && \
  798. (echo ',batch'; \
  799. echo ',config ,load ../scheme/platform-interfaces.scm'; \
  800. echo ',config ,load ../scheme/rts-packages-64.scm'; \
  801. echo ',config ,load ../scheme/prescheme/interface.scm'; \
  802. echo ',config ,load ../scheme/prescheme/package-defs.scm'; \
  803. echo ',exec ,load load-ps-compiler.scm'; \
  804. echo ',exec ,load compile-vm-no-gc-64.scm'; \
  805. echo ',exit' \
  806. ) | $(RUNNABLE) -h 12000000 && \
  807. mv ../scheme/vm/scheme48vm-64.c ../c
  808. # compiles the two-space copier GC
  809. compile-twospace-gc-32:
  810. cd $(srcdir)/ps-compiler && \
  811. (echo ',batch'; \
  812. echo ',config ,load ../scheme/platform-interfaces.scm'; \
  813. echo ',config ,load ../scheme/rts-packages-32.scm'; \
  814. echo ',config ,load ../scheme/prescheme/interface.scm'; \
  815. echo ',config ,load ../scheme/prescheme/package-defs.scm'; \
  816. echo ',exec ,load load-ps-compiler.scm'; \
  817. echo ',exec ,load compile-twospace-gc-32.scm'; \
  818. echo ',exit' \
  819. ) | $(RUNNABLE) -h 8000000 && \
  820. mv ../scheme/vm/scheme48-twospace-heap-32.c ../c
  821. compile-twospace-gc-64:
  822. cd $(srcdir)/ps-compiler && \
  823. (echo ',batch'; \
  824. echo ',config ,load ../scheme/platform-interfaces.scm'; \
  825. echo ',config ,load ../scheme/rts-packages-64.scm'; \
  826. echo ',config ,load ../scheme/prescheme/interface.scm'; \
  827. echo ',config ,load ../scheme/prescheme/package-defs.scm'; \
  828. echo ',exec ,load load-ps-compiler.scm'; \
  829. echo ',exec ,load compile-twospace-gc-64.scm'; \
  830. echo ',exit' \
  831. ) | $(RUNNABLE) -h 8000000 && \
  832. mv ../scheme/vm/scheme48-twospace-heap-64.c ../c
  833. # compiles the BIBOP GC
  834. compile-bibop-gc-32:
  835. cd $(srcdir)/ps-compiler && \
  836. (echo ',batch'; \
  837. echo ',config ,load ../scheme/platform-interfaces.scm'; \
  838. echo ',config ,load ../scheme/rts-packages-32.scm'; \
  839. echo ',config ,load ../scheme/prescheme/interface.scm'; \
  840. echo ',config ,load ../scheme/prescheme/package-defs.scm'; \
  841. echo ',exec ,load load-ps-compiler.scm'; \
  842. echo ',exec ,load compile-bibop-gc-32.scm'; \
  843. echo ',exit' \
  844. ) | $(RUNNABLE) -h 8000000 && \
  845. mv ../scheme/vm/scheme48-bibop-heap-32.c ../c
  846. compile-bibop-gc-64:
  847. cd $(srcdir)/ps-compiler && \
  848. (echo ',batch'; \
  849. echo ',config ,load ../scheme/platform-interfaces.scm'; \
  850. echo ',config ,load ../scheme/rts-packages-64.scm'; \
  851. echo ',config ,load ../scheme/prescheme/interface.scm'; \
  852. echo ',config ,load ../scheme/prescheme/package-defs.scm'; \
  853. echo ',exec ,load load-ps-compiler.scm'; \
  854. echo ',exec ,load compile-bibop-gc-64.scm'; \
  855. echo ',exit' \
  856. ) | $(RUNNABLE) -h 8000000 && \
  857. mv ../scheme/vm/scheme48-bibop-heap-64.c ../c