-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
97 lines (74 loc) · 3.39 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Important stuff
CFLAGS =
LIBS = -luuid -ldxguid -ldinput -ldinput8
# (maybe) distro-specific stuff
MINGW32 = i686-w64-mingw32
MINGW64 = i686-w64-mingw32
BIN = /usr/bin
USR = /usr
LIB = lib/ # used in as ${USR}/${MINGWxy}/${LIB}
INCLUDE = include/ # used in as ${USR}/${MINGWxy}/${INCLUDE}
# Computed
GCC32 = ${BIN}/${MINGW32}-gcc
INCLUDE_DIR32 = -I${USR}/${MINGW32}/include -Idumbxinputemu
LIB_DIR32 = -L{USR}/${MINGW32}/lib/
GCC64 = ${BIN}/x86_64-w64-mingw32-gcc -D _WXI_MINGW
INCLUDE_DIR64 = -I${USR}/${MINGW64}/include -Idumbxinputemu
LIB_DIR64 = -L{USR}/${MINGW64}/lib/
.PHONY: default
default: 32bit 64bit
# ---- Targets -------
%.32.o: %.c
${GCC32} ${CFLAGS} ${INCLUDE_DIR32} ${LIB_DIR32} -c $? -o $@
%.64.o: %.c
${GCC64} ${CFLAGS} ${INCLUDE_DIR64} ${LIB_DIR64} -c $? -o $@
# ------ 32 bit
build/32/xinput1_1.dll: xinput1_1/exports.def dumbxinputemu/dinput_input.32.o xinput1_1/xinput1_1.32.o
mkdir -p build/32/
${GCC32} --shared ${CFLAGS} ${INCLUDE_DIR32} ${LIB_DIR32} $? ${LIBS} -o $@
build/32/xinput1_2.dll: xinput1_2/exports.def dumbxinputemu/dinput_input.32.o xinput1_2/xinput1_2.32.o
mkdir -p build/32/
${GCC32} --shared ${CFLAGS} ${INCLUDE_DIR32} ${LIB_DIR32} $? ${LIBS} -o $@
build/32/xinput1_3.dll: xinput1_3/exports.def dumbxinputemu/dinput_input.32.o xinput1_3/xinput1_3.32.o
mkdir -p build/32/
${GCC32} --shared ${CFLAGS} ${INCLUDE_DIR32} ${LIB_DIR32} $? ${LIBS} -o $@
build/32/xinput1_4.dll: xinput1_4/exports.def dumbxinputemu/dinput_input.32.o xinput1_4/xinput1_4.32.o
mkdir -p build/32/
${GCC32} --shared ${CFLAGS} ${INCLUDE_DIR32} ${LIB_DIR32} $? ${LIBS} -o $@
build/32/xinput9_1_0.dll: xinput9_1_0/exports.def dumbxinputemu/dinput_input.32.o xinput9_1_0/xinput9_1_0.32.o
mkdir -p build/32/
${GCC32} --shared ${CFLAGS} ${INCLUDE_DIR32} ${LIB_DIR32} $? ${LIBS} -o $@
# ------ 64 bit
build/64/xinput1_1.dll: xinput1_1/exports.def dumbxinputemu/dinput_input.64.o xinput1_1/xinput1_1.64.o
mkdir -p build/64/
${GCC64} --shared ${CFLAGS} ${INCLUDE_DIR64} ${LIB_DIR64} $? ${LIBS} -o $@
build/64/xinput1_2.dll: xinput1_2/exports.def dumbxinputemu/dinput_input.64.o xinput1_2/xinput1_2.64.o
mkdir -p build/64/
${GCC64} --shared ${CFLAGS} ${INCLUDE_DIR64} ${LIB_DIR64} $? ${LIBS} -o $@
build/64/xinput1_3.dll: xinput1_3/exports.def dumbxinputemu/dinput_input.64.o xinput1_3/xinput1_3.64.o
mkdir -p build/64/
${GCC64} --shared ${CFLAGS} ${INCLUDE_DIR64} ${LIB_DIR64} $? ${LIBS} -o $@
build/64/xinput1_4.dll: xinput1_4/exports.def dumbxinputemu/dinput_input.64.o xinput1_4/xinput1_4.64.o
mkdir -p build/64/
${GCC64} --shared ${CFLAGS} ${INCLUDE_DIR64} ${LIB_DIR64} $? ${LIBS} -o $@
build/64/xinput9_1_0.dll: xinput9_1_0/exports.def dumbxinputemu/dinput_input.64.o xinput9_1_0/xinput9_1_0.64.o
mkdir -p build/64/
${GCC64} --shared ${CFLAGS} ${INCLUDE_DIR64} ${LIB_DIR64} $? ${LIBS} -o $@
clean:
rm -f dumbxinputemu/*.o
rm -f xinput1_1/*.o
rm -f xinput1_2/*.o
rm -f xinput1_3/*.o
rm -f xinput1_4/*.o
rm -f xinput9_1_0/*.o
rm -f build/32/*
rm -f build/64/*
winetricks-verb:
cp setup_dumbxinputemu.verb build/
32bit: build/32/xinput1_3.dll build/32/xinput1_4.dll build/32/xinput9_1_0.dll
64bit: build/64/xinput1_3.dll build/64/xinput9_1_0.dll
all: build/32/xinput1_1.dll build/32/xinput1_2.dll build/32/xinput1_3.dll \
build/32/xinput1_4.dll build/32/xinput9_1_0.dll \
build/64/xinput1_1.dll build/64/xinput1_2.dll build/64/xinput1_3.dll \
build/64/xinput1_4.dll build/64/xinput9_1_0.dll \
winetricks-verb