-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
35 lines (31 loc) · 1.69 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
# You need mingw64 to compile this
# Change to wherever your system dlls are
WIN32PATH=/c/Windows/SysWOW64
WIN64PATH=/c/Windows/system32
.PHONY: bindip
all: bindip.exe bindip.dll 64/bindip.dll
release: zip msi
bindip: bindip.exe bindip.dll 64/bindip.dll
sign: bindip
strip *.exe *.dll 64/*.dll
cmd /c "signtool sign /v /f kat.pfx /t http://timestamp.verisign.com/scripts/timstamp.dll bindip.dll"
cmd /c "signtool sign /v /f kat.pfx /t http://timestamp.verisign.com/scripts/timstamp.dll 64/bindip.dll"
cmd /c "signtool sign /v /f kat.pfx /t http://timestamp.verisign.com/scripts/timstamp.dll bindip.exe"
zip: bindip
zip -r bindip.zip bindip.exe bindip.dll 64/bindip.dll
msi: bindip
candle bindip.wxs -out bindip.wixobj -ext WixIisExtension
light bindip.wixobj -out bindip.msi -ext WixIisExtension
CFLAGS=-Wall -Wno-unused -fno-stack-check -fno-stack-protector -mno-stack-arg-probe -fno-asynchronous-unwind-tables
LDFLAGS=-Wl,--enable-stdcall-fixup -lws2_32 -lADVAPI32 -lkernel32 -lUSER32 -lComdlg32 -lIPHLPAPI -lshlwapi -lSHELL32 -lWSHTCPIP -Wl,--allow-multiple-definition -lmsvcrt
bindip.exe: bindip.dll bindip.c dialog.rc resource.h common.h
windres.exe -F pe-i386 dialog.rc dialog.o
$(CC) -Os -m32 -nostdlib $(CFLAGS) -o bindip.exe -L$(WIN32PATH) $(LDFLAGS) bindip.dll bindip.c dialog.o -Wl,-e_winMain
# -Wl,-subsystem,windows
bindip.dll: dll.c common.h
$(CC) -Os -shared -m32 -nostdlib $(CFLAGS) -o bindip.dll -L$(WIN32PATH) $(LDFLAGS) dll.c -Wl,-e_DllMain dll.def
64/bindip.dll: dll.c common.h
mkdir -p 64
$(CC) -Os -shared -nostdlib $(CFLAGS) -o 64/bindip.dll -L$(WIN64PATH) $(LDFLAGS) dll.c -Wl,-eDllMain dll.def
clean:
rm -rf *.o *.dll 64 bindip.exe *.wixobj bindip *.zip