about summary refs log tree commit diff stats
path: root/Makefile
diff options
context:
space:
mode:
authorCharadon <dev@iotib.net>2022-05-30 21:07:45 -0400
committerCharadon <dev@iotib.net>2022-05-30 21:07:45 -0400
commitb1de6008bdfbd5bdeb62d2d3dad953019555556b (patch)
treef3ec65de21ef7294f53b0114616ccaca04bb4415 /Makefile
downloadPong-C-b1de6008bdfbd5bdeb62d2d3dad953019555556b.tar.gz
Initial Commit
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..153d346
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+CC := gcc
+CFLAGS = -Og -Wall -std=c11 -Isrc/
+LDFLAGS = 
+PKG_CONF := pkg-config
+PKG_CONF_ARGS = --exists --modversion
+PKG_CONF_LDFLAGS = `pkgconf --libs raylib`
+PKG_CONF_CFLAGS = `pkgconf --cflags raylib`
+
+all: check_deps build pong
+	
+
+check_deps:
+	@echo "Checking for dependencies..."
+	@printf "Raylib | "
+	@$(PKG_CONF) $(PKG_CONF_ARGS) raylib
+
+build: src/main.c src/enemy.c src/ball.c src/title.c
+	$(CC) $(CFLAGS) $(PKG_CONF_CFLAGS) -c $?
+
+pong: main.o enemy.o ball.o title.o
+	$(CC) $? -o $@ $(LDFLAGS) $(PKG_CONF_LDFLAGS) -lGL -lm -lpthread -ldl -lrt -lX11
+	
+clean:
+	rm -fv *.o
+	rm -fv pong