Re: Script to compile all files with a given extension?
- From: Dances With Crows <danSPANceswithTRAPcrows@xxxxxxxxx>
- Date: Sat, 30 Jun 2007 13:59:42 -0500
The Natural Philosopher staggered into the Black Sun and said:
Dan Espen wrote:
Dances With Crows writes:
sk8terg1rl staggered into the Black Sun and said:Once you have $(SRC) $(OBJS) is simply:
Found out what make does with man make just now ;-) Unfortunately IMakefiles can have multiple dependencies and action lines. Like so:
don't think this would help much. Depending on the purpose of the
programs, they have different names. This would mean I would need a
makefile for each subset of programs.
OBJS=crud.o barf.o junk.o
SRCS=crud.c barf.c junk.c
OBJS:=$(subst .c,.o,$(SRC))
The book that I was reading when I wrote that makefile in 1998 was ...
slightly out of date and aimed at as much cross-platformability as
possible, hence no GNU make extensions. (And why is it that everything
that does string manipulation feels the need to invent its own syntax
for s/NN/MM/ ?)
This assumes 1 program and many subs. I prefer something like:Writing the makefile is one of the main jobs to do in any compilation
SRCS:=$(wildcard *.c)
MAINS:=program.c program2.c
SUBS:=$(filter-out $(MAINS),$(SRCS))
Then you need specific rules for the mains and generic rules for the
subs.
project. It doesn't just happen naturally ;-)
Systems have sub-systems and sub-systems have sub-systems and so on ad
infinitum -- which is why we're always starting over.
-- Epigrams in Programming, ACM SIGPLAN Sept. 1982
--
Kimono dragon: found mainly on Pacific islands and atolls, this is the
more dangerous version of the somewhat placid bathrobe gecko.
--jghanc
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
.
- References:
- Re: Script to compile all files with a given extension?
- From: The Natural Philosopher
- Re: Script to compile all files with a given extension?
- From: Dances With Crows
- Re: Script to compile all files with a given extension?
- From: Dan Espen
- Re: Script to compile all files with a given extension?
- From: The Natural Philosopher
- Re: Script to compile all files with a given extension?
- Prev by Date: "route add default" directive
- Next by Date: Re: how can a bit be off in memory?
- Previous by thread: Re: Script to compile all files with a given extension?
- Next by thread: Re: Script to compile all files with a given extension?
- Index(es):