1 2 3 4 5 6 7 8 9 10 11
12 /*!
13 * ======== SourceDir ========
14 * Manage config generated source directories
15 *
16 * Every "product" can generate a collection of source files that
17 * must be compiled into a single library and linked with the
18 * application. Each collection of source files is placed in a
19 * subdirectory of a top-level directory and contains a GNU make file,
20 * named makefile, which builds the library.
21 *
22 * This module generates a top-level makefile that builds all "product"
23 * libraries, the top-level directory that houses the "product"
24 * sub-directories, and any files necessary for integration with eclipse/CDT
25 * managed make. The generated "product" files need only ensure their
26 * sources can be built via their generated makefile (from their
27 * sub-directory).
28 */
29 @Template("./SourceDir.xdt")
30 metaonly module SourceDir
31 {
32 /*!
33 * ======== outputDir ========
34 * Top-level directory for config generated sources and makefiles
35 *
36 * This directory path can be either an absolute path or a path
37 * relative to the build working directory at the time source files
38 * are generated (this is NOT necessarily the same as the build
39 * directory at the time the generated sources are built!)
40 *
41 * If `outputDir` is not set, files will be output to the `./src`
42 * sub-directory of the directory containing the configuration script.
43 */
44 config String outputDir;
45
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
66 config String toBuildDir;
67
68 /*!
69 * ======== makefileName ========
70 * Top-level makfile name
71 *
72 * This name is the base name of the makefile which is created in
73 * `outputDir`.
74 */
75 config String makefileName = "makefile.libs";
76
77 /*!
78 * ======== verbose ========
79 * Output progress messages during a build
80 *
81 * Positive values cause additional progress messages to be displayed.
82 * The greater the value, the more information is displayed.
83 */
84 config Int verbose = 0;
85
86 /*!
87 * ======== getRelativePath ========
88 */
89 metaonly String getRelativePath(String fm, String to);
90
91 /*!
92 * ======== build ========
93 * Run make using the generated makefiles
94 */
95 metaonly Int build();
96
97 instance:
98 99 100
101 create(String name);
102
103 /*!
104 * ======== getName ========
105 */
106 metaonly String getName();
107
108 /*!
109 * ======== getGenSourceDir ========
110 * Get name of the output directory for this set of source files
111 *
112 * The name is either an absolute path or a path relative to the
113 * build directory at the time configuration is run.
114 */
115 metaonly String getGenSourceDir();
116
117 /*!
118 * ======== getGenLibraryName ========
119 * Get name of the output library for this set of source files
120 *
121 * The name is either an absolute path or a path relative to the
122 * build directory at the time configuration is run.
123 */
124 metaonly String getGenLibraryName();
125
126 /*!
127 * ======== sourceDir ========
128 * Source directory for a specific "product's" generated sources
129 *
130 * This path must be relative to `outputDir`.
131 */
132 config String sourceDir;
133
134 /*!
135 * ======== libraryName ========
136 * Name of library of compiled sources in `sourceDir`
137 *
138 * This path must be relative to `outputDir`.
139 */
140 config String libraryName;
141 }
142 143 144
145