Re: Script to compile all files with a given extension?
- From: Dan Espen <daneNO@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 30 Jun 2007 12:07:13 -0400
Dances With Crows <danSPANceswithTRAPcrows@xxxxxxxxx> writes:
sk8terg1rl staggered into the Black Sun and said:
On Jun 29, 11:39 pm, The Natural Philosopher <a...@xxx> wrote:
sk8terg1rl wrote:
Quite often I move source code between CPU architectures and need to
recompile it. Since discovering the joys of bootstrapping my
programs, I no longer have one big program but many smaller
interconnected ones.
Found out what make does with man make just now ;-) Unfortunately IIdentify all the files with .for and .f90 extensionsWrite a Makefile and use make?
Execute the commands:
'ifort program.for -o program'
'ifort program2.f90 -o program2'
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.
Makefiles can have multiple dependencies and action lines. Like so:
OBJS=crud.o barf.o junk.o
SRCS=crud.c barf.c junk.c
See my other post.
The last 2 lines above come from trying to
create a lowest common denominator makefile.
Since we're talking GNUMAKE here,
Once you have $(SRC)
$(OBJS) is simply:
OBJS:=$(subst .c,.o,$(SRC))
HDRS=thing.h
all: $(OBJS) $(HDRS)
$(CC) $(CFLAGS) -o program $(OBJS)
OBJS: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -c $*.c
"all" seems to be missing the target "program".
This assumes 1 program and many subs.
I prefer something like:
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.
Separating the list of subs into a list for
each main can mean that you have to revert to
specific lists.
.
- Follow-Ups:
- Re: Script to compile all files with a given extension?
- From: The Natural Philosopher
- Re: Script to compile all files with a given extension?
- 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?
- Prev by Date: Re: Totem: Can't get it to go completely into full screen
- Next by Date: www.nikejordangoogle.com sell nike jordan
- 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):
Relevant Pages
|