graphics/01-introduction/Makefile

29 lines
471 B
Makefile
Raw Permalink Normal View History

2023-11-12 14:17:09 +00:00
CC=gcc
CFLAGS=`pkg-config --cflags sdl2 SDL2_image`
LDFLAGS=`pkg-config --libs sdl2 SDL2_image`
TARGET=introduction
SDIR=src
ADIR=assets
ODIR=build
SRC=$(shell find $(SDIR) -type f -name *.c)
OBJ=$(SRC:.c=.o)
all: $(TARGET)
.PHONY: default
$(TARGET): $(OBJ)
mkdir -p build
cp -rf $(ADIR) $(ODIR)/$(ADIR)
$(CC) -o $(ODIR)/$@ $^ $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<
run:
$(ODIR)/$(TARGET)
.PHONY: clean
clean:
rm -f $(ODIR)/$(TARGET) $(OBJ)