[vox-tech] help with a makefile
Mark K. Kim
vox-tech@lists.lugod.org
Tue, 2 Apr 2002 14:02:32 -0800 (PST)
On Tue, 2 Apr 2002, Peter Jay Salzman wrote:
> hi all,
>
> here is a makefile for one of my simulators:
>
>
> TARGET = ising2-periodic
> TIMESTAMP = `/bin/date +'%Y-%b-%d-%H-%M'`
> BACKUPDIR = /usr/local/backup/ising2
> WARN = -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
> CFLAGS = -O9 -ansi $(WARN)
> LFLAGS = -lm -L. -lpising2
> OBJS := $(patsubst %.c, %.o, $(wildcard *.c))
>
>
> $(TARGET): $(OBJS)
> gcc -o $@ $(OBJS) $(LFLAGS)
Since you like the implicit rules, I thought you might wanna know that
if you breakdown LFLAGS like this:
LDFLAGS = -L.
LDLIBS = -lm -lpising2
then you can link implicitely, like this:
$(TARGET): $(OBJS)
-Mark
--
Mark K. Kim
http://www.cbreak.org/
PGP key available upon request.