24 lines
505 B
Makefile
24 lines
505 B
Makefile
|
# Define the compiler and flags
|
||
|
CC = gcc
|
||
|
CFLAGS = -Wall -Wextra -std=c99
|
||
|
|
||
|
# Define the target executable and the source files
|
||
|
TARGET = caur
|
||
|
SRCS = $(wildcard src/*.c)
|
||
|
OBJS = $(SRCS:.c=.o)
|
||
|
|
||
|
# The default rule: build the target
|
||
|
all: $(TARGET)
|
||
|
|
||
|
# Link the object files into the target executable
|
||
|
$(TARGET): $(OBJS)
|
||
|
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) -lcurl
|
||
|
|
||
|
# Compile the .c files into .o files
|
||
|
src/%.o: src/%.c
|
||
|
$(CC) $(CFLAGS) -c $< -o $@
|
||
|
|
||
|
# Clean up the build artifacts
|
||
|
clean:
|
||
|
rm -f $(TARGET) $(OBJS)
|