graphics/01-introduction/Makefile
2023-11-12 15:17:09 +01:00

29 lines
471 B
Makefile

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)