File: mmake.1

package info (click to toggle)
mmake 2.3-7
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 316 kB
  • ctags: 73
  • sloc: perl: 403; makefile: 273; sh: 152; java: 17
file content (313 lines) | stat: -rw-r--r-- 11,466 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  | will give a
.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
.\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
..
.    nr % 0
.    rr F
.\}
.\"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "MMAKE 1"
.TH MMAKE 1 "www.tildeslash.com" "April 2. 2004" "User Commands"
.SH "NAME"
.Vb 1
\& mmake - generate a Java Makefile
.Ve
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& mmake [ \-d | \-v ]
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
This program will generate a Makefile for Java source files. Use the
\&\fI\-d\fR option to accept all defaults.
.PP
After running mmake, you will obtain a Makefile in the directory from
where you started the program. The Makefile will handle java files in
the current directory and in any sub\-directories.
.PP
Use the generated Makefile with mmake as follows:
.PP
To compile Java files just type \fBmake\fR. It's also possible to run
make with one of the following targets: \fIdoc, clean, help, jar,
srcjar, bundle, install, uninstall, tags and depend\fR Where 'make doc'
runs javadoc on the source files, it will only work for files in a
package. The command 'make clean' removes class files and other
temporary files. The command 'make jar' creates a jar file with all
class files (and other files of your choice, see the \s-1JAR_OBJS\s0 variable
in the Makefile). The command 'make srcjar' creates a jar file with
all java files. The command 'make bundle' creates a Mac \s-1OS\s0 X
Application Bundle with all the jar file. The command 'make install'
will install a jar file, app bundle, class files and any shell
wrappers you have made. (A shell script must have the extension .sh to
be installed). Use 'make uninstall' to remove installed files. The
command 'make help', shows a help text with available targets. The
command 'make tags' will generate a tag file for Emacs. And finally
the command 'make depend' creates a dependency graph for the class
files. (The dependency graph will be put in a file called
\&\fImakefile.dep\fR, which is included in the Makefile)
.PP
You don't have to run mmake each time you add a new java file to your
project. You can add as many new java files as you like, the Makefile
will find them. This is the case as long as you don't add a new
package. In that case, you must either run mmake again or update the
\&\s-1PACKAGE\s0 variable in the Makefile. This is because the Makefile uses
this variable to find directories with java files.
.PP
The program mmake is able to create a dependency graph for your java
files. To do this, it needs the \fIjikes\fR compiler from \s-1IBM\s0. Get jikes
from \fBhttp://www.ibm.com/developerworks/oss/jikes/\fR.You would
probably be more content with jikes anyhow, since it is much faster
than javac. To create a dependencies graph, do a \fImake clean\fR before
running \fImake depend\fR.
.SH "A NOTE ON INSTALLATION"
.IX Header "A NOTE ON INSTALLATION"
The Makefile created with mmake will do a fair job installing the
different files that makes up your system. It uses the following
Makefile variables when it conducts the install routine:
.IP "\(bu" 4
\&\s-1PREFIX\s0
.IP "\(bu" 4
\&\s-1CLASS_DIR\s0
.IP "\(bu" 4
\&\s-1JAR_DIR\s0
.IP "\(bu" 4
\&\s-1BUNDLE_DIR\s0
.IP "\(bu" 4
\&\s-1DOC_DIR\s0
.IP "\(bu" 4
\&\s-1SCRIPT_DIR\s0
.Sh "\s-1PREFIX\s0"
.IX Subsection "PREFIX"
This variable will be prepended to all other directory variables
above. It is used for grouping the other directories into one root
directory. If you don't want that, you may simply set the variable to
an empty string in the Makefile. If the variable is empty you could
still use it on the command line when you run make, for instance for a
one-shoot installation like: \fBmake PREFIX=/local/myproject/ install\fR
.Sh "\s-1CLASS_DIR\s0"
.IX Subsection "CLASS_DIR"
This variable denotes the top directory from where all class files
will be installed. Its default value is \fBclasses\fR, which I believe is
a good value. \fBNote:\fR If you \fIdon't\fR want to install any class files
(because you are, for example, only going to use a jar file), set this
variable to an empty string and no class files will be installed. 
.PP
Resource files will also be installed below this directory if such
files are present in a package structure. This is useful if you are
using e.g. ResourceBundles to Localize your application and have your
property files in it's own directory in the package structure.
.Sh "\s-1JAR_DIR\s0"
.IX Subsection "JAR_DIR"
This variable tells the Makefile where to install the jar file. The
default value is \fBlib\fR, which is also a good default value.
.Sh "\s-1BUNDLE_DIR\s0"
.IX Subsection "BUNDLE_DIR"
This variable tells the Makefile where to install the app bundle. The
default value is \fBlib\fR, which is also a good default value.
.Sh "\s-1DOC_DIR\s0"
.IX Subsection "DOC_DIR"
When you run javadoc, all the html files will be put into this
directory. Its default value is \fBdoc/api\-docs\fR. You should probably
keep that name, but then again, you may change it as you like.
.Sh "\s-1SCRIPT_DIR\s0"
.IX Subsection "SCRIPT_DIR"
The Makefile uses this variable to install any shell wrapper-scripts
that you have created. If you write an application, it is always nice
for the user that you provide a wrapper script to start the
application. Its default value is \fBbin\fR. (The Makefile will only
install shell-scripts that has the extension .sh. The mmake script
will tell the Makefile where to look for shell\-scripts)
.Sh "\s-1INSTALLATION\s0 \s-1SUMMARY\s0"
.IX Subsection "INSTALLATION SUMMARY"
If you keep the default values you will get an installation tree that
looks like this:
.PP
.Vb 10
\& `-- PREFIX
\&     |-- bin
\&     |-- classes
\&     |   `-- package <--- Example of a sub-directory
\&     |       |-- sub-package1
\&     |       |-- sub-package2
\&     |       `-- sub-package3
\&     |-- doc
\&     |   `-- api-docs
\&     `-- lib
.Ve
.SH "USING THE C\-PREPROCESSOR"
.IX Header "USING THE C-PREPROCESSOR"
This is a excellent tool for managing projects with several different
versions. The idea behind using the C preprocessor with Java is to
better manage different versions more easily. This is done by using
\&\s-1CPP\s0 conditional statements in the source files. I would strongly
advise you not to use \s-1CPP\s0 to redefine the Java language itself.
.PP
To use the C preprocessor together with Java, you can change the name
of the source files that you want to preprocess \*(-- from
<filename>.java to <filename>.xjava. The Makefile has a rule to build
\&.class files from .xjava files.
.PP
It is \fBnot\fR necessary to change every file from .java to .xjava. The
Makefile will work well and consistently in an environment of both
\&.java and .xjava files. (E.g. 'make clean' will only remove .java
files that were created from a .xjava file. Other java files will, of
course, \fInot\fR be removed.)
.PP
You can now use cpp Conditionals in Your Java\-code, for example, as
follows:
.PP
.Vb 5
\&    #ifdef JAVA1_1
\&       [code1]
\&    #else
\&       [code2]
\&    #endif
.Ve
.PP
The \s-1JAVA1_1\s0 label in the above example is tested against the
\&\s-1VERSION\s0 variable in the Makefile. That is, if the \s-1VERSION\s0 variable is
\&\s-1JAVA1_1\s0, then [code1] would be compiled and [code2] left out. Likewise,
if \s-1VERSION\s0 is something else than \s-1JAVA1_1\s0, then [code2] would be compiled and
[code1] left out of the resulting .class file.
.SH "NOTES"
.IX Header "NOTES"
mmake will give you \fIone\fR Makefile for managing your Java files.
Although it's easy to setup and use mmake in a recursive makefile
context, you don't want to do that. To see why, read the excellent
article: \fBRecursive Make Considered Harmful\fR at
\&\fIhttp://www.canb.auug.org.au/~millerp/rmch/recu\-make\-cons\-harm.html\fR
.SH "DEPENDENCIES"
.IX Header "DEPENDENCIES"
mmake will need the following:
.IP "\(bu" 4
Perl 5.x
.IP "\(bu" 4
Gnu make
.IP "\(bu" 4
Gnu xargs (recommended)
.SH "AUTHOR"
.IX Header "AUTHOR"
Jan-Henrik Haukeland <hauk@tildeslash.com>