From a29867337edfd63c74100c2a93c8c61f146cf275 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=AB=8F=E8=A8=AA=E5=AD=90?= Date: Tue, 16 Apr 2024 00:43:13 +0900 Subject: [PATCH] =?utf8?q?OpenBSD=E5=90=91=E3=81=91=E3=83=AA=E3=83=AA?= =?utf8?q?=E3=83=BC=E3=82=B9=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89=E3=81=AE?= =?utf8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + Makefile | 30 +++++++++++++++++------------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index e8a713e..f5badff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ sp +sp-* .ccls-cache *.o *.tar.gz diff --git a/Makefile b/Makefile index b6f30ff..3717ca8 100644 --- 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 -- 2.43.0