1
0

builder-notes.txt 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. build.go notes
  2. ----------------
  3. build.go compiles Harvey's libraries, kernel, and applications. Rather than having mkfiles and running the 'mk' command, we describe the projects in JSON files and run 'build' on them. See sys/src/cmds/cmds.json for an example.
  4. Here's some notes on what the individual fields of the JSON files do:
  5. Name: names the current config. For now, you can only have one config per file, but later you may be able to have more than one.
  6. Projects: sub-projects. Subdirectory Makefiles essentially. These get built BEFORE pretty much anything else, including Pre commands
  7. Pre: commands to run before compilation
  8. Post: Commands to run after compilation
  9. Cflags, Oflags: self-explanatory
  10. Include: additional json files to be read in and processed. For instance include Cflags and Oflags that many configs may use
  11. ObjectFiles: you don't define this in the .json, it's build from the SourceFiles element by stripping the .c and adding .o
  12. Libs: libraries that need to be linked in
  13. Env: things to stick in the environment.
  14. SourceFilesCmd: list files that should be built into separate commands. This is the mkmany paradigm; if you list "aan.c", we will first build "aan.o", then link it to create "aan".
  15. SourceFiles: list files that get built into a single binary. Mkone.
  16. Program: The name of the program we want to output, assuming we're using SourceFiles instead of SourceFilesCmd.
  17. Install: this is the directory where your program(s) will be placed after compiling and linking.
  18. Library: the name of the .a file we want to generate. Currently ignored! We just stick an ar command in the Post commands, which is pretty naughty.