scons-build-system-readme.txt 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. Introduction:
  2. ------------
  3. This package contains a new build system that I put together for
  4. NakedMud using the python based build tool SCons
  5. (http://www.scons.org). It compiles the unmodified codebase without
  6. errors and uses distutils to determine the python include path (unlike
  7. the bundled make-based system). It will also pass the appropriate
  8. options to the linker (e.g., -Xlinker -export-dynamic). Well, at least
  9. it does the right thing on my system.
  10. Installation:
  11. ------------
  12. Extract the tarball into the src directory of your NakedMud. If you
  13. haven't added any C modules, just skip ahead to the build command
  14. list.
  15. You'll have to add the module name to the list of modules in the
  16. SConstruct file (in the source directory: it's SCons' equivalent to
  17. the top-level Makefile):
  18. Have a look for this line in the SConstruct:
  19. modules += ['time', 'socials', 'alias', 'help']
  20. And add your custom modules to the end of the list.
  21. Basic Usage:
  22. -----------
  23. To build, simply run `scons`. To clean, run `scons -c` (unlike Make,
  24. SCons can work out what it's built and delete it). To make a backup,
  25. run `scons backup` (caveat: this won't clean first like the Makefile
  26. does. You'll have to run `scons -c` by hand).
  27. Advanced Usage:
  28. --------------
  29. If, for some reason, a module needs to tinker with the build process,
  30. it an do so by creating a file called SConscript in the top of the
  31. module subdirectory. This file will be parsed by SCons before
  32. compiling anything, and can interact with the build environment using
  33. normal SCons commands. The build environment will need to be imported
  34. with the following line in the SConscript:
  35. Import('nakedmud')
  36. The presence of a file called .suppress in the top of a module's
  37. subdirectory will also influence the build process:
  38. - Each .c file named in the .suppress file will not be compiled or
  39. linked into the NakedMud binary.
  40. - If the .suppress file contains a line called 'all', no .c file in
  41. that module directory will be compiled or linked.
  42. Closing Remarks:
  43. ---------------
  44. I've tested with Python 2.4.3, NakedMud 3.2.1, NakedMud 3.3a, SCons
  45. 0.96.91 and 0.96.92. Hopefully it should be fairly easy to follow.
  46. Oh, and there's no restrictions on its use.
  47. Enjoy,
  48. Jack Kelly
  49. ChangeLog:
  50. ---------
  51. Version 1.2 (19 Dec 2006):
  52. * Doesn't guess the LINKFLAGS when sys.platform == 'darwin': it seems
  53. to cause breakage on OSX 10.4. Apparently it still works without it.
  54. Version 1.1 (10 Nov 2006):
  55. * Builds the list of C files to compile automatically using glob.
  56. * SConscript files in the module subdirectories are now optional. They
  57. will be sourced if they exist, if a module needs to modify the build
  58. environment in some strange way. The environment can be imported
  59. with the line:
  60. Import('nakedmud')
  61. * The presence of a file called .suppress in the top of a module's
  62. subdirectory will influence the build process:
  63. - Each .c file named in the .suppress file will not be compiled or
  64. linked into the NakedMud binary.
  65. - If the .suppress file contains a line called 'all', no .c file in
  66. that module directory will be compiled or linked.
  67. Version 1.0 (29 Oct 2006):
  68. * Initial Version