usaa24/cv4/Makefile

30 lines
539 B
Makefile
Raw Normal View History

2024-11-18 13:43:38 +00:00
# Compiler and flags
CC = gcc
CFLAGS = -std=c99 -g -Wall
2024-10-15 12:34:20 +00:00
2024-11-18 13:43:38 +00:00
# Source files and object files
SRCS = main.c a_train.c
OBJS = $(SRCS:.c=.o)
2024-10-15 12:34:20 +00:00
2024-11-18 13:43:38 +00:00
# Target executable
TARGET = main
# Default rule to build the executable
all: $(TARGET)
2024-10-15 12:34:20 +00:00
2024-11-18 13:43:38 +00:00
# Rule to link object files and create the executable
$(TARGET): $(OBJS)
$(CC) $(OBJS) -o $(TARGET)
2024-10-15 12:34:20 +00:00
2024-11-18 13:43:38 +00:00
# Rule to compile .c files into .o files
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
# Clean up generated files
2024-10-15 12:34:20 +00:00
clean:
2024-11-18 13:43:38 +00:00
rm -f $(OBJS) $(TARGET)
# Phony targets (targets that are not actual files)
.PHONY: all clean
2024-10-15 12:34:20 +00:00