Skip to content
Snippets Groups Projects
Commit 837f61fc authored by ismail.abloua's avatar ismail.abloua
Browse files

generic makefile

parent c95ff500
Branches
No related tags found
No related merge requests found
Makefile 0 → 100644
# compile c project using "make main"
# pthreads
CC = gcc
CFLAGS = -Wall -Wextra -pthread
LDFLAGS = -lpthread
SOURCES = main.c
OBJECTS = $(SOURCES:.c=.o)
EXECUTABLE = main
# default target
all: $(EXECUTABLE)
# compile the executable
$(EXECUTABLE): $(OBJECTS)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
# compile the object files
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
# clean up
clean:
rm -f $(OBJECTS) $(EXECUTABLE)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment