Difference between revisions of "Fiji/Build System"

(Calling Fake: passing targets, variables)
(The Fiji build system is not supported; there is no Build.sh anymore)
(13 intermediate revisions by 6 users not shown)
Line 1: Line 1:
== Introduction ==
#REDIRECT [[Development]]
Fake is Fiji's build system (''Fiji's mAKE'').  Its goal is to make it extremely simple to define the tasks that are needed for Fiji.
Fake finds its ''targets'' in a file called ''Fakefile''.  An example ''Fakefile'' looks like this:
all <- example.jar another-example.jar
example.jar <- example/**/*.java README LICENSE
another-example.jar <- SomeClass.java
This file defines three targets: the default target called 'all', and two targets building .jar files.  The operation is defined implicitly by the name of the target.
== Nomenclature ==
The ''Fakefile'' contains ''rules'' for ''targets'' that are defined in the following form:
target <- prerequisites
If a prerequisite is also the target of another rule, Fake builds that target before building the current one.
== Calling Fake ==
If you have a working Fiji launcher, you can call Fake like this:
./fiji --fake
If your Fiji launcher does not work, but you have a working Java, call Fake like this:
java -jar precompiled/fake.jar
You can ask Fake to build only specific targets by passing them as parameters:
./fiji --fake ij.jar
Further, all variable definitions passed as parameters will override what is found in the Fakefile:
./fiji --fake debug=true fake.jar
== Target types ==
The following target types are available:
;The ''all'' target:
:The first target in the ''Fakefile'' is always the default target. It lists all subtargets that are to be made by default.
;''.jar'' targets:
:If the target name ends with ''.jar'', a .jar is made.  If the last prerequisite also ends in ''.jar'', Fake will copy that file instead of trying to compile ''.java'' files.
:Fake is actually quite clever when it comes to putting the compiled classes into the ''.jar'' files; it figures out in which package the class lives, and uses the corresponding path.
;''.class'' targets:
:Targets whose name end in ''.class'' compile a single ''.java'' file (the last prerequisite is used to define that), and copies the resulting ''.class'' file (and the other generated classes that are used by this class) to the given destination.
;''.cxx'' and '.c' targets:
:If the last prerequisite ends in ''.cxx'' or ''.c'', the GNU C compiler is called to compile the prerequisites.
;"SubFake" targets:
:If the last prerequisite specifies a directory, Fake looks for a ''Fakefile'' or a ''Makefile'' there.  According to what was found, Fake or ''make'' is called, and the target is copied over to the given destination.
;Special targets:
:Some targets are predefined, but can be overridden in the ''Fakefile''.  These include ''clean'', ''show-vars'' and others.
== Special targets ==
:Remove all generated targets.  This target is not well tested.  '''Use with care'''.
:Show all defined variables
:Show all rules (with expanded variables)
:Instead of building the targets, this target just shows which targets are not up to date and would be built.
== Variables ==
== Other features ==
=== Precompiled targets ===

Latest revision as of 12:38, 12 August 2019

Redirect to: