From a324b14759111df79e6cde04d3de2c702a30795c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=AB=8F=E8=A8=AA=E5=AD=90?= Date: Sat, 14 Sep 2024 00:39:57 +0900 Subject: [PATCH] =?utf8?q?=E9=9D=99=E7=9A=84=E3=83=AA=E3=83=B3=E3=82=AF?= =?utf8?q?=E3=81=AF=E3=83=87=E3=83=95=E3=82=A9=E3=83=AB=E3=83=88=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + Makefile | 28 +++++++++++++++++----------- src/findpass.c | 2 ++ 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4d882c..3467a13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * Haiku対応 * macOS対応 * パスワードの検索の追加 +* 静的リンクはデフォルトに # 1.3.0 * 英訳の追加 (レミリア・スカーレットさん) diff --git a/Makefile b/Makefile index 8ebd166..4e0f69c 100644 --- a/Makefile +++ b/Makefile @@ -41,27 +41,33 @@ DATAPREFIX = ${PREFIX}/data CC = cc FILES = main.c src/*.c -CFLAGS = -Wall -Wextra -O3 -I${PREFIX}/include -L${PREFIX}/lib + +CFLAGS = -Wall -Wextra -I/usr/include -L/usr/lib .if ${UNAME_S} == "NetBSD" -CFLAGS += -I/usr/pkg/include -L/usr/pkg/lib -I/usr/include -L/usr/lib +CFLAGS += -I/usr/pkg/include -L/usr/pkg/lib -I/usr/local/include -L/usr/local/lib +.elif ${UNAME_S} == "OpenBSD" || ${UNAME_S} == "FreeBSD" +CFLAGS += -I/usr/local/include -L/usr/local/lib .endif + LDFLAGS = -lgpgme -lcrypto -SLDFLAGS = -static ${LDFLAGS} .if ${UNAME_S} == "OpenBSD" -SLDFLAGS += -lc -lassuan -lgpg-error -lintl -liconv +LDFLAGS += -lc -lassuan -lgpg-error -lintl -liconv .elif ${UNAME_S} == "FreeBSD" -SLDFLAGS += -lc -lassuan -lgpg-error -lthr -lintl +LDFLAGS += -lc -lassuan -lgpg-error -lthr -lintl .elif ${UNAME_S} == "NetBSD" -SLDFLAGS += -lcrypt -lc -lassuan -lgpg-error -lintl -.elif ${UNAME_S} -SLDFLAGS += -lc -lassuan -lgpg-error +LDFLAGS += -lcrypt -lc -lassuan -lgpg-error -lintl +.elif ${UNAME_S} == "Linux" +LDFLAGS += -lc -lassuan -lgpg-error .endif all: - ${CC} ${CFLAGS} -o ${NAME} ${FILES} ${LDFLAGS} + ${CC} -O3 ${CFLAGS} -o ${NAME} ${FILES} -static ${LDFLAGS} strip ${NAME} +debug: + ${CC} -g ${CFLAGS} -o ${NAME} ${FILES} ${LDFLAGS} + clean: rm -f ${NAME} @@ -81,8 +87,8 @@ man: release: mkdir -p release/bin/${VERSION}/${OS}/${UNAME_M} - ${CC} ${CFLAGS} -o release/bin/${VERSION}/${OS}/${UNAME_M}/${NAME} ${FILES} \ - ${SLDFLAGS} + ${CC} -O3 ${CFLAGS} -o release/bin/${VERSION}/${OS}/${UNAME_M}/${NAME} ${FILES} \ + -static ${LDFLAGS} strip release/bin/${VERSION}/${OS}/${UNAME_M}/${NAME} install: diff --git a/src/findpass.c b/src/findpass.c index fdf0a7c..69c5690 100644 --- a/src/findpass.c +++ b/src/findpass.c @@ -70,6 +70,8 @@ void scanDir(const char *dpath, const char *rpath, List *fpaths) { char *disname = strdup(rel); rmext(disname); addElement(&dispaths, disname); + + free(disname); } } -- 2.43.0