* make files
@ 2001-06-08 8:31 Hans Hagen
2001-06-08 8:53 ` Marc van Dongen
` (5 more replies)
0 siblings, 6 replies; 16+ messages in thread
From: Hans Hagen @ 2001-06-08 8:31 UTC (permalink / raw)
Hi,
Say that i want to process a couple of files, how does a make file look?
With:
tex : blabla.tex
texexec --pdf blabla
and
make tex
i get 'no rule to make target' so i miss a point there,
Hans
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | pragma@wxs.nl
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make files
2001-06-08 8:31 make files Hans Hagen
@ 2001-06-08 8:53 ` Marc van Dongen
2001-06-08 9:00 ` Gilbert van den Dobbelsteen
` (4 subsequent siblings)
5 siblings, 0 replies; 16+ messages in thread
From: Marc van Dongen @ 2001-06-08 8:53 UTC (permalink / raw)
Cc: ntg-context
[-- Attachment #1: Type: text/plain, Size: 440 bytes --]
Hans Hagen (pragma@wxs.nl) wrote:
: Say that i want to process a couple of files, how does a make file look?
: With:
:
: tex : blabla.tex
: texexec --pdf blabla
: make tex
:
: i get 'no rule to make target' so i miss a point there,
Is there a file called blabla.tex in the
current directory. If there isn't this makes
sense.
Find attached part of a LaTeX Makefile I use to compile
my latex with.
Regards,
Marc van Dongen
[-- Attachment #2: Makefile --]
[-- Type: text/plain, Size: 900 bytes --]
.SUFFIXES : # nullify default suffix rules
.SUFFIXES : .pdf .tex .ps .dvi
.dvi.ps:
@dvips -o $*.ps $*.dvi
.tex.ps:
@lama $*.dvi
@dvips -o $*.ps $*.dvi
.tex.pdf:
@pdflatex $<
.tex.dvi:
@latex $*.tex; \
if grep 'LaTeX Warning: Citation .* undefined' $*.log; \
then \
bibtex $*; \
latex $*.tex; \
fi; \
if grep 'LaTeX Warning: Label(s) may have changed' $*.log; \
then \
latex $*.tex; \
fi; \
printf "\a\a\a"
#####################################################################
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make files
2001-06-08 8:31 make files Hans Hagen
2001-06-08 8:53 ` Marc van Dongen
@ 2001-06-08 9:00 ` Gilbert van den Dobbelsteen
2001-06-08 9:25 ` Taco Hoekwater
` (3 subsequent siblings)
5 siblings, 0 replies; 16+ messages in thread
From: Gilbert van den Dobbelsteen @ 2001-06-08 9:00 UTC (permalink / raw)
Cc: ntg-context
On Fri, 8 Jun 2001, Hans Hagen wrote:
> Hi,
>
> Say that i want to process a couple of files, how does a make file look?
> With:
>
> tex : blabla.tex
> texexec --pdf blabla
>
>
> and
>
If you use gnu make the syntax is very critical:
tex: blabla.tex
texexec --pdf
The colon (:) *must* follow the target (e.g. no spaces), and the execution
line(s) must be preceeded by a tab (Ctrl+I, ASCII 9) character.
gilbert.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make files
2001-06-08 8:31 make files Hans Hagen
2001-06-08 8:53 ` Marc van Dongen
2001-06-08 9:00 ` Gilbert van den Dobbelsteen
@ 2001-06-08 9:25 ` Taco Hoekwater
2001-06-08 9:38 ` Marc van Dongen
[not found] ` <Pine.LNX.4.30.0106081058490.20802-100000@panter.soci.aau.d k>
` (2 subsequent siblings)
5 siblings, 1 reply; 16+ messages in thread
From: Taco Hoekwater @ 2001-06-08 9:25 UTC (permalink / raw)
Hans Hagen wrote:
>
> Hi,
>
> Say that i want to process a couple of files, how does a make file look?
> With:
>
> tex : blabla.tex
> i get 'no rule to make target' so i miss a point there,
Ehm .. je hebt een rule gedefinieerd voor 'tex ' ? :-)
(het kan mijn make niet schelen trouwens, dus misschien is het toch wat
anders)
--
groeten,
Taco
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make files
[not found] ` <Pine.LNX.4.30.0106081058490.20802-100000@panter.soci.aau.d k>
@ 2001-06-08 9:36 ` Hans Hagen
2001-06-08 9:56 ` Marc van Dongen
2001-06-09 9:35 ` David Antos
0 siblings, 2 replies; 16+ messages in thread
From: Hans Hagen @ 2001-06-08 9:36 UTC (permalink / raw)
Cc: ntg-context
At 11:00 AM 6/8/01 +0200, Gilbert van den Dobbelsteen wrote:
>The colon (:) *must* follow the target (e.g. no spaces), and the execution
>line(s) must be preceeded by a tab (Ctrl+I, ASCII 9) character.
That works, is this windows specific or does the linux make also need that
<tab> char? [i hate tabs]
thanks for all replys, it now works,
Hans
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | pragma@wxs.nl
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make files
2001-06-08 9:25 ` Taco Hoekwater
@ 2001-06-08 9:38 ` Marc van Dongen
0 siblings, 0 replies; 16+ messages in thread
From: Marc van Dongen @ 2001-06-08 9:38 UTC (permalink / raw)
Cc: ntg-context
Taco Hoekwater (taco@elvenkind.com) wrote:
: Ehm .. je hebt een rule gedefinieerd voor 'tex ' ? :-)
: (het kan mijn make niet schelen trouwens, dus misschien is het toch wat
: anders)
This is well possible. It is quite usefull e.g.
if you want to always cary out something. E.g.
$ cat Makefile
groetjes:
@echo Goeiesmorgens!
$ make groetjes
Goeiesmorgens!
$
Regards,
Marc
--
Marc van Dongen, CS Dept | phone: +353 21 4903578
University College Cork, NUIC | Fax: +353 21 4903113
College Road, Cork, Ireland | Email: dongen@cs.ucc.ie
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make files
2001-06-08 9:36 ` Hans Hagen
@ 2001-06-08 9:56 ` Marc van Dongen
2001-06-09 9:35 ` David Antos
1 sibling, 0 replies; 16+ messages in thread
From: Marc van Dongen @ 2001-06-08 9:56 UTC (permalink / raw)
Cc: Gilbert van den Dobbelsteen, ntg-context
Hans Hagen (pragma@wxs.nl) wrote:
: >The colon (:) *must* follow the target (e.g. no spaces), and the execution
: >line(s) must be preceeded by a tab (Ctrl+I, ASCII 9) character.
:
: That works, is this windows specific or does the linux make also need that
: <tab> char? [i hate tabs]
You always need the tabs. I also hate them and
wonder where they originate from.
On my machine there is no need to put the colon
immediately after the target.
Regards,
Marc
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make files
2001-06-08 8:31 make files Hans Hagen
` (3 preceding siblings ...)
[not found] ` <Pine.LNX.4.30.0106081058490.20802-100000@panter.soci.aau.d k>
@ 2001-06-08 17:25 ` Berend de Boer
2001-06-09 9:34 ` Uwe Koloska
5 siblings, 0 replies; 16+ messages in thread
From: Berend de Boer @ 2001-06-08 17:25 UTC (permalink / raw)
Cc: ntg-context
Hans Hagen <pragma@wxs.nl> writes:
> Say that i want to process a couple of files, how does a make file look?
> With:
>
> tex : blabla.tex
> texexec --pdf blabla
>
>
> and
>
> make tex
>
> i get 'no rule to make target' so i miss a point there,
1. tabs are necessary for commands for at least GNU make.
2. spaces before/after colon are not really necessary.
3. This example defines a .tex rule:
-----------
.SUFFIXES:
.SUFFIXES: .pdf .tex
all: blabla.tex
.tex.pdf:
texexec --pdf $<
----------
You need GNU make for this. For Windows download Cygwin. You have to
anyway if you do more stuff with makefiles.
Complete GNU make manual:
http://www.gnu.org/manual/make/index.html
Groetjes,
Berend. (-:
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make files
2001-06-08 8:31 make files Hans Hagen
` (4 preceding siblings ...)
2001-06-08 17:25 ` Berend de Boer
@ 2001-06-09 9:34 ` Uwe Koloska
2001-06-10 20:10 ` Hans Hagen
5 siblings, 1 reply; 16+ messages in thread
From: Uwe Koloska @ 2001-06-09 9:34 UTC (permalink / raw)
Hi Hans,
Am Freitag, 8. Juni 2001 10:31 hast du geschrieben:
> Hi,
>
> Say that i want to process a couple of files, how does a make file look?
> With:
>
> tex : blabla.tex
> texexec --pdf blabla
Here a <TAB> ist needed before the command(s). That is general make syntax
(all makes on all plattforms).
Without the <TAB> there is no command to make target "tex" and thus the
make prompted out:
> and
>
> make tex
>
> i get 'no rule to make target' so i miss a point there,
To write a proper makefile is rocket science -- if you want to deserve
special purposes. But if you have only simple needs the following
introduction should be enough.
A makefile can have arbitrary names, but make considers the following
filenames without explicitly naming it on the make commandline (in this
order):
GNUmakefile (only GNU make)
makefile
Makefile
A simple make rule have a
- target that is to be build
- some prerequisites that the target depend on
- some commands that are used to build the target
So what your rule from above really means:
Hey make, build me target "tex", check it's dependencies from blabla.tex
and execute the command "texexec --pdf blabla".
What you really wanted is:
blabla.pdf: blabla.tex
[TAB] texexec --pdf blabla
[TAB] any other command
Now, what does it mean: check the dependencies of the target? Simply said,
make looks wether one of the dependencies (or prerequisites as the make
manual names them) is newer than the target. So, if you modified the
source blabla.tex it will be rebuild. If you haven't change anything the
target is current and make doesn't need to do anything.
If your main source blabla.tex includes other files (pictures,
environments, etc.) you can name them all as dependencies and make check's
wether something has changed. It's in a way comparable to texexec that
calls all necessary commands to make all pictures, indices and such current.
sidestep: maybe it is possible to replace texexec with make (e.g. for
platforms where perl isn't available
But there is more make does for dependencies. For every prerequisite make
checks wether that is current, too. Say, you don't use context (boo ...)
and want to include an eps picture build from metapost. The following make
rules will do that:
picture.eps: picture.mp
mp picture.mp
blabla.pdf: blabla.tex picture.eps
texexec --pdf blabla
The first rule inside a makefile will be processed by default so if you
exchange the above rules a simple make will build blabla.pdf.
Two other important things you want to know about make will close this
short introduction:
if a target is not a real file and the commands should be always started or
the dependencies allways taken as unsatisfied, you can make a special rule
that name all such targets:
.PHONY: all clean
all: blabla.pdf
clean:
rm blabla.pdf
this is necessary if there accidentally is a file called clean because the
rule clean has no dependencies and thus is always considered up to date
(there is no dependency that is newer than clean) and so the command will
not be executed.
The last thing to know is about variables. I cite a part from the make
manual ("info make" on unix):
CC = gcc
objects = program.o foo.o utils.o
program : $(objects)
$(CC) -o program $(objects)
$(objects) : defs.h
It is a good idea to look into the GNU make manual. It is well written and
has many examples.
I hope this short introduction helps you (and possibly others) to write
nice makefiles to produce good looking context documents ;-)
Uwe
--
mailto:koloska@rcs.urz.tu-dresden.de
http://rcswww.urz.tu-dresden.de/~koloska/
-- --
right now the web page is in german only
but this will change as time goes by ;-)
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make files
2001-06-08 9:36 ` Hans Hagen
2001-06-08 9:56 ` Marc van Dongen
@ 2001-06-09 9:35 ` David Antos
2001-06-10 20:20 ` Hans Hagen
2001-06-11 5:53 ` Gilbert van den Dobbelsteen
1 sibling, 2 replies; 16+ messages in thread
From: David Antos @ 2001-06-09 9:35 UTC (permalink / raw)
Cc: ntg-context
> >The colon (:) *must* follow the target (e.g. no spaces), and the execution
> >line(s) must be preceeded by a tab (Ctrl+I, ASCII 9) character.
>
> That works, is this windows specific or does the linux make also need that
> <tab> char? [i hate tabs]
>
The <tab> syntax is make-specific. It is very very supid. The GNU make
only adds some types of rules to ``standard'' make (e.g., some kind of
`wildcards', more comfortable ways to handle filenames). Nevertheless
the <tab> syntax will survive everything.
D.A.
P.S.: Some `too-inteligent' text editors convert your tabs into spaces
(and the user doesn't know that option is set). If your Makefile doesn't
want to work and there is no reason why, check this.
It happened to me...
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make files
2001-06-09 9:34 ` Uwe Koloska
@ 2001-06-10 20:10 ` Hans Hagen
2001-06-11 7:21 ` Berend de Boer
2001-06-11 11:09 ` Marc van Dongen
0 siblings, 2 replies; 16+ messages in thread
From: Hans Hagen @ 2001-06-10 20:10 UTC (permalink / raw)
Cc: ntg-context
At 11:34 AM 6/9/01 +0200, Uwe Koloska wrote:
>Now, what does it mean: check the dependencies of the target? Simply said,
>make looks wether one of the dependencies (or prerequisites as the make
>manual names them) is newer than the target. So, if you modified the
>source blabla.tex it will be rebuild. If you haven't change anything the
>target is current and make doesn't need to do anything.
Does this mean that "make" can see (or registers) if a file changes?
>I hope this short introduction helps you (and possibly others) to write
>nice makefiles to produce good looking context documents ;-)
everone, thanks a lot for all the explanations!
Hans
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | pragma@wxs.nl
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make files
2001-06-09 9:35 ` David Antos
@ 2001-06-10 20:20 ` Hans Hagen
2001-06-11 5:53 ` Gilbert van den Dobbelsteen
1 sibling, 0 replies; 16+ messages in thread
From: Hans Hagen @ 2001-06-10 20:20 UTC (permalink / raw)
Cc: ntg-context
At 11:35 AM 6/9/01 +0200, David Antos wrote:
>P.S.: Some `too-inteligent' text editors convert your tabs into spaces
>(and the user doesn't know that option is set). If your Makefile doesn't
>want to work and there is no reason why, check this.
>It happened to me...
To be honest, our (home brew) editor does not even have a tab since i use
tab to jump to the next cell pos in table like situations [quite handy btw,
since any sentence can be a table]. So i have to enter the ascii value -)
Hans
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | pragma@wxs.nl
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make files
2001-06-09 9:35 ` David Antos
2001-06-10 20:20 ` Hans Hagen
@ 2001-06-11 5:53 ` Gilbert van den Dobbelsteen
2001-06-11 11:12 ` Marc van Dongen
1 sibling, 1 reply; 16+ messages in thread
From: Gilbert van den Dobbelsteen @ 2001-06-11 5:53 UTC (permalink / raw)
Cc: Hans Hagen, ntg-context
> >
> The <tab> syntax is make-specific. It is very very supid. The GNU make
> only adds some types of rules to ``standard'' make (e.g., some kind of
> `wildcards', more comfortable ways to handle filenames). Nevertheless
> the <tab> syntax will survive everything.
Borland make used to be less restrictive, I hate tabs too.
>
> D.A.
>
> P.S.: Some `too-inteligent' text editors convert your tabs into spaces
> (and the user doesn't know that option is set). If your Makefile doesn't
> want to work and there is no reason why, check this.
> It happened to me...
There is only one stupid way to solve this: use vi. It is great, and greatly
impossible (I still hate it, and love it).
Gilbert.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make files
2001-06-10 20:10 ` Hans Hagen
@ 2001-06-11 7:21 ` Berend de Boer
2001-06-11 11:09 ` Marc van Dongen
1 sibling, 0 replies; 16+ messages in thread
From: Berend de Boer @ 2001-06-11 7:21 UTC (permalink / raw)
Cc: Uwe Koloska, ntg-context
Hans Hagen <pragma@wxs.nl> writes:
> Does this mean that "make" can see (or registers) if a file changes?
Yes, it builds a dependency network and only rebuilds what needs to,
depending on the last change time of each file.
Groetjes,
Berend. (-:
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make files
2001-06-10 20:10 ` Hans Hagen
2001-06-11 7:21 ` Berend de Boer
@ 2001-06-11 11:09 ` Marc van Dongen
1 sibling, 0 replies; 16+ messages in thread
From: Marc van Dongen @ 2001-06-11 11:09 UTC (permalink / raw)
Cc: Uwe Koloska, ntg-context
Hans Hagen (pragma@wxs.nl) wrote:
: Does this mean that "make" can see (or registers) if a file changes?
Definitely. That's what it's there fore. You can
use it to define the dependencies between a large group
of files and let it remake the whole bunch in the
proper order as soon as it has detected one of the
dependencies has broken.
See the folowing reference for more information on
make. They also have an IMake version. Let me know
if you need info about that.
@Book{Oram:93,
author = {Oram, A.~ and Talbot, S.~},
title = {Managing Projects with Make},
year = {1993},
publisher = {O'Reilly},
isbn = {0-9371175-90-0},
}
Regards,
Marc
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make files
2001-06-11 5:53 ` Gilbert van den Dobbelsteen
@ 2001-06-11 11:12 ` Marc van Dongen
0 siblings, 0 replies; 16+ messages in thread
From: Marc van Dongen @ 2001-06-11 11:12 UTC (permalink / raw)
Cc: David Antos, Hans Hagen, ntg-context
Gilbert van den Dobbelsteen (gilbert@panter.soci.aau.dk) wrote:
: There is only one stupid way to solve this: use vi. It is great, and greatly
: impossible (I still hate it, and love it).
Have a look at vim. It's a vi clone with *lots* of
goodies. Me being a true vi hard-liner moved to
vim last year and will never move back again.
http://www.moolenaar.net/vim.html
Regards,
Marc van Dongen
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2001-06-11 11:12 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-08 8:31 make files Hans Hagen
2001-06-08 8:53 ` Marc van Dongen
2001-06-08 9:00 ` Gilbert van den Dobbelsteen
2001-06-08 9:25 ` Taco Hoekwater
2001-06-08 9:38 ` Marc van Dongen
[not found] ` <Pine.LNX.4.30.0106081058490.20802-100000@panter.soci.aau.d k>
2001-06-08 9:36 ` Hans Hagen
2001-06-08 9:56 ` Marc van Dongen
2001-06-09 9:35 ` David Antos
2001-06-10 20:20 ` Hans Hagen
2001-06-11 5:53 ` Gilbert van den Dobbelsteen
2001-06-11 11:12 ` Marc van Dongen
2001-06-08 17:25 ` Berend de Boer
2001-06-09 9:34 ` Uwe Koloska
2001-06-10 20:10 ` Hans Hagen
2001-06-11 7:21 ` Berend de Boer
2001-06-11 11:09 ` Marc van Dongen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).