Thursday, February 08, 2007

GNUmakefile for a basic library

GNUmakefile for a static library, testlib.a, including a single file, hello.c

OBJS = hello.o

CFILES := ${OBJS:.o=.c}
LDFLAGS =
ARFLAGS = rcv

all:: testlib.a

testlib.a: ${OBJS}
@$(AR) ${ARFLAGS} $@ $?

clean::
@$(RM) ${OBJS} testlib.a

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home