From: 諏訪子 Date: Fri, 5 Jul 2024 12:30:03 +0000 (+0900) Subject: Minux、Haiku、とmacOSでコンパイル出来る様に X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=c9eb6a756f6823996528556340d11174a8a15419;p=odl.git Minux、Haiku、とmacOSでコンパイル出来る様に --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 04b33e2..fa541a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.3.1 +* Minix、Haiku、とmacOSでコンパイル出来る様に + # 0.3.0 * CDNの回避 * Pixivからダウンロード出来る様に diff --git a/Makefile b/Makefile index 4b0c650..d374733 100644 --- a/Makefile +++ b/Makefile @@ -1,29 +1,46 @@ UNAME_S!=uname -s UNAME_M!=uname -m -NAME!=cat main.c | grep "const char\* sofname" | awk '{print $$5}' | \ +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}' | \ +VERSION != cat main.c | grep "const char\* version" | awk '{print $$5}' | \ sed "s/\"//g" | sed "s/;//" -PREFIX=/usr/local -MANPREFIX=${PREFIX}/man -CFLAGS=-Wall -Wextra -g -I/usr/include -I/usr/local/include -LDFLAGS=-L/usr/lib -L/usr/local/lib - -.if ${UNAME_S} == "FreeBSD" -MANPREFIX=${PREFIX}/share/man -.elif ${UNAME_S} == "Linux" -PREFIX=/usr -MANPREFIX=${PREFIX}/share/man -.elif ${UNAME_S} == "NetBSD" -CFLAGS+=-I/usr/pkg/include -LDFLAGS+=-L/usr/pkg/lib -MANPREFIX=${PREFIX}/share/man +PREFIX = /usr/local +.if ${UNAME_S} == "Linux" +PREFIX = /usr +.elif ${UNAME_S} == "Haiku" +PREFIX = /boot/home/config/non-packaged +.elif ${UNAME_S} == "Darwin" .endif -CC=cc -FILES=main.c -LIBS=-lcurl +MANPREFIX = ${PREFIX}/share/man +.if ${UNAME_S} == "OpenBSD" +MANPREFIX = ${PREFIX}/man +.elif ${UNAME_S} == "Haiku" +MANPREFIX = ${PREFIX}/documentation/man +.endif + +CFLAGS = -Wall -Wextra -g -I/usr/include -I/usr/local/include +LDFLAGS = -L/usr/lib -L/usr/local/lib + +.if ${UNAME_S} == "NetBSD" || ${UNAME_S} == "Minix" +CFLAGS += -I/usr/pkg/include +LDFLAGS += -L/usr/pkg/lib +.elif ${UNAME_S} == "Haiku" +CFLAGS += -I/boot/system/develop/headers +LDFLAGS += -L/boot/system/develop/lib +.elif ${UNAME_S} == "Darwin" +CFLAGS += -I/opt/local/include +LDFLAGS += -L/opt/local/lib +.endif + +CC = cc +.if ${UNAME_S} == "Minix" +CC = clang +.endif + +FILES = main.c +LIBS = -lcurl all: ${CC} ${CFLAGS} -o ${NAME} ${FILES} ${LDFLAGS} ${LIBS} @@ -68,12 +85,15 @@ release-linux: dist: mkdir -p ${NAME}-${VERSION} release/src - cp -R LICENSE.txt Makefile README.md CHANGELOG.md ${NAME}.1 \ - *.c ${NAME}-${VERSION} - tar zcfv ${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION} - mv ${NAME}-${VERSION}.tar.gz release/src + cp -R LICENSE.txt Makefile README.md CHANGELOG.md\ + ${NAME}.1 ${FILES} ${NAME}-${VERSION} + tar zcfv release/src/${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION} rm -rf ${NAME}-${VERSION} +man: + mkdir -p release/man + cp ${NAME}.1 release/man/${NAME}-${VERSION}.1 + install: mkdir -p ${DESTDIR}${PREFIX}/bin cp -f ${NAME} ${DESTDIR}${PREFIX}/bin @@ -84,4 +104,7 @@ uninstall: rm -f ${DESTDIR}${MANPREFIX}/man1/${NAME}.1 rm -f ${DESTDIR}${PREFIX}/bin/${NAME} -.PHONY: all clean install uninstall +.PHONY: all clean\ + release-openbsd release-linux release-freebsd release-netbsd\ + dist man\ + install uninstall diff --git a/README.md b/README.md index 47ce343..86c8be2 100644 --- a/README.md +++ b/README.md @@ -35,3 +35,25 @@ doas prt-get depinst curl bmake bmake doas bmake install ``` + +### Minix +```sh +su +pkgin install curl clang bmake +bmake +bmake install +``` + +### Haiku +```sh +pkgman install curl curl_devel bmake +bmake +bmake install +``` + +### macOS +```sh +brew install curl bmake +bmake +doas bmake install +``` diff --git a/main.c b/main.c index 4b738d4..71fd440 100644 --- a/main.c +++ b/main.c @@ -7,7 +7,7 @@ #include const char* sofname = "odl"; -const char* version = "0.3.0"; +const char* version = "0.3.1"; const char* avalopt = "nopv"; char* filename;