-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile.win
More file actions
69 lines (52 loc) · 3.07 KB
/
Makefile.win
File metadata and controls
69 lines (52 loc) · 3.07 KB
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
.PHONY: clean distclean
APP = encrypt
APP_SIG = encrypt-signed
VERSION = 2025.05
CC = gcc
WRES = windres
NSIS = C:/Program\ Files\ \(x86\)/NSIS/makensis.exe
SIGN = osslsigncode
COMMON_SRC = common/src/error.c common/src/mem.c common/src/ccrypt.c common/src/list.c common/src/tlv.c common/src/version.c common/src/config.c common/src/cli.c common/src/dir.c common/src/ecc.c common/src/non-gnu.c
CLI_SRC = ${COMMON_SRC} src/main.c src/crypt.c src/encrypt.c src/decrypt.c src/crypt_io.c
GUI_SRC = ${CLI_SRC} src/gui-gtk.c
MISC = common/misc.h
RC = src/encrypt_private.rc
RES = src/encrypt_private.res
GUI_CFLAGS = ${CFLAGS} -Wall -Wextra -std=gnu99 `pkg-config --cflags libgcrypt` -pipe -O2 -mwindows -Wformat=0 `pkg-config --cflags gtk+-3.0 gmodule-2.0`
GUI_CPPFLAGS = ${CPPFLAGS} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DGCRYPT_NO_DEPRECATED -DUSE_GCRYPT -DGIT_COMMIT=\"`git log | head -n1 | cut -f2 -d' '`\" -D__USE_MINGW_ANSI_STDIO -DBUILD_OS=\""`uname --operating-system --kernel-name --kernel-release`"\" -DBUILD_GUI
DEBUG_CFLAGS = -O0 -ggdb -pg -mconsole
DEBUG_CPPFLAGS = -D__DEBUG__ -D__DEBUG_GUI__ -DMALLOC_CHECK_=1
GUI_LIBS = `pkg-config --libs libgcrypt` -lpthread -lcurl -llzma `pkg-config --libs gtk+-3.0 gmodule-2.0`
INST = encrypt.nsi
PKG = encrypt-${VERSION}-install.exe
PKG_SIG = encrypt-${VERSION}-install-signed.exe
RESOPTS = --output-format=coff --input-format=rc
SIGOPTS = -verbose -certs signing/authenticode.spc -key signing/authenticode.key -n "${APP}" -i "https://albinoloverats.net/"
all: sign
debug: debug-gui
winres:
@${WRES} -i ${RC} ${RESOPTS} -o ${RES}
-@echo -e "compiled Windows application metadata"
gui: winres
@echo "#define ALL_CFLAGS ${GUI_CFLAGS} " | tr "\"" "'" | sed 's/FLAGS /FLAGS "/' | sed 's/$$/"/' > ${MISC}
@echo "#define ALL_CPPFLAGS ${GUI_CPPFLAGS}" | tr "\"" "'" | sed 's/FLAGS /FLAGS "/' | sed 's/$$/"/' >> ${MISC}
@${CC} ${GUI_CFLAGS} ${GUI_CPPFLAGS} ${GUI_SRC} ${RES} ${GUI_LIBS} -o ${APP}
-@echo -e "built ‘`echo -e ${GUI_SRC} | sed 's/ /’\n ‘/g'`’ → ‘${APP}’"
sign: gui
@${SIGN} ${SIGOPTS} -in ${APP}.exe ${APP_SIG}.exe
-@echo -e "signed ‘${APP}’ → ‘${APP_SIG}’"
-@mv -v ${APP_SIG} ${APP}
debug-gui: winres
@echo "#define ALL_CFLAGS ${GUI_CFLAGS} ${DEBUG_CFLAGS} " | tr "\"" "'" | sed 's/FLAGS /FLAGS "/' | sed 's/$$/"/' > ${MISC}
@echo "#define ALL_CPPFLAGS ${GUI_CPPFLAGS} ${DEBUG_CPPFLAGS}" | tr "\"" "'" | sed 's/FLAGS /FLAGS "/' | sed 's/$$/"/' >> ${MISC}
@${CC} ${GUI_CFLAGS} ${GUI_CPPFLAGS} ${GUI_SRC} ${RES} ${DEBUG_CFLAGS} ${DEBUG_CPPFLAGS} ${GUI_LIBS} -o ${APP}
-@echo -e "built ‘`echo -e ${GUI_SRC} | sed 's/ /’\n ‘/g'`’ → ‘${APP}’"
installer:
@${NSIS} ${INST}
@${SIGN} ${SIGOPTS} -in ${PKG} -out ${PKG_SIG}
-@echo -e "signed ‘${PKG}’ → ‘${PKG_SIG}’"
-@mv -v ${PKG_SIG} ${PKG}
clean:
@rm -fv ${APP} ${APP_SIG} ${MISC} ${RES}
distclean: clean
@rm -fv ${PKG} ${PKG_SIG} gmon.out