Adding a Static Library (libtimer.a) to the Makefile

Hi,
The following is my Makefile, I wanted to add a staic library named libtimer.a. I'm using the following Makefile. Please let me know how to add this static library:

Makefile:-

It produces "usbserial" executable.

Thanks,
S

You're using your makefile as a batch file that runs one line. Here is how a makefile is supposed to work:

# CC automatically uses these flags to compile .c into .o
CFLAGS=-Wall -pthread

# LD automatically uses these flags when linking .o's into an executable
# Libraries after -static are assumed to be static
# -L./ tells it to look for libtimer.a in the current directory
LDFLAGS=-lrt -lm -pthread -static -L./ -ltimer

# make already knows how to use cc.  we just tell it the objects and executable.
usbserial:usbserialapp.o usbserialinit.o environ.o