Date: Mon, 8 Jun 2009 22:12:17 +0200 From: Roland Smith <rsmith@xs4all.nl> To: Lars Eighner <luvbeastie@larseighner.com> Cc: freebsd-questions@freebsd.org Subject: Re: General and specific make questions Message-ID: <20090608201217.GD34213@slackbox.xs4all.nl> In-Reply-To: <20090607235205.H85986@qroenaqrq.6qbyyneqvnyhc.pbz> References: <20090607235205.H85986@qroenaqrq.6qbyyneqvnyhc.pbz>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On Sun, Jun 07, 2009 at 11:52:17PM -0500, Lars Eighner wrote:
>
> What I need most is to find (a) make tutorial(s) that do not suppose make is
> being used for compling c/c++ programs. Yes, I know, that is mostly why
> make exists, but many tutorials plunge right into C examples with implicit C
> rules, while -- it seems to me -- make could be much more useful for a
> variety of things, and I could sure use more of the general and arbitrary
> examples.
I use make to e.g. build complex LaTeX documents with included gnuplot
graphs. Works like a charm. But that it is not conceptually different
from compiling a C program.
> I have some sources which may or may not exist. My target should be rebuilt
> if a source exists that is younger than the target. But sources that do
> not exist should be ignored and make should not be perplexed over how to
> create them. How do I express that kind of relationship?
I use the following to create PDFs from gnuplot files without
enumerating them beforehand. Maybe that is what you're looking for?
----- Makefile fragment -----
# See SPECIAL TARGETS in make(1)
.PHONY: all clean
.SUFFIXES: .eps .pdf .gp .d
# See VARIABLE ASSIGNMENTS in make(1)
GP!=ls *.gp|sed -e 's/\.gp/\.pdf/g'
all: ${GP}
# Suffix-transformation rule. See chapter 3 in the PMake tutorial
# (/usr/share/doc/psd/12.make/paper.ascii.gz)
.gp.pdf:
gnuplot $*.gp 2>&-
epstopdf $*.eps
rm -f $*.eps *.log
clean:
rm -f *.log *.pdf *.eps
----- Makefile fragment -----
Roland
--
R.F.Smith http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (FreeBSD)
iEYEARECAAYFAkotcKEACgkQEnfvsMMhpyVXIgCfWhqX4yHUuVKzJIu5PjawL8OY
mOEAnj1qPbWapcimQ7s3kugeVz8p4pZb
=DLfC
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090608201217.GD34213>
