From ffa3590ec75b69d5d1086336a4dc33d070197137 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=AB=8F=E8=A8=AA=E5=AD=90?= Date: Thu, 1 Feb 2024 17:13:24 +0900 Subject: [PATCH] . --- Makefile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 73328ee..2ffcfb7 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,17 @@ -NAME=sp -VERSION=1.2.0 -# Linux、Haiku、かIllumos = /usr、FreeBSDかOpenBSD = /usr/local、NetBSD = /usr/pkg +UNAME_S := $(shell 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/;//" ) PREFIX=/usr +ifeq ($(UNAME_S),FreeBSD) + PREFIX=/usr/local +endif +ifeq ($(UNAME_S),OpenBSD) + PREFIX=/usr/local +endif +ifeq ($(UNAME_S),NetBSD) + PREFIX=/usr/pkg +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 -- 2.43.0