2023-11-29 21:19:53 +09:00
|
|
|
NAME=sp
|
2024-02-01 16:01:25 +09:00
|
|
|
VERSION=1.2.0
|
2023-11-29 21:19:53 +09:00
|
|
|
# Linux、Haiku、かIllumos = /usr、FreeBSDかOpenBSD = /usr/local、NetBSD = /usr/pkg
|
|
|
|
PREFIX=/usr
|
|
|
|
CC=cc
|
2024-02-01 16:01:25 +09:00
|
|
|
FILES=main.c showpass.c yankpass.c addpass.c delpass.c listpass.c genpass.c initpass.c otppass.c base32.c
|
2024-02-01 16:01:47 +09:00
|
|
|
CFLAGS=-Wall -Wextra -O3 -I${PREFIX}/include -L${PREFIX}/lib
|
2023-12-01 02:25:27 +09:00
|
|
|
LDFLAGS=-lgpgme -lcrypto
|
2023-11-29 21:19:53 +09:00
|
|
|
|
|
|
|
all:
|
|
|
|
${CC} ${CFLAGS} -o ${NAME} ${FILES} ${LDFLAGS}
|
2024-02-01 16:01:47 +09:00
|
|
|
strip ${NAME}
|
2023-11-29 21:19:53 +09:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f ${NAME}
|
|
|
|
|
2023-11-30 08:15:37 +09:00
|
|
|
dist: clean
|
|
|
|
mkdir -p ${NAME}-${VERSION}
|
|
|
|
cp -R LICENSE.txt Makefile README.md CHANGELOG.md\
|
2023-12-01 02:29:59 +09:00
|
|
|
sp-completion.zsh\
|
2023-11-30 08:15:37 +09:00
|
|
|
*.c *.h ${NAME}-${VERSION}
|
|
|
|
tar zcfv ${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION}
|
|
|
|
rm -rf ${NAME}-${VERSION}
|
|
|
|
|
2023-11-29 21:19:53 +09:00
|
|
|
install: all
|
|
|
|
mkdir -p ${DESTDIR}${PREFIX}/bin
|
|
|
|
cp -f ${NAME} ${DESTDIR}${PREFIX}/bin
|
|
|
|
chmod 755 ${DESTDIR}${PREFIX}/bin/${NAME}
|
|
|
|
|
2023-12-01 02:25:27 +09:00
|
|
|
install-zsh:
|
2023-12-01 12:41:36 +09:00
|
|
|
cp sp-completion.zsh ${DESTDIR}${PREFIX}/share/zsh/site-functions/_sp
|
2023-12-01 02:25:27 +09:00
|
|
|
|
2023-11-29 21:19:53 +09:00
|
|
|
uninstall:
|
|
|
|
rm -f ${DESTDIR}${PREFIX}/bin/${NAME}
|
|
|
|
|
2023-12-01 02:29:59 +09:00
|
|
|
.PHONY: all clean dist install install-zsh uninstall
|