Note that this example Makefile is from an older software project, which specifies everything within each makefile rather than using any recursive or inclusion-based makefile hierarchy, and is presented here for the purposes of the C intro project only. It is modified from the original for the purposes of the C intro project.
CC= gcc CFLAGS= -Wall -O2 LFLAGS+=
SRCS= cas.c \
client.c \
hashtable_itr.c
OBJS= ${SRCS:.c=.o}
all: libmarquis.a libmarquis.so
clean:
rm -f libmarquis.a libmarquis.so *.o
libmarquis.a: ${OBJS}
ar -r $@ ${OBJS}
libmarquis.so:${OBJS}
${CC} -shared ${CFLAGS} -fPIC -Wl,-soname,libmarquis.so -o $@ \
${OBJS}
.c.o:
${CC} ${CFLAGS} -c $<
—————
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND