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

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Live
  • StumbleUpon
  • Tumblr
  • TwitThis
  • FriendFeed
  • Netvibes
  • Ping.fm
  • Posterous
  • Technorati
  • Tipd
  • Twitter
  • Yahoo! Buzz