aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2022-11-17 09:30:07 +0100
committerkdx <kikoodx@paranoici.org>2022-11-17 09:30:07 +0100
commitad215de024e7fdb1c4e207193166ba207008ebcb (patch)
tree1d2f9552b85ae6464751288d469545f50c76e609
parent110f0ed5e3be41dbe226d045ab71ac2eb21073b3 (diff)
downloadlzr-ad215de024e7fdb1c4e207193166ba207008ebcb.tar.gz
makefile for ma boi
-rw-r--r--Makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..2fabd11
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,27 @@
+CC := gcc
+LD := $(CC)
+CFLAGS := -Wall -Wextra -std=c99 -pedantic $(shell sdl2-config --cflags)
+LDFLAGS := -ldx $(shell sdl2-config --libs) -lSDL2_gfx -lSDL2_image -lSDL2_mixer
+SRC := $(wildcard *.c)
+OBJ := $(patsubst %.c,%.o,$(SRC))
+NAME := lzr
+
+all: $(NAME)
+
+$(NAME): $(OBJ)
+ $(LD) -o $(NAME) $(OBJ) $(LDFLAGS)
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+run: $(NAME)
+ ./$(NAME)
+
+clean:
+ rm -f $(NAME) $(OBJ)
+
+re:
+ make --no-print clean
+ make --no-print all
+
+.PHONY: all run clean re