Makefile.in 39 KB

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