2024-08-31 06:17:14 +01:00
|
|
|
# Define the compiler and flags
|
|
|
|
CC = gcc
|
2024-08-31 07:32:45 +01:00
|
|
|
CFLAGS = -Wall -Wextra -std=c99
|
2024-08-31 06:17:14 +01:00
|
|
|
|
|
|
|
# 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)
|
2024-08-31 07:32:45 +01:00
|
|
|
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) -lcurl
|
2024-08-31 06:17:14 +01:00
|
|
|
|
|
|
|
# Compile the .c files into .o files
|
2024-08-31 07:32:45 +01:00
|
|
|
src/%.o: src/%.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2024-08-31 06:17:14 +01:00
|
|
|
|
|
|
|
# Clean up the build artifacts
|
|
|
|
clean:
|
2024-08-31 07:32:45 +01:00
|
|
|
rm -f $(TARGET) $(OBJS)
|