aboutsummaryrefslogtreecommitdiffstats
path: root/06-brain2/Makefile
diff options
context:
space:
mode:
authorkatherine <ageha@airen-no-jikken.icu>2021-02-13 02:10:46 -0700
committerkatherine <ageha@airen-no-jikken.icu>2021-02-13 02:10:46 -0700
commit0d7a72fabf92abd2e8189cbe86af74f62a768631 (patch)
tree3826c3692fc3c6e6d839010aa3cdc12f13c32814 /06-brain2/Makefile
parent91333caa6913146a2fa2f6e0de9050db4fec825a (diff)
downloadallegro-sketches-0d7a72fabf92abd2e8189cbe86af74f62a768631.tar.gz
brain2
Diffstat (limited to '06-brain2/Makefile')
-rw-r--r--06-brain2/Makefile29
1 files changed, 29 insertions, 0 deletions
diff --git a/06-brain2/Makefile b/06-brain2/Makefile
new file mode 100644
index 0000000..1789873
--- /dev/null
+++ b/06-brain2/Makefile
@@ -0,0 +1,29 @@
+CFLAGS+=-Wall -O2 $(shell pkg-config --cflags allegro-5 allegro_primitives-5 libsodium)
+CFLAGSDEBUG=-Wall -ggdb3 -O0 -DDEBUG $(shell pkg-config --cflags allegro-5 allegro_primitives-5)
+LDFLAGS+=-Wall -O2 $(shell pkg-config --libs allegro-5 allegro_primitives-5 libsodium)
+LDFLAGSDEBUG=-Wall -ggdb3 -O0 -DDEBUG $(shell pkg-config --libs allegro-5 allegro_primitives-5)
+SRCDIR=./src
+OBJDIR=./build
+SRC=$(wildcard $(SRCDIR)/*.c)
+OBJ=$(patsubst $(SRCDIR)%.c,$(OBJDIR)%.o,$(SRC))
+BIN=brain2
+
+all: $(OBJ)
+ $(CC) $(LDFLAGS) -o $(BIN) $^
+
+$(OBJ): | $(OBJDIR)
+
+$(OBJDIR)/%.o: $(SRCDIR)/%.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+$(OBJDIR):
+ mkdir -p $(OBJDIR)
+
+clean:
+ rm -rf $(OBJDIR) $(BIN)
+
+debug: CFLAGS=$(CFLAGSDEBUG)
+debug: LDFLAGS=$(LDFLAGSDEBUG)
+debug: all
+
+new: clean all