浏览代码

Update mkit from Fastfoo 0.7.0+master.g8c72a9c

Alois Mahdal 9 年前
父节点
当前提交
1676434acb
共有 9 个文件被更改,包括 63 次插入46 次删除
  1. 3
    35
      Makefile
  2. 2
    1
      mkit.ini
  3. 1
    1
      utils/mkit/include/build.sh
  4. 0
    0
      utils/mkit/include/deploy.sh
  5. 0
    0
      utils/mkit/include/ini.sh
  6. 12
    7
      utils/mkit/include/mkit.sh
  7. 0
    0
      utils/mkit/include/release.sh
  8. 4
    2
      utils/mkit/make
  9. 41
    0
      utils/mkit/mkit.mk

+ 3
- 35
Makefile 查看文件

@@ -4,39 +4,7 @@
4 4
 include config.mk
5 5
 include tfkit.mk
6 6
 
7
-all: options build
7
+MKIT_DIR=utils/mkit
8
+include $(MKIT_DIR)/mkit.mk
8 9
 
9
-options:
10
-	@echo saturnin build options:
11
-	@echo "VERSION  = ${VERSION}"
12
-	@echo "PRERELEASE = ${PRERELEASE}"
13
-	@echo "PREFIX   = ${PREFIX}"
14
-
15
-build:
16
-	@mkit/make build
17
-
18
-manpages: build
19
-	@mkit/make build_manpages
20
-
21
-clean:
22
-	@mkit/make clean
23
-
24
-dist: clean
25
-	@mkit/make dist
26
-
27
-install: all
28
-	@mkit/make install
29
-
30
-release_x:
31
-	@mkit/make release_x
32
-
33
-release_y:
34
-	@mkit/make release_y
35
-
36
-release_z:
37
-	@mkit/make release_z
38
-
39
-uninstall:
40
-	@mkit/make uninstall
41
-
42
-.PHONY: all options clean dist install uninstall
10
+.PHONY: test

mkit/config.ini → mkit.ini 查看文件

@@ -15,9 +15,10 @@
15 15
     dist = config.mk
16 16
     dist = LICENSE
17 17
     dist = Makefile
18
-    dist = mkit
19 18
     dist = README
20 19
     dist = src
20
+    dist = tests
21
+    dist = utils
21 22
 
22 23
 [modes]
23 24
     bin     = 755

mkit/include/build.sh → utils/mkit/include/build.sh 查看文件

@@ -1,6 +1,6 @@
1 1
 #!/bin/bash
2 2
 
3
-. mkit/include/ini.sh || die "cannot import ini.sh"
3
+. $MKIT_DIR/include/ini.sh || die "cannot import ini.sh"
4 4
 
5 5
 
6 6
 build() {

mkit/include/deploy.sh → utils/mkit/include/deploy.sh 查看文件


mkit/include/ini.sh → utils/mkit/include/ini.sh 查看文件


mkit/include/mkit.sh → utils/mkit/include/mkit.sh 查看文件

@@ -1,25 +1,30 @@
1 1
 #!/bin/bash
2 2
 
3
-. mkit/include/build.sh  || die "cannot import build.sh"
4
-. mkit/include/deploy.sh || die "cannot import deploy.sh"
5
-. mkit/include/release.sh || die "cannot import release.sh"
6
-. mkit/include/ini.sh    || die "cannot import ini.sh"
3
+. $MKIT_DIR/include/build.sh  || die "cannot import build.sh"
4
+. $MKIT_DIR/include/deploy.sh || die "cannot import deploy.sh"
5
+. $MKIT_DIR/include/release.sh || die "cannot import release.sh"
6
+. $MKIT_DIR/include/ini.sh    || die "cannot import ini.sh"
7 7
 
8
-MKIT_INI=${MKIT_INI:-mkit/config.ini}
8
+MKIT_INI=${MKIT_INI:-mkit.ini}
9 9
 MKIT_INI_EXPAND=2
10 10
 MKIT_PKGNAME=$(ini 1value "ENV:PKGNAME")
11 11
 MKIT_PROJNAME=$(ini 1value "ENV:PROJNAME")
12 12
 MKIT_DEFAULT_MODE="644"
13 13
 
14
-configure() {
14
+mkit_init() {
15 15
     #
16
-    # Load variables fdom config.mk
16
+    # Do basic initialization
17 17
     #
18
+    # Check for ini file, load variables from config.mk, resolve
19
+    # and check for PREFIX
20
+    #
21
+    test -f "$MKIT_INI" || die "cannot find mkit.ini: $MKIT_INI"
18 22
     tmp=$(mktemp)
19 23
     sed -e 's/ = /=/' < config.mk > $tmp
20 24
     . $tmp
21 25
     rm -f $tmp
22 26
     PREFIX="$(readlink -f "$PREFIX")"
27
+    test -d "$PREFIX" || die "PREFIX points to bad directory: $PREFIX"
23 28
 }
24 29
 
25 30
 die() {

mkit/include/release.sh → utils/mkit/include/release.sh 查看文件


mkit/make → utils/mkit/make 查看文件

@@ -6,8 +6,10 @@ die() {
6 6
     echo "$@" && exit 9
7 7
 }
8 8
 
9
-. mkit/include/mkit.sh || die "this must be run from project root"
9
+export MKIT_DIR=${MKIT_DIR:-mkit}
10 10
 
11
-configure
11
+. $MKIT_DIR/include/mkit.sh || die "failed to init; check if MKIT_DIR is set properly: $MKIT_DIR"
12
+
13
+mkit_init
12 14
 
13 15
 route "$@"

+ 41
- 0
utils/mkit/mkit.mk 查看文件

@@ -0,0 +1,41 @@
1
+# ffoo - Fastfoo - Bash dot on steroids
2
+# See LICENSE file for copyright and license details.
3
+
4
+export MKIT_DIR
5
+
6
+all: options build
7
+
8
+options:
9
+	@echo build options:
10
+	@echo "VERSION  = ${VERSION}"
11
+	@echo "PRERELEASE = ${PRERELEASE}"
12
+	@echo "PREFIX   = ${PREFIX}"
13
+
14
+build:
15
+	@$(MKIT_DIR)/make build
16
+
17
+manpages: build
18
+	@$(MKIT_DIR)/make build_manpages
19
+
20
+clean:
21
+	@$(MKIT_DIR)/make clean
22
+
23
+dist: clean
24
+	@$(MKIT_DIR)/make dist
25
+
26
+install: all
27
+	@$(MKIT_DIR)/make install
28
+
29
+release_x:
30
+	@$(MKIT_DIR)/make release_x
31
+
32
+release_y:
33
+	@$(MKIT_DIR)/make release_y
34
+
35
+release_z:
36
+	@$(MKIT_DIR)/make release_z
37
+
38
+uninstall:
39
+	@$(MKIT_DIR)/make uninstall
40
+
41
+.PHONY: all options clean dist install uninstall release_x release_y release_z