diff options
author | yogpstop <git@yogpc.com> | 2015-07-02 08:19:49 +0300 |
---|---|---|
committer | yogpstop <git@yogpc.com> | 2015-07-02 08:19:49 +0300 |
commit | 7df2078f6ffd84066294ad453cde299956e1c21d (patch) | |
tree | 948015c55b10a55db797375301a3a8df6cd0b0a1 | |
parent | 3bd33add5bb723b712272a2757c7fa2782d581dc (diff) |
Support UNIX build environment
-rw-r--r-- | build/MinGW/Makefile | 33 | ||||
-rw-r--r-- | include/MinHook.h | 2 | ||||
-rw-r--r-- | src/HDE/pstdint.h | 2 | ||||
-rw-r--r-- | src/buffer.c | 2 | ||||
-rw-r--r-- | src/hook.c | 4 | ||||
-rw-r--r-- | src/trampoline.c | 2 |
6 files changed, 39 insertions, 6 deletions
diff --git a/build/MinGW/Makefile b/build/MinGW/Makefile new file mode 100644 index 0000000..b0f6e96 --- /dev/null +++ b/build/MinGW/Makefile @@ -0,0 +1,33 @@ +WINDRES:=$(CROSS_PREFIX)windres +DLLTOOL:=$(CROSS_PREFIX)dlltool +AR:=$(CROSS_PREFIX)ar +CC:=$(CROSS_PREFIX)gcc +CCLD:=$(CC) +SRCS:=$(wildcard src/*.c src/HDE/*.c) +OBJS:=$(SRCS:%.c=%.o) +DEPS:=$(SRCS:%.c=%.d) +INCS:=-Isrc -Iinclude +CFLAGS:=-masm=intel -Wall -Werror -std=c11 +LDFLAGS:=-Wl,-enable-stdcall-fixup -s -static-libgcc + +all: MinHook.dll libMinHook.dll.a libMinHook.a + +-include $(DEPS) + +libMinHook.a: $(OBJS) + $(AR) r $@ $^ +libMinHook.dll.a: MinHook.dll dll_resources/MinHook.def + $(DLLTOOL) --dllname MinHook.dll --def dll_resources/MinHook.def --output-lib $@ +MinHook.dll: $(OBJS) dll_resources/MinHook.res dll_resources/MinHook.def + $(CCLD) -o $@ -shared $(LDFLAGS) $^ + +.rc.res: + $(WINDRES) -o $@ --input-format=rc --output-format=coff $< +.c.o: + $(CC) -o $@ -c -MMD -MP $(INCS) $(CFLAGS) $< + +clean: + rm -f $(OBJS) $(DEPS) MinHook.dll libMinHook.dll.a libMinHook.a dll_resources/MinHook.res + +.PHONY: clean +.SUFFIXES: .rc .res diff --git a/include/MinHook.h b/include/MinHook.h index aa6763b..70879df 100644 --- a/include/MinHook.h +++ b/include/MinHook.h @@ -32,7 +32,7 @@ #error MinHook supports only x86 and x64 systems. #endif -#include <Windows.h> +#include <windows.h> // MinHook Error Codes. typedef enum MH_STATUS diff --git a/src/HDE/pstdint.h b/src/HDE/pstdint.h index 6f87bd0..5b7c5f0 100644 --- a/src/HDE/pstdint.h +++ b/src/HDE/pstdint.h @@ -26,7 +26,7 @@ #pragma once -#include <Windows.h> +#include <windows.h> // Integer types for HDE. typedef INT8 int8_t; diff --git a/src/buffer.c b/src/buffer.c index 774e473..74f4709 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -29,7 +29,7 @@ #define STRICT #define NOMINMAX #define _WIN32_WINNT 0x0501 -#include <Windows.h> +#include <windows.h> #include "buffer.h" // Size of each memory block. (= page size of VirtualAlloc) @@ -28,8 +28,8 @@ #define STRICT #define _WIN32_WINNT 0x0501 -#include <Windows.h> -#include <TlHelp32.h> +#include <windows.h> +#include <tlhelp32.h> #include <limits.h> #include "../include/MinHook.h" diff --git a/src/trampoline.c b/src/trampoline.c index e006711..209c94d 100644 --- a/src/trampoline.c +++ b/src/trampoline.c @@ -26,7 +26,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <Windows.h> +#include <windows.h> #ifndef ARRAYSIZE #define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0])) |