Add dist script to Makefile
This commit is contained in:
parent
f245ec319f
commit
f9bb12d0ad
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,4 @@
|
|||||||
x86_64-pc-windows
|
x86_64-pc-windows
|
||||||
*.o
|
*.o
|
||||||
*.dll
|
*.dll
|
||||||
original.cpp
|
*.7z
|
||||||
|
23
Makefile
23
Makefile
@ -27,6 +27,12 @@ ${TARGET}/%.o: %.c
|
|||||||
@echo BUILD $@
|
@echo BUILD $@
|
||||||
@${CC} -c ${CFLAGS} $< -o $@
|
@${CC} -c ${CFLAGS} $< -o $@
|
||||||
|
|
||||||
|
.PHONY: SDL
|
||||||
|
SDL:
|
||||||
|
@mkdir -p SDL/${SDL_TARGET}
|
||||||
|
@cd SDL/${SDL_TARGET} && ../configure --build=x86_64-linux-gnu --host=${SDL_TARGET} --disable-sdl2-config --disable-shared --enable-assertions=release --enable-directx --enable-haptic
|
||||||
|
@make -s -C SDL/${SDL_TARGET}
|
||||||
|
|
||||||
.PHONY: ${OUT}
|
.PHONY: ${OUT}
|
||||||
${OUT}: dirs ${DEPS} ${OBJ}
|
${OUT}: dirs ${DEPS} ${OBJ}
|
||||||
@echo LINK $@
|
@echo LINK $@
|
||||||
@ -40,8 +46,15 @@ fmt:
|
|||||||
clean:
|
clean:
|
||||||
rm -rf ${TARGET}
|
rm -rf ${TARGET}
|
||||||
|
|
||||||
.PHONY: SDL
|
.PHONY: patches
|
||||||
SDL:
|
patches:
|
||||||
@mkdir -p SDL/${SDL_TARGET}
|
make -C patches/8.18
|
||||||
@cd SDL/${SDL_TARGET} && ../configure --build=x86_64-linux-gnu --host=${SDL_TARGET} --disable-sdl2-config --disable-shared --enable-assertions=release --enable-directx --enable-haptic
|
|
||||||
@make -s -C SDL/${SDL_TARGET}
|
.PHONY: dist
|
||||||
|
dist: options ${OUT} ${patches}
|
||||||
|
mkdir -p out/plugins
|
||||||
|
cp ${TARGET}/${OUT}.dll out/
|
||||||
|
cp ${TARGET}/patches.*.dll out/plugins
|
||||||
|
cp dist/* out/
|
||||||
|
cd out && 7z a -t7z ../${OUT}.7z .
|
||||||
|
rm -rf out
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
OUT = patches.818
|
OUT = patches.8.18
|
||||||
CC := clang
|
CC := clang
|
||||||
TARGET := x86_64-pc-windows-gnu
|
TARGET := x86_64-pc-windows-gnu
|
||||||
SRC = dllmain.c
|
SRC = dllmain.c
|
||||||
OBJ = ${addprefix ${TARGET}/,${SRC:.c=.o}}
|
OBJ = ${addprefix ../../${TARGET}/patches/8.18/,${SRC:.c=.o}}
|
||||||
EXTERN_SRC = 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
|
EXTERN_SRC = 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
|
||||||
EXTERN_OBJ = ${addprefix ../../${TARGET}/,${EXTERN_SRC:.c=.o}}
|
EXTERN_OBJ = ${addprefix ../../${TARGET}/,${EXTERN_SRC:.c=.o}}
|
||||||
CFLAGS = -std=c99 -I../../src -I../../minhook/include -I../../tomlc99 -Wall -Ofast -target ${TARGET} -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=_WIN32_WINNT_WIN7
|
CFLAGS = -std=c99 -I../../src -I../../minhook/include -I../../tomlc99 -Wall -Ofast -target ${TARGET} -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=_WIN32_WINNT_WIN7
|
||||||
@ -13,7 +13,7 @@ all: options ${OUT}
|
|||||||
|
|
||||||
.PHONY: dirs
|
.PHONY: dirs
|
||||||
dirs:
|
dirs:
|
||||||
@mkdir -p ${TARGET}
|
@mkdir -p ../../${TARGET}/patches/8.18
|
||||||
|
|
||||||
.PHONY: options
|
.PHONY: options
|
||||||
options:
|
options:
|
||||||
@ -21,11 +21,11 @@ options:
|
|||||||
@echo "LDFLAGS = ${LDFLAGS}"
|
@echo "LDFLAGS = ${LDFLAGS}"
|
||||||
@echo "CC = ${CC}"
|
@echo "CC = ${CC}"
|
||||||
|
|
||||||
${TARGET}/%.o: %.c
|
../../${TARGET}/patches/8.18/%.o: %.c
|
||||||
@echo BUILD $@
|
@echo BUILD $@
|
||||||
@${CC} -c ${CFLAGS} $< -o $@
|
@${CC} -c ${CFLAGS} $< -o $@
|
||||||
|
|
||||||
.PHONY: ${OUT}
|
.PHONY: ${OUT}
|
||||||
${OUT}: dirs ${DEPS} ${OBJ}
|
${OUT}: dirs ${DEPS} ${OBJ}
|
||||||
@echo LINK $@
|
@echo LINK $@
|
||||||
@${CC} ${CFLAGS} -o ${TARGET}/$@.dll ${OBJ} ${EXTERN_OBJ} ${LDFLAGS} ${LIBS}
|
@${CC} ${CFLAGS} -o ../../${TARGET}/$@.dll ${OBJ} ${EXTERN_OBJ} ${LDFLAGS} ${LIBS}
|
||||||
|
Loading…
Reference in New Issue
Block a user