Doco Home Tools Home
Platypus Tools - Makefile System
Documentation in progress
Structure of Makefiles
Each directory in the src/ tree contains a Makefile. Each of these
Makefiles has a similar structure. Each Makefile "includes" config.mk in the
app root directory, which in turn "includes" stdrules.mk in the Platypus
root directory.
The Makefile iteslf sets variables describing the files in that
directory (mostly POs) and what subdirectories it has.
The config.mk file sets variables global to the application.
The stdrules.mk file contains the Make rules for compiling the app.
Usually, the Makefile and config.mk do not have any Make rules before
their respective "includes", so the first rule in stdrules.mk is the default
rule for the Makefile system.
The variables used in the Makefile system, including those set in the
Makefile and config.mk, are documented in stdrules.mk.
- A directory's Makefile is structured as follows:
-
- Set directory specific variables
- Set variables containing lists of POs and subdirectories.
- Include config.mk ...
-
- Set application-wide variables
- Set variables giving location of tools, such as JDK.
- Include stdrules.mk ...
-
- Documentation
- Licence and conditions
Description of variables
- Setting variables
-
- Top level rules (eg, build_all, build_1, java_pass1)
- Invoke sanity checking in top directory
Define what "stages" are processed in each pass.
- Stage rules (eg, do_xmlc_html_targets, do_po_java_targets)
- Map stages (like generating the DOM classes, generating skeleton Java)
into into individual files.
The stages are generic to all Platypus applications, but the individual
files are specific to a particular app.
- Miscellaneous rules
- Rules to make Javadoc, clean directories, etc.
- File rules (eg classes/timesheet/presentation/WelcomeFrameset.class)
-
- More miscellaneous rules
- Checking all required tools are present, writing Make run header.
- ... end of stdrules.mk
-
- ... end of config.mk
-
- Make rules specific to the directory, such as
clean::
-
Passes through directory tree
The Makefile system has three major passes. In each of these passes, it
walks through the entire directory tree structure.
- Pass 1
- Generate DOM classes
Generate skeleton PO configuration files
Attempt to merge changes in generated PO configuration with hand-edits
- Pass 2
- Generate skeleton Java
(Note: no merging of generated and hand-edited code is attempted.)
- Pass 3
- Compile Java
Major rules
-
build_all
- Default rule.
Invokes check_sanity
, java_pass1
,
java_pass2
, java_pass3
, and some less important
rules.
-
build_1
, build_2
, build_3
- Similar to
build_all
, but only invoke a subset of the passes.
-
java_pass1
, java_pass2
, java_pass3
- Invoke the stage rules needed for this pass.
Manage invoking make in subdirectories.
-
-
-
-
Frameset pages
XMLC needs a special flag to handle frameset pages. The Makefile system
will invoke an appropriate rule if the PO's name ends with "Framset" - eg
"WelcomeFrameset.html".