summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2021-12-23 20:52:49 +0100
committerEkaitz Zarraga <ekaitz@elenq.tech>2021-12-23 20:52:49 +0100
commit35465f27ed87646a18cd9298eae861f14385300e (patch)
tree7f0256d28fa6fd5368b7a39500d080456e70be8e /Makefile
First commit: moves a simple thing on the screen
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3b2fa99
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+CC = g++
+CFLAGS = -Wall
+
+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