MOTOSHARE 🚗🏍️

Rent Bikes & Cars Directly from Owners

Motoshare connects vehicle owners with people who need bikes and cars on rent. Owners earn from idle vehicles, and renters get flexible ride options.

Visit Motoshare

Makefile – Makefile example – Makefile Guide

makefile-example
makefile

makefile-example

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 $<
—————

0 0 votes
Article Rating
Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Brienne
Brienne
7 months ago

This is a well-written and practical introduction to Makefiles, clearly explaining how they help automate and manage build processes in software development. Makefiles save time and reduce errors by defining rules that determine how programs are compiled and linked, especially in large projects with many source files. The breakdown of targets, dependencies, and commands gives readers a solid foundation for writing their own Makefiles and optimizing builds. Whether you’re a beginner learning build automation or an experienced developer refining your workflow, this tutorial offers valuable insights into making your development process more efficient and consistent.

1
0
Would love your thoughts, please comment.x
()
x