caur/Makefile

24 lines
505 B
Makefile
Raw Normal View History

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