]> Nishi Git Mirror - odl.git/commitdiff
Minux、Haiku、とmacOSでコンパイル出来る様に
author諏訪子 <suwako@076.moe>
Fri, 5 Jul 2024 12:30:03 +0000 (21:30 +0900)
committer諏訪子 <suwako@076.moe>
Fri, 5 Jul 2024 12:30:03 +0000 (21:30 +0900)
CHANGELOG.md
Makefile
README.md
main.c

index 04b33e2e30abd8820f51c7b21a714b7fa91cf0df..fa541a26215b0a5f338c02c5112b032c1417a9e8 100644 (file)
@@ -1,3 +1,6 @@
+# 0.3.1
+* Minix、Haiku、とmacOSでコンパイル出来る様に
+
 # 0.3.0
 * CDNの回避
 * Pixivからダウンロード出来る様に
index 4b0c6501b382987f3424b85b123c6b1c68d9418b..d374733563dff9fa4003fa12930b40fd757bc09b 100644 (file)
--- 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
index 47ce343406795322082917553a85b3b0754ec17e..86c8be2baa70c92dd590a2c63a96c2b91292b357 100644 (file)
--- 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 4b738d484b6c449cb8a7840c71b0d019ca0d3a7b..71fd440401cb6bc7ba843899a477c1c928e8ea2b 100644 (file)
--- a/main.c
+++ b/main.c
@@ -7,7 +7,7 @@
 #include <curl/curl.h>
 
 const char* sofname = "odl";
-const char* version = "0.3.0";
+const char* version = "0.3.1";
 const char* avalopt = "nopv";
 char* filename;