Josh Morrison
Josh Morrison

Reputation: 7636

GNU make question

AR  = ar
LIBMISC = libapue_db.a
COMM_OBJ   = db.o
RANLIB     = ranlib

all: ${LIBMISC} libapue_db.so.1 t4

libapue_db.a:   ${COMM_OBJ}
        ${AR} rv ${LIBMISC} ${COMM_OBJ}
        ${RANLIB} ${LIBMISC}

What does ar rv mean? I just know ar is a command and rv is an option. What is ranlib? thank u.

Upvotes: 1

Views: 149

Answers (1)

Dave Goodell
Dave Goodell

Reputation: 2153

FWIW, I recommend checking man pages first for this sort of information.

ranlib is a program that builds the index in a static library archive. The line with ${AR} says add to ${LIBMISC} all of the objects that ${COMM_OBJ} expands to, replacing (r) any existing objects with that name. The v option asks for verbose output.

Upvotes: 3

Related Questions