summaryrefslogtreecommitdiff
path: root/Makefile
blob: a850e6b19fc06686646743f94d97eabf2f8756d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
CC		= g++
CFLAGS	= -Wall -g

TARGET	= tetris

SRCDIR	= src

OBJDIR	= build
BASENM	= $(notdir $(basename $(wildcard src/*.cpp)))
OBJS	= $(addsuffix .o, $(addprefix $(OBJDIR)/, $(BASENM)) )


all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) $(OBJS) -o $(TARGET) -lSDL2 -lSDL2_image

$(OBJS): $(OBJDIR)/%.o: $(SRCDIR)/%.cpp
	mkdir -p $(OBJDIR)
	$(CC) $(CFLAGS) -o $@ -c $<

clean:
	rm -r $(OBJDIR) $(TARGET)

.PHONY: all clean