[ Main Page ]

便利なツールやソフト

make

makeとはソースファイルから何か(プログラムなど) を作るときにたいへん便利な ツールです。具体的に言えば、作るものをターゲットとして、 ソースがターゲットより新しければ自動的に 新たにターゲットをソースから作成し、 ターゲットの方が新しければ何もしないという、 やることはとてもシンプルなツールです。
例えば、sample.texからsample.dviを作るとき、

g360059@nc01610~>make sample.dvi
    

と打てば、makeが自動的にsample.dviを作ってくれます。 但し、デフォルトの状態では、texが起動されてしまいます。 そこで、次のような内容をソースと同じところにMakefile として保存すると、texのかわりにplatexが起動されます。
注意 : [tab]はタブを入力してください。

.SUFFIXES:.tex.dvi
.tex.dvi:
[tab]platex $<

そして先に述べたコマンドの入力すればsample.dvi が作られるはずです。もし、ターゲットの方が新しければ

make: `sample.dvi' is up to date.
    

と表示されるだけです。
先のファイルは、デフォルトの振る舞いを設定するものです。 詳しくいうと、makeはまず、自分の持っているターゲットの 作り方を読み込みます。次に カレントディレクトリにMakefileという ファイルがないか探し、あれば読み込みます。 そして、ターゲットの作り方を知った後で ターゲットを作るためのコマンドを実行するのです。 先のファイルの内容を解釈すると、*.texから *.dviを生成することができるが、その方法は以下の通りである、 つまり"platex *.tex"を実行することだ、となります。 ここででてきた$<は、与えられたターゲットのソースファイルの 名前を象徴的に示すものです。
Makeは一般にプログラミングのみで使われると思われているようですが、 複数のファイルからなる大きなTeX文書などをつくるときにも 役に立つのではないでしょうか。 これを読んで興味を持った方は、次のようなページで検索してみましょう。 相談員に聞いてもいいかも知れません。
参考までに、自分のTeXのディレクトリにあるMakefileをあげておきます。 ただし、かなり環境依存なので、いくらか変更する必要があるかも知れません。 <Makefile>
また、このMakefileが読み込んでいるFiles.Makeについても出しておきます。 参考になれば幸です。<Files.make>
Googleで検索
Gnu make 本家

Linus isn't saying that CVS and Subversion have fixable bugs or missing
features. It's not about the code.

He is saying that they solve the wrong problem. The Subversion team wants to
solve Problem A, and Linus wants to solve Problem B. No amount of code will
turn the solution to Problem A into a solution for Problem B. Bothering the
Subversion team with code addressing Problem B will only irritate them, since
they're working on Problem A.

The right way to handle differing goals is to start a different project.
That's what he did.

Don't be confused by the labels. Source Code Management means different things
to different people, and there isn't always much overlap in how each person
defines it. Ships and airplanes are both 'vehicles', but that doesn't mean
that a few changes will turn one to the other.

zzatz on:
http://developers.slashdot.org/comments.pl?sid=237163&cid=19367821

    -- zzatz
    -- Slashdot Comment ( http://developers.slashdot.org/comments.pl?sid=237163&cid=19367821 )

Rule of Open-Source Programming #11:

When a developer says he will work on something, he or she means "maybe".

    -- Shlomi Fish
    -- "Rules of Open Source Programming"


Powered by UNIX fortune(6)
[ Main Page ]