sdl-audio/makefile

30 lines
433 B
Makefile

CC = gcc
OBJD = obj
SRCS := $(wildcard *.c)
OBJS := $(SRCS:%.c=$(OBJD)/%.o)
# Compiler flags
CCFLAGS = -g
LDFLAGS = -lSDL2 -lSDL2_image -lSDL2_ttf
# Target executable name
TARGET = main
# Build target
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(CCFLAGS) $^ -o $(TARGET) $(LDFLAGS)
$(OBJS): $(OBJD)/%.o: %.c
mkdir -p $(@D)
$(CC) $(CCFLAGS) -c $? -o $@
clean:
rm -r $(TARGET) $(TARGET1) $(OBJD)
run: $(TARGET)
./$(TARGET)