From 94156b82387fd4400e64e548422a8ee7ffa22d41 Mon Sep 17 00:00:00 2001 From: 8dcc <8dcc.git@gmail.com> Date: Wed, 19 Jul 2023 20:13:35 +0200 Subject: [PATCH] Add Makefile --- Makefile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d8124ca --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ + +CC=gcc +CFLAGS=-Wall -Wextra -m32 -fPIC +LDFLAGS= + +OBJS=obj/main.c.o +BIN=libhlcheat.so + +.PHONY: clean all inject + +# ------------------------------------------- + +all: $(BIN) + +clean: + rm -f $(OBJS) + rm -f $(BIN) + +inject: + bash ./inject.sh + +# ------------------------------------------- + +# -fPIC (in CFLAGS) and -shared for creating a library (shared object) +# -m32 (in CFLAGS) because of the game's arch +$(BIN): $(OBJS) + $(CC) $(CFLAGS) -shared -o $@ $(OBJS) $(LDFLAGS) + +$(OBJS): obj/%.c.o : src/%.c + @mkdir -p obj/ + $(CC) $(CFLAGS) -c -o $@ $< $(LDFLAGS)