Makefile.in 37 KB

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