Browse Source

util/build: added some notes on the builder

A little documentation on the fields in your .json files, based on
observations of the build.go code.

Change-Id: I7dbde59b4a34acccd450dd97e0a58d221004d976
John Floren 8 years ago
parent
commit
a40a33a627
1 changed files with 34 additions and 0 deletions
  1. 34 0
      util/builder-notes.txt

+ 34 - 0
util/builder-notes.txt

@@ -0,0 +1,34 @@
+build.go notes
+----------------
+
+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.
+
+Here's some notes on what the individual fields of the JSON files do:
+
+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.
+
+Projects: sub-projects. Subdirectory Makefiles essentially. These get built BEFORE pretty much anything else, including Pre commands
+
+Pre: commands to run before compilation
+
+Post: Commands to run after compilation
+
+Cflags, Oflags: self-explanatory
+
+Include: additional json files to be read in and processed. For instance include Cflags and Oflags that many configs may use
+
+ObjectFiles: you don't define this in the .json, it's build from the SourceFiles element by stripping the .c and adding .o
+
+Libs: libraries that need to be linked in
+
+Env: things to stick in the environment.
+
+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".
+
+SourceFiles: list files that get built into a single binary. Mkone.
+
+Program: The name of the program we want to output, assuming we're using SourceFiles instead of SourceFilesCmd.
+
+Install: this is the directory where your program(s) will be placed after compiling and linking.
+
+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.