]> Nishi Git Mirror - sp.git/commitdiff
OpenBSD向けリリースコマンドの追加
author諏訪子 <suwako@076.moe>
Mon, 15 Apr 2024 15:43:13 +0000 (00:43 +0900)
committer諏訪子 <suwako@076.moe>
Mon, 15 Apr 2024 15:43:13 +0000 (00:43 +0900)
.gitignore
Makefile

index e8a713eb409fd702c8a631c0d5fbacd1a960cbf2..f5badff744ede07f3834469c97d3c73d41a071c6 100644 (file)
@@ -1,4 +1,5 @@
 sp
+sp-*
 .ccls-cache
 *.o
 *.tar.gz
index b6f30ff717a360ba4588a3b1bd1d78457f713070..3717ca8a82c319c662a9eff401bfad8a8dfb718d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,19 +1,19 @@
-UNAME_S := $(shell uname -s)
+UNAME_S!=uname -s
 
-NAME := $(shell cat main.c | grep "const char\* sofname" | awk '{print $$5}' | sed "s/\"//g" | sed "s/;//" )
-VERSION := $(shell cat main.c | grep "const char\* version" | awk '{print $$5}' | sed "s/\"//g" | sed "s/;//" )
+NAME!=cat main.c | grep "const char\* sofname" | awk '{print $$5}' | sed "s/\"//g" | sed "s/;//"
+VERSION!=cat main.c | grep "const char\* version" | awk '{print $$5}' | sed "s/\"//g" | sed "s/;//"
+PREFIX=/usr/local
+
+.if ${UNAME_S} == "FreeBSD"
+MANPREFIX=${PREFIX}/share/man
+.elif ${UNAME_S} == "Linux"
 PREFIX=/usr
 MANPREFIX=${PREFIX}/share/man
-ifeq ($(UNAME_S),FreeBSD)
-       PREFIX=/usr/local
-endif
-ifeq ($(UNAME_S),OpenBSD)
-       PREFIX=/usr/local
-       MANPREFIX=${PREFIX}/man
-endif
-ifeq ($(UNAME_S),NetBSD)
-       PREFIX=/usr/pkg
-endif
+.elif ${UNAME_S} == "NetBSD"
+PREFIX=/usr/pkg
+MANPREFIX=${PREFIX}/share/man
+.endif
+
 CC=cc
 FILES=main.c showpass.c yankpass.c addpass.c delpass.c listpass.c genpass.c initpass.c otppass.c base32.c
 CFLAGS=-Wall -Wextra -O3 -I${PREFIX}/include -L${PREFIX}/lib
@@ -33,6 +33,10 @@ dist: clean
        tar zcfv ${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION}
        rm -rf ${NAME}-${VERSION}
 
+release-openbsd:
+       ${CC} ${CFLAGS} -o ${NAME}-${VERSION}-openbsd-amd64 ${FILES} -static -lgpgme -lcrypto -lc -lassuan -lgpg-error -lintl -liconv
+       strip ${NAME}
+
 install: all
        mkdir -p ${DESTDIR}${PREFIX}/bin
        cp -f ${NAME} ${DESTDIR}${PREFIX}/bin