]> Nishi Git Mirror - mandshurica.git/commitdiff
should work
authornishi <nishi@f982e544-4a7d-3444-ad1a-fde59a2a69f1>
Sat, 11 May 2024 00:23:45 +0000 (00:23 +0000)
committernishi <nishi@f982e544-4a7d-3444-ad1a-fde59a2a69f1>
Sat, 11 May 2024 00:23:45 +0000 (00:23 +0000)
git-svn-id: file:///raid/svn-main/nishi-mandshurica/trunk@70 f982e544-4a7d-3444-ad1a-fde59a2a69f1

GNUmakefile
Mandshurica/config.c
build.sh [new file with mode: 0755]

index d798f504023a4f26481bd976f8881ff02f028134..260e89350d755b85080c296729538ca4829442ab 100644 (file)
@@ -2,9 +2,10 @@
 PREFIX := /usr/local
 MODULE_PREFIX := $(PREFIX)/lib/mandshurica
 WEBROOT_PREFIX := $(PREFIX)/lib/mandshurica/webroot
+PROJECTS_PREFIX := $(PREFIX)/lib/mandshurica/projects
 
 CC := gcc
-CFLAGS := -g -std=c99 -DPREFIX=\\\"$(PREFIX)\\\" -DWEBROOT_PREFIX=\\\"$(WEBROOT_PREFIX)\\\" -DMODULE_PREFIX=\\\"$(MODULE_PREFIX)\\\" -D_DEFAULT_SOURCE
+CFLAGS := -g -std=c99 -DPREFIX=\\\"$(PREFIX)\\\" -DWEBROOT_PREFIX=\\\"$(WEBROOT_PREFIX)\\\" -DMODULE_PREFIX=\\\"$(MODULE_PREFIX)\\\" -DPROJECTS_PREFIX=\\\"$(PROJECTS_PREFIX)\\\" -D_DEFAULT_SOURCE
 LDFLAGS :=
 LIBS :=
 
index 94e5a69f7b803482366265eb2610821652f9ca75..c0f087f0ee6fd9a0832d7d9f931a26280e5cc905 100644 (file)
@@ -211,6 +211,7 @@ int mandshurica_create_config(const char* path) {
                fprintf(f, "Set CookieDB %s/passwd.db\n", PREFIX);
                fprintf(f, "Set HTTPPort 1024\n");
                fprintf(f, "Set HTTPRoot %s\n", WEBROOT_PREFIX);
+               fprintf(f, "Set ProjectRoot %s\n", WEBROOT_PREFIX);
                fprintf(f, "Set InstancecName Sumire\n");
                fprintf(f, "\n");
                fprintf(f, "Set HTTPMIME.html text/html\n");
diff --git a/build.sh b/build.sh
new file mode 100755 (executable)
index 0000000..234b49d
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+which gmake 2>/dev/null
+if [ "$?" = "0" ]; then
+       MAKE=gmake
+else
+       MAKE=make
+fi
+if [ "`uname -s`" = "NetBSD" ]; then
+       $MAKE PREFIX=`pwd` MODULE_PREFIX=`pwd`/Module WEBROOT_PREFIX=`pwd`/Webroot PROJECTS_PREFIX=`pwd`/Projects -j`cat /proc/cpuinfo | grep proc | wc -l`
+else
+       $MAKE PREFIX=`pwd` MODULE_PREFIX=`pwd`/Module WEBROOT_PREFIX=`pwd`/Webroot PROJECTS_PREFIX=`pwd`/Projects -j`nproc`
+fi
+exit $?