Alphawhich includes code for
Betachanges, how do I know that I need to recompile
javac, also helps eliminate many of those problems, as it uses
importstatements to identify dependencies.
makeis used to help with these problems.
makecan automatically determine which files, if any, need to be recompiled and will then recompile for you.
makefor use with Java, you will eventually encounter someone else's makefiles, and it helps to be able to read them.
makeI think you can get by with the man pages.
makerequires you to store your list of dependencies (and related information) in a make file. This file should be called
thing-to-be-made : things-it-depends-upon instructions for making it
make, it looks at the thing that you're trying to make, determines if any of the things that it depends on have changed (or depend on things that change), and executes the corresponding command if they have.
Rules.classand that I execute it with
java Sim, I would write
(admittedly, in this example, I'm not actually creating the filesim: Game.class Player.class Sim.class Rules.class java Sim Game.class: Game.java javac Game.java ...
sim, but that's okay)
maketo recompile as necessary and then execute with
Sim.javaand that I want to rebuild all the javadoc in order to create
Sim.html, I would write:
Sim.html: Sim.java javadoc -author -version -package *.html
gcc; you probably want the same one for each
.cfile you're compiling).
makeprovides simple "macros" (in effect, they're variables).
NAME = value
javadoc, I might define a
JDOCFLAGSmacro and always use
javadoc $(JDOCFLAGS) ...
makealso provides some standard macros
$@is the name of the file that was made (the target)
$?is the list of younger objects the target depends on
.ofiles by compiling them with
cc(or other C compiler).
.classfiles by compling them with
makepermits you to do define such automatic conversions.
.SUFFIXES : .java .class .html .o .c
$*is the common prefix of target and related file
$<is the name of the file that "caused" the action
.class, I might have
.SUFFIXES : .java .class JC = "javac" JCFLAGS = "" .java.class: $(JC) $(JCFLAGS) $<
make allshould make all the primary components of your system (many systems provide a number of programs, this makes all the core ones).
makeshould do the same thing as
makeby itself does the first rule in your file)
make printshould print the key files in the library (or even the recently changed libraries)
make cleanshould clean up any object files you have laying around
make installshould install everything in the appropriate place (e.g., if someone were moving your software to a new machine)
make archiveshould make an archive of your source code (and Makefile) suitable for transportation elsewhere.
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
Source text last modified Mon Nov 10 08:57:27 1997.
This page generated on Mon Nov 10 10:13:13 1997 by SiteWeaver.
Contact our webmaster at email@example.com