BSX/Makefile

27 lines
454 B
Makefile
Raw Permalink Normal View History

2024-07-23 02:48:34 +02:00
# Variables
CC = gcc
CFLAGS = -Wall -Wextra -std=c11 -I/usr/local/include/SDL2
LDFLAGS = -L/usr/local/lib -lSDL2
SRC_DIR = src
SOURCES = $(wildcard $(SRC_DIR)/*.c)
OBJECTS = $(SOURCES:$(SRC_DIR)/%.c=%.o)
TARGET = bsx
# Default target
all: $(TARGET)
# Linking
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) -o $@ $^
# Compiling
%.o: $(SRC_DIR)/%.c
$(CC) $(CFLAGS) -c -o $@ $<
# Clean up
clean:
rm -f $(OBJECTS) $(TARGET)
# Phony targets
.PHONY: all clean