1
1
mirror of synced 2025-01-23 23:04:06 +01:00

67 lines
1.8 KiB
Makefile
Raw Normal View History

2022-06-20 05:36:27 +12:00
OUT = TAL
2023-09-09 21:01:01 +12:00
CC = x86_64-w64-mingw32-gcc
TARGET = x86_64-pc-windows-gnu
2022-08-19 02:34:43 +12:00
SRC = src/dllmain.c src/helpers.c src/poll.c src/boilerplate.c tomlc99/toml.c minhook/src/buffer.c minhook/src/hook.c minhook/src/trampoline.c minhook/src/hde/hde32.c minhook/src/hde/hde64.c
OBJ = ${addprefix ${TARGET}/,${SRC:.c=.o}}
2023-09-09 21:01:01 +12:00
CFLAGS = -std=c99 -Iminhook/include -ISDL/include -ISDL/build/include -Itomlc99 -Wall -Ofast -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=_WIN32_WINNT_WIN7
LDFLAGS = -shared -static -static-libgcc -s
LIBS = SDL/build/libSDL3.a SDL/build/libSDL3_main.a -lmingw32 -luuid -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lsetupapi -lversion
2022-06-20 05:36:27 +12:00
DEPS = SDL
2023-09-09 21:01:01 +12:00
all: options ${OUT} plugins
2022-06-20 05:36:27 +12:00
.PHONY: dirs
dirs:
@mkdir -p ${TARGET}/src
@mkdir -p ${TARGET}/minhook/src/hde
@mkdir -p ${TARGET}/tomlc99
.PHONY: options
options:
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "CC = ${CC}"
${TARGET}/%.o: %.c
@echo BUILD $@
@${CC} -c ${CFLAGS} $< -o $@
2022-08-16 01:57:15 +12:00
2022-06-22 12:47:25 +12:00
.PHONY: SDL
SDL:
2023-09-09 21:01:01 +12:00
@cd SDL && cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=build-scripts/cmake-toolchain-mingw64-x86_64.cmake && cmake --build build
2022-06-22 12:47:25 +12:00
2022-06-20 05:36:27 +12:00
.PHONY: ${OUT}
${OUT}: dirs ${DEPS} ${OBJ}
@echo LINK $@
2022-08-19 02:34:43 +12:00
@${CC} ${CFLAGS} -o ${TARGET}/$@.dll ${OBJ} ${LDFLAGS} ${LIBS}
2022-06-20 05:36:27 +12:00
.PHONY: fmt
fmt:
@cd src && clang-format -i *.h *.c -style=file
2022-10-13 09:09:13 +13:00
@cd plugins/8.18 && clang-format -i *.c -style=file
@cd plugins/amauth && clang-format -i *.c -style=file
2022-06-20 05:36:27 +12:00
.PHONY: clean
clean:
rm -rf ${TARGET}
2022-10-13 09:09:13 +13:00
.PHONY: plugins
plugins:
2022-10-17 05:38:40 +13:00
make -C plugins/8.18
make -C plugins/amauth
2022-10-13 09:17:37 +13:00
strip ${TARGET}/*.dll
2022-06-22 12:47:25 +12:00
2022-06-22 12:49:31 +12:00
.PHONY: dist-no-7z
2022-10-13 09:09:13 +13:00
dist-no-7z: options ${OUT} plugins
2022-06-22 12:47:25 +12:00
mkdir -p out/plugins
cp ${TARGET}/${OUT}.dll out/
2022-06-22 13:36:55 +12:00
mv out/${OUT}.dll out/bnusio.dll
2022-10-13 09:12:06 +13:00
cp ${TARGET}/patches.*.dll out/plugins
2022-09-16 10:03:23 +12:00
cp ${TARGET}/amauth.dll out/plugins
2022-08-19 02:09:45 +12:00
cp -r dist/* out/
2022-06-22 12:49:31 +12:00
.PHONY: dist
dist: dist-no-7z
2022-06-22 12:47:25 +12:00
cd out && 7z a -t7z ../${OUT}.7z .
rm -rf out