-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
71 lines (62 loc) · 1.4 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
CC := i686-w64-mingw32-gcc
RM := rm
SRCDIR := src/
OBJDIR := obj/
VERSION ?= $(shell git describe --tags --always --dirty)
CFLAGS := -DSTRSAFE_NO_DEPRECATE
LDFLAGS := \
-nodefaultlibs \
-nostartfiles \
third_party/ijl/ijl15l.lib \
-lws2_32 \
-lkernel32 \
-luser32 \
third_party/msvcrt/msvcrt.lib \
-Wl,--enable-stdcall-fixup \
-s
OBJS := \
obj/dll/rugburn/main.o \
obj/hooks/kernel32/inject.o \
obj/hooks/msvcr100/msvcr100.o \
obj/hooks/projectg/us852/ranking.o \
obj/hooks/user32/window.o \
obj/hooks/ws2_32/redir.o \
obj/hooks/wininet/netredir.o \
obj/hooks/comctl32/dynamic_patch.o \
obj/hooks/hooks.o \
obj/ld.o \
obj/common.o \
obj/config.o \
obj/hex.o \
obj/ijl15.o \
obj/json.o \
obj/patch.o \
obj/regex.o \
obj/stubs.o
TESTOBJS := \
$(OBJS) \
obj/exe/test/main.o
OUT := out/ijl15.dll
TESTOUT := out/test.exe
ifneq ($(OS),Windows_NT)
EXECWIN := wine
endif
all: $(OUT) $(TESTOUT)
.PHONY: check clean
# Rugburn
$(OBJDIR)%.o: $(SRCDIR)%.c
@mkdir -p "$(dir $@)"
$(CC) -c $(CFLAGS) "$<" -o "$@"
$(OBJDIR)%.o: $(SRCDIR)%.S
@mkdir -p "$(dir $@)"
$(CC) -c $(CFLAGS) "$<" -o "$@"
$(OUT): $(OBJS)
@mkdir -p "$(dir $@)"
$(CC) $(OBJS) $(LDFLAGS) -shared -o "$@" export.def -Wl,-e_DllMain
$(TESTOUT): $(TESTOBJS)
@mkdir -p "$(dir $@)"
$(CC) $(TESTOBJS) $(LDFLAGS) -o "$@" -Wl,-e_start
check: out/test.exe
$(EXECWIN) out/test.exe | tappy
clean:
$(RM) -f $(OBJS) $(TESTOBJS) $(OUT) $(TESTOUT)