Browse code

* migrated to mulle-sde

Nat! authored on 14-03-2018 20:19:17
Showing 81 changed files
... ...
@@ -6,24 +6,8 @@
6 6
 *.exe
7 7
 *.old
8 8
 
9
-.repos/
10
-.bootstrap.auto/
11
-.bootstrap.local/
12
-
13
-xcuserdata/
14 9
 old/
15 10
 tmp/
16
-project.xcworkspace/
17
-
18
-/dependencies/
19
-/addictions/
20
-/include/
21
-/lib/
22
-/cityhash/
23
-
24
-/tests/mulle-tests
25
-/bin/mulle-homebrew
26
-/mulle-configuration
27 11
 
28 12
 /tests/include/
29 13
 /tests/lib/
... ...
@@ -40,4 +24,38 @@ tests/hashmap/example.debug
40 24
 tests/hashmap/hashmap.debug
41 25
 tests/array/empty
42 26
 tests/array/empty.debugbin/tap-info.sh
43
-tap-info.sh
27
+
28
+# ### > generated by mulle-sde (extensions/mulle-sde/sde/init)
29
+
30
+# generally /var and directories are not interesting
31
+.mulle-*/var/
32
+
33
+# .mulle-env /bin and /libexec are not interesting
34
+
35
+.mulle-env/bin/
36
+.mulle-env/libexec/
37
+
38
+# style is "fluctuating" on a per-user level so not interesting
39
+.mulle-env/etc/style
40
+
41
+# .mulle-sde is generally interesting
42
+
43
+# .mulle-sourcetree is generally boring, except /etc
44
+.mulle-sourcetree/var/
45
+
46
+# dynamically .mulle-sourcetree-fix is boring
47
+.mulle-sourcetree-fix
48
+
49
+# stashes are generally boring
50
+stashes/
51
+
52
+# build stuff is boring too
53
+build/
54
+dependencies/
55
+addictions/
56
+*.tmp/
57
+tmp.*/
58
+
59
+# ### < generated by mulle-sde (extensions/mulle-sde/sde/init)
60
+
61
+*.sublime-workspace
44 62
new file mode 100644
... ...
@@ -0,0 +1,7 @@
1
+
2
+cc
3
+gcc
4
+ld
5
+inotifywait
6
+ssh
7
+ninja
0 8
new file mode 100644
... ...
@@ -0,0 +1,70 @@
1
+mudo
2
+
3
+cat
4
+chgrp
5
+chmod
6
+chown
7
+cp
8
+date
9
+dd
10
+df
11
+dmesg
12
+echo
13
+false
14
+hostname
15
+kill
16
+ln
17
+login
18
+ls
19
+mkdir
20
+mknod
21
+more
22
+mount
23
+mv
24
+ps
25
+pwd
26
+rm
27
+rmdir
28
+sed
29
+sh
30
+stty
31
+su
32
+sync
33
+true
34
+umount
35
+uname
36
+
37
+awk
38
+basename
39
+base64
40
+bash
41
+clear
42
+command
43
+cut
44
+dirname
45
+ed
46
+egrep
47
+env
48
+expr
49
+find
50
+fgrep
51
+grep
52
+head
53
+less
54
+more
55
+readlink
56
+sleep
57
+sort
58
+stat
59
+tail
60
+test
61
+tr
62
+vi
63
+wc
64
+which
65
+curl
66
+column
67
+git
68
+uuidgen
69
+cmake
70
+make
0 71
new file mode 100644
... ...
@@ -0,0 +1,34 @@
1
+# By default assume a project has source and a sourcetree
2
+export MULLE_SDE_UPDATE_CALLBACKS="source,sourcetree"
3
+
4
+
5
+#
6
+#
7
+#
8
+export MULLE_SDE_INSTALLED_VERSION="0.14.1"
9
+
10
+
11
+#
12
+#
13
+#
14
+export MULLE_SDE_INSTALLED_EXTENSIONS="--meta 'mulle-c/c-cmake'"
15
+
16
+
17
+#
18
+#
19
+#
20
+export PROJECT_NAME="mulle-concurrent"
21
+
22
+
23
+#
24
+#
25
+#
26
+export PROJECT_LANGUAGE="c"
27
+
28
+
29
+#
30
+#
31
+#
32
+export PROJECT_TYPE="library"
33
+
34
+
0 35
new file mode 100644
... ...
@@ -0,0 +1,40 @@
1
+#
2
+# Git mirror and Zip/TGZ cache to conserve bandwidth
3
+# Memo: override in os-specific env file
4
+#
5
+export MULLE_FETCH_MIRROR_DIR="${HOME:-/tmp}/.cache/mulle-fetch/git-mirrors"
6
+
7
+#
8
+# Git mirror and Zip/TGZ cache to conserve bandwidth
9
+#
10
+export MULLE_FETCH_ARCHIVE_DIR="${HOME:-/tmp}/.cache/mulle-fetch/archives"
11
+
12
+#
13
+# PATH to search for git repositories locally
14
+#
15
+export MULLE_FETCH_SEARCH_PATH="${MULLE_VIRTUAL_ROOT}/.."
16
+
17
+#
18
+# Prefer symlinks to local git repositories found via MULLE_FETCH_SEARCH_PATH
19
+#
20
+export MULLE_SYMLINK="YES"
21
+
22
+#
23
+# Use common folder for sharable projects
24
+#
25
+export MULLE_SOURCETREE_SHARE_DIR="${MULLE_VIRTUAL_ROOT}/stashes"
26
+
27
+#
28
+# Use common build directory
29
+#
30
+export BUILD_DIR="${MULLE_VIRTUAL_ROOT}/build"
31
+
32
+#
33
+# Share dependencies directory (absolute for ease of use)
34
+#
35
+export DEPENDENCIES_DIR="${MULLE_VIRTUAL_ROOT}/dependencies"
36
+
37
+#
38
+# Share addictions directory (absolute for ease of use)
39
+#
40
+export ADDICTIONS_DIR="${MULLE_VIRTUAL_ROOT}/addictions"
0 41
new file mode 100644
... ...
@@ -0,0 +1,77 @@
1
+[ "${TRACE}" = "YES" ] && set -x  && : "$0" "$@"
2
+
3
+[ -z "${MULLE_VIRTUAL_ROOT}" -o -z "${MULLE_UNAME}"  ] && \
4
+   echo "Your script needs to setup MULLE_VIRTUAL_ROOT \
5
+and MULLE_UNAME properly" >&2  && exit 1
6
+
7
+HOSTNAME="`PATH=/bin:/usr/bin hostname -s`" # don't export it
8
+
9
+MULLE_ENV_SHARE_DIR="${MULLE_VIRTUAL_ROOT}/.mulle-env/share"
10
+MULLE_ENV_ETC_DIR="${MULLE_VIRTUAL_ROOT}/.mulle-env/etc"
11
+
12
+
13
+#
14
+# The aux file if present is to be set by mulle-sde extensions.
15
+# The trick here is that mulle-env doesn't clobber this file
16
+# when doing an init -f, which can be useful. There is no etc
17
+# equivalent.
18
+#
19
+if [ -f "${MULLE_ENV_SHARE_DIR}/environment-aux.sh" ]
20
+then
21
+   . "${MULLE_ENV_SHARE_DIR}/environment-aux.sh"
22
+fi
23
+
24
+#
25
+# Default environment values set by plugins and extensions.
26
+# The user should never edit them. He can override settings
27
+# in etc.
28
+#
29
+if [ -f "${MULLE_ENV_ETC_DIR}/environment-global.sh" ]
30
+then
31
+   . "${MULLE_ENV_ETC_DIR}/environment-global.sh"
32
+else
33
+   if [ -f "${MULLE_ENV_SHARE_DIR}/environment-global.sh" ]
34
+   then
35
+      . "${MULLE_ENV_SHARE_DIR}/environment-global.sh"
36
+   fi
37
+fi
38
+
39
+if [ -f "${MULLE_ENV_ETC_DIR}/environment-os-${MULLE_UNAME}.sh" ]
40
+then
41
+   . "${MULLE_ENV_ETC_DIR}/environment-os-${MULLE_UNAME}.sh"
42
+else
43
+   if [ -f "${MULLE_ENV_SHARE_DIR}/environment-os-${MULLE_UNAME}.sh" ]
44
+   then
45
+      . "${MULLE_ENV_SHARE_DIR}/environment-os-${MULLE_UNAME}.sh"
46
+   fi
47
+fi
48
+
49
+#
50
+# Load in some modifications depending on  hostname, username. These
51
+# won't be provided by extensions or plugins.
52
+#
53
+# These settings could be "cased" in a single file, but it seems convenient.
54
+# And more managable for mulle-env environment
55
+#
56
+
57
+if [ -f "${MULLE_ENV_ETC_DIR}/environment-host-${HOSTNAME}.sh" ]
58
+then
59
+   . "${MULLE_ENV_ETC_DIR}/environment-host-${HOSTNAME}.sh"
60
+fi
61
+
62
+if [ -f "${MULLE_ENV_ETC_DIR}/environment-user-${USER}.sh" ]
63
+then
64
+   . "${MULLE_ENV_ETC_DIR}/environment-user-${USER}.sh"
65
+fi
66
+
67
+#
68
+# For more complex edits, that don't work with the cmdline tool
69
+#
70
+if [ -f "${MULLE_ENV_ETC_DIR}/environment-aux.sh" ]
71
+then
72
+   . "${MULLE_ENV_ETC_DIR}/environment-aux.sh"
73
+fi
74
+
75
+unset MULLE_ENV_ETC_DIR
76
+unset MULLE_ENV_SHARE_DIR
77
+unset HOSTNAME
0 78
new file mode 100644
... ...
@@ -0,0 +1,5 @@
1
+#
2
+# Git mirror and Zip/TGZ cache to conserve bandwidth
3
+#
4
+export MULLE_FETCH_MIRROR_DIR="${HOME:-/tmp}/Library/Caches/mulle-fetch/git-mirrors"
5
+export MULLE_FETCH_ARCHIVE_DIR="${HOME:-/tmp}/Library/Caches/mulle-fetch/archives"
0 6
new file mode 100644
... ...
@@ -0,0 +1,86 @@
1
+[ "${TRACE}" = "YES" ] && set -x  && : "$0" "$@"
2
+
3
+#
4
+# If mulle-env is broken, sometimes its nice just to source this file.
5
+# If you're sourcing this manually on a regular basis, you're doing it wrong.
6
+#
7
+# We need some minimal stuff to get things going though:
8
+#     sed, cut, tr, hostname, pwd, uname
9
+#
10
+if [ -z "${MULLE_UNAME}" ]
11
+then
12
+   MULLE_UNAME="`PATH=/bin:/usr/bin uname | \
13
+                  PATH=/bin:/usr/bin cut -d_ -f1 | \
14
+                  PATH=/bin:/usr/bin sed 's/64$//' | \
15
+                  PATH=/bin:/usr/bin tr 'A-Z' 'a-z'`"
16
+   export MULLE_UNAME
17
+fi
18
+if [ -z "${MULLE_VIRTUAL_ROOT}" ]
19
+then
20
+   MULLE_VIRTUAL_ROOT="`PATH=/bin:/usr/bin pwd -P`"
21
+   echo "Using ${MULLE_VIRTUAL_ROOT} as MULLE_VIRTUAL_ROOT for \
22
+your convenience" >&2
23
+fi
24
+
25
+
26
+#
27
+# Set PS1 so that we can see, that we are in a mulle-env
28
+#
29
+envname="`PATH=/bin:/usr/bin basename -- "${MULLE_VIRTUAL_ROOT}"`"
30
+
31
+case "${PS1}" in
32
+   *\\h\[*)
33
+   ;;
34
+
35
+   *\\h*)
36
+      PS1="$(sed 's/\\h/\\h\['${envname}'\]/' <<< '${PS1}' )"
37
+   ;;
38
+
39
+   *)
40
+      PS1='\u@\h['${envname}'] \W$ '
41
+   ;;
42
+esac
43
+export PS1
44
+
45
+unset envname
46
+
47
+alias mulle-env-reload='. "${MULLE_VIRTUAL_ROOT}/.mulle-env/share/environment-include.sh"'
48
+
49
+mulle-env-reload
50
+
51
+# install cd catcher
52
+. "`mulle-env libexec-dir`/mulle-env-cd.sh"
53
+
54
+
55
+#
56
+# Source in bash completion if available
57
+# Assumed is, that they are not user modifiable
58
+#
59
+if [ "${MULLE_SHELL_MODE}" = "INTERACTIVE" ]
60
+then
61
+   DEFAULT_IFS="${IFS}"
62
+   shopt -s nullglob; IFS="
63
+"
64
+   for FILENAME in "${MULLE_VIRTUAL_ROOT}/.mulle-env/share/libexec"/*-bash-completion.sh
65
+   do
66
+      . "${FILENAME}"
67
+   done
68
+   shopt -u nullglob; IFS="${DEFAULT_IFS}"
69
+
70
+   unset FILENAME
71
+   unset DEFAULT_IFS
72
+fi
73
+
74
+#
75
+#
76
+# show motd, if any
77
+#
78
+if [ -f "${MULLE_VIRTUAL_ROOT}/.mulle-env/etc/motd" ]
79
+then
80
+   cat "${MULLE_VIRTUAL_ROOT}/.mulle-env/etc/motd"
81
+else
82
+   if [ -f "${MULLE_VIRTUAL_ROOT}/.mulle-env/share/motd" ]
83
+   then
84
+      cat "${MULLE_VIRTUAL_ROOT}/.mulle-env/share/motd"
85
+   fi
86
+fi
0 87
new file mode 100644
... ...
@@ -0,0 +1,12 @@
1
+\
2
+#! /usr/bin/env bash
3
+
4
+#
5
+# install completion if not yet present.
6
+# mulle-sde-bash-completion.sh will load the inferior completes
7
+#
8
+if [ "`type -t "_mulle_sde_complete"`" != "function" ]
9
+then
10
+   . "$(mulle-sde libexec-dir)/mulle-sde-bash-completion.sh"
11
+fi
12
+
0 13
new file mode 100644
... ...
@@ -0,0 +1,123 @@
1
+#! /usr/bin/env bash
2
+#
3
+#   Copyright (c) 2018 Nat! - Mulle kybernetiK
4
+#   All rights reserved.
5
+#
6
+#   Redistribution and use in source and binary forms, with or without
7
+#   modification, are permitted provided that the following conditions are met:
8
+#
9
+#   Redistributions of source code must retain the above copyright notice, this
10
+#   list of conditions and the following disclaimer.
11
+#
12
+#   Redistributions in binary form must reproduce the above copyright notice,
13
+#   this list of conditions and the following disclaimer in the documentation
14
+#   and/or other materials provided with the distribution.
15
+#
16
+#   Neither the name of Mulle kybernetiK nor the names of its contributors
17
+#   may be used to endorse or promote products derived from this software
18
+#   without specific prior written permission.
19
+#
20
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+#   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+#   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
+#   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24
+#   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+#   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+#   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+#   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
+#   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
+#   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
+#   POSSIBILITY OF SUCH DAMAGE.
31
+#
32
+[ "${TRACE}" = "YES" ] && set -x && : "$0" "$@"
33
+
34
+
35
+_mulle_env_complete()
36
+{
37
+   local cur=${COMP_WORDS[COMP_CWORD]}
38
+   local prev=${COMP_WORDS[COMP_CWORD-1]}
39
+
40
+   local list
41
+   local i
42
+   local context
43
+
44
+   for i in "${COMP_WORDS[@]}"
45
+   do
46
+      case "$i" in
47
+         tool|environment|init)
48
+            context="$i"
49
+         ;;
50
+      esac
51
+   done
52
+
53
+   case "${context}" in
54
+      tool)
55
+         case "$prev" in
56
+            remove)
57
+               list="`mulle-env -e tool list`"
58
+               COMPREPLY=( $( compgen -W "${list}" -- "$cur" ) )
59
+            ;;
60
+
61
+            list)
62
+            ;;
63
+
64
+            add)
65
+            ;;
66
+
67
+            *)
68
+               COMPREPLY=( $( compgen -W "add remove list}" -- "$cur" ) )
69
+            ;;
70
+         esac
71
+      ;;
72
+
73
+      environment)
74
+         case "$prev" in
75
+            get|set)
76
+               list="`mulle-env -s environment list | sed 's/^\([^=]*\).*/\1/'`"
77
+               COMPREPLY=( $( compgen -W "${list}" -- "$cur" ) )
78
+            ;;
79
+
80
+            list)
81
+            ;;
82
+
83
+            *)
84
+               COMPREPLY=( $( compgen -W "get list set" -- "$cur" ) )
85
+            ;;
86
+         esac
87
+      ;;
88
+
89
+      init)
90
+      ;;
91
+
92
+      *)
93
+         case "$prev" in
94
+            -s|--style)
95
+               COMPREPLY=( $( compgen -W "\
96
+none/wild none/inherit none/restrict none/relax none/tight \
97
+minimal/wild minimal/inherit minimal/restrict minimal/relax minimal/tight \
98
+developer/wild developer/inherit developer/restrict developer/relax developer/tight \
99
+mulle/wild mulle/inherit mulle/restrict mulle/relax mulle/tight" -- "$cur" ) )
100
+            ;;
101
+
102
+            -d|--directory)
103
+               COMPREPLY=( $( compgen -d -- "$cur" ) )
104
+            ;;
105
+
106
+            *)
107
+               case "$cur" in
108
+                  -*)
109
+                     COMPREPLY=( $( compgen -W "--style --directory" -- "$cur" ) )
110
+                  ;;
111
+
112
+                  *)
113
+                     COMPREPLY=( $( compgen -W "environment init tool" -- $cur ) )
114
+                  ;;
115
+               esac
116
+            ;;
117
+         esac
118
+      ;;
119
+   esac
120
+}
121
+
122
+complete -F _mulle_env_complete mulle-env
123
+
0 124
new file mode 100644
... ...
@@ -0,0 +1,2 @@
1
+Ready to build with:
2
+   mulle-sde craft
0 3
new file mode 100644
... ...
@@ -0,0 +1 @@
1
+
0 2
new file mode 100644
... ...
@@ -0,0 +1 @@
1
+mulle/wild
0 2
new file mode 100644
... ...
@@ -0,0 +1,65 @@
1
+mudo
2
+
3
+cat
4
+chgrp
5
+chmod
6
+chown
7
+cp
8
+date
9
+dd
10
+df
11
+dmesg
12
+echo
13
+false
14
+hostname
15
+kill
16
+ln
17
+login
18
+ls
19
+mkdir
20
+mknod
21
+more
22
+mount
23
+mv
24
+ps
25
+pwd
26
+rm
27
+rmdir
28
+sed
29
+sh
30
+stty
31
+su
32
+sync
33
+true
34
+umount
35
+uname
36
+
37
+awk
38
+basename
39
+base64
40
+bash
41
+clear
42
+command
43
+cut
44
+dirname
45
+ed
46
+egrep
47
+env
48
+expr
49
+find
50
+fgrep
51
+grep
52
+head
53
+less
54
+more
55
+readlink
56
+sleep
57
+sort
58
+stat
59
+tail
60
+test
61
+tr
62
+uuidgen
63
+vi
64
+wc
65
+which
0 66
new file mode 100644
... ...
@@ -0,0 +1 @@
1
+0.11.4
0 2
new file mode 100755
... ...
@@ -0,0 +1,352 @@
1
+#! /usr/bin/env bash
2
+#
3
+#   Copyright (c) 2018 Nat! - Mulle kybernetiK
4
+#   All rights reserved.
5
+#
6
+#   Redistribution and use in source and binary forms, with or without
7
+#   modification, are permitted provided that the following conditions are met:
8
+#
9
+#   Redistributions of source code must retain the above copyright notice, this
10
+#   list of conditions and the following disclaimer.
11
+#
12
+#   Redistributions in binary form must reproduce the above copyright notice,
13
+#   this list of conditions and the following disclaimer in the documentation
14
+#   and/or other materials provided with the distribution.
15
+#
16
+#   Neither the name of Mulle kybernetiK nor the names of its contributors
17
+#   may be used to endorse or promote products derived from this software
18
+#   without specific prior written permission.
19
+#
20
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+#   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+#   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
+#   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24
+#   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+#   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+#   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+#   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
+#   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
+#   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
+#   POSSIBILITY OF SUCH DAMAGE.
31
+#
32
+
33
+[ "${TRACE}" = "YES" ] && set -x && : "$0" "$@"
34
+
35
+
36
+usage()
37
+{
38
+   cat <<EOF >&2
39
+Usage:
40
+   mulle-c-sourcetree-update <action> <filename> <category>
41
+
42
+   Let mulle-monitor run this for you. None of the arguments are actually
43
+   used.
44
+
45
+EOF
46
+   exit 1
47
+}
48
+
49
+
50
+#
51
+# this is bullshit right now, just in the process of building it up
52
+#
53
+uname_to_cpp()
54
+{
55
+   log_entry "uname_to_cmake" "$@"
56
+
57
+   local uname="$1"
58
+
59
+   case "${uname}" in
60
+      darwin)
61
+         echo "__APPLE__"
62
+      ;;
63
+
64
+      "")
65
+         fail "uname is empty"
66
+      ;;
67
+
68
+      *)
69
+         echo "__`tr 'a-z' 'A-Z' <<< "${uname}"`__"
70
+      ;;
71
+   esac
72
+}
73
+
74
+
75
+osexclude_to_cpp_if()
76
+{
77
+   log_entry "osexclude_to_cpp_if" "$@"
78
+
79
+   local marks="$1"
80
+
81
+   local cppvar
82
+
83
+   local excludes
84
+   local onlys
85
+
86
+   set -o noglob ; IFS=","
87
+
88
+   for osexclude in ${marks}
89
+   do
90
+      IFS="${DEFAULT_IFS}"; set +o noglob
91
+
92
+      case "${osexclude}" in
93
+         only-os-*)
94
+            cppvar="`uname_to_cpp "${osexclude:8}"`"
95
+            onlys="`concat "${onlys}" "defined( ${cppvar})" " || " `"
96
+         ;;
97
+
98
+         no-os-*)
99
+            cppvar="`uname_to_cpp "${osexclude:6}"`"
100
+            excludes="`concat "${excludes}" "! defined( ${cppvar})" " && "`"
101
+         ;;
102
+      esac
103
+   done
104
+   IFS="${DEFAULT_IFS}"; set +o noglob
105
+
106
+   if [ ! -z "${onlys}" ]
107
+   then
108
+      echo "# if ${onlys}"
109
+      return
110
+   fi
111
+
112
+   if [ ! -z "${excludes}" ]
113
+   then
114
+      echo "# if ${excludes}"
115
+   fi
116
+}
117
+
118
+
119
+emit_c_include_dependency()
120
+{
121
+   log_entry "emit_c_include_dependency" "$@"
122
+
123
+   local name="$1"
124
+   local marks="$2"
125
+   local header="$3"
126
+
127
+   local indent
128
+   local ifstatement
129
+   local include
130
+   local mark
131
+
132
+   #
133
+   # so objc can reuse this, make a provision for import with --objc flag
134
+   # but allow #include if the mark no-objc is set
135
+   #
136
+   include="include"
137
+   if [ "${OPTION_OBJC}" = "YES" ]
138
+   then
139
+      include="import"
140
+
141
+      set -o noglob ; IFS=","
142
+      for mark in ${marks}
143
+      do
144
+         if [ "${mark}" = "no-objc" ]
145
+         then
146
+            include="include"
147
+            break
148
+         fi
149
+      done
150
+      IFS="${DEFAULT_IFS}" ; set o noglob
151
+   fi
152
+
153
+   if [ ! -z "${marks}" ]
154
+   then
155
+      ifstatement="`osexclude_to_cpp_if "${marks}" `"
156
+   fi
157
+
158
+   if [ ! -z "${ifstatement}" ]
159
+   then
160
+      echo "${ifstatement}"
161
+      indent=" "
162
+   fi
163
+
164
+   if [ -z "${header}" ]
165
+   then
166
+      header="${name}/${name}.h"
167
+   fi
168
+
169
+   echo "# ${indent}include <${header}>"
170
+   if [ ! -z "${ifstatement}" ]
171
+   then
172
+      echo "# endif"
173
+   fi
174
+
175
+   echo
176
+}
177
+
178
+
179
+get_header_include_list()
180
+{
181
+   log_entry "get_header_dependency_list" "$@"
182
+
183
+   exekutor mulle-sde library list \
184
+                                   --marks header \
185
+                                   --\
186
+                                   --output-raw \
187
+                                   --no-output-header
188
+
189
+   exekutor mulle-sde dependency list \
190
+                                   --marks header \
191
+                                   --\
192
+                                   --output-raw \
193
+                                   --no-output-header
194
+}
195
+
196
+
197
+_emit_headers()
198
+{
199
+   log_entry "_emit_headers" "$@"
200
+
201
+   local headers="$1"; shift
202
+   local emitter="$1"; shift
203
+
204
+   local dependency
205
+
206
+   set -o noglob ; IFS="
207
+"
208
+   for header in ${headers}
209
+   do
210
+      IFS="${DEFAULT_IFS}"; set +o noglob
211
+
212
+      local address
213
+      local marks
214
+      local include
215
+
216
+      IFS=";" read address marks include <<< "${header}"
217
+
218
+      if [ ! -z "${address}" ]
219
+      then
220
+         log_verbose "Emit statements for ${C_MAGENTA}${C_BOLD}${address}"
221
+         ${emitter} "${address}" "${marks}" "${include}" "$@"
222
+      fi
223
+   done
224
+   IFS="${DEFAULT_IFS}"; set +o noglob
225
+}
226
+
227
+
228
+emit_c_header()
229
+{
230
+   log_entry "emit_c_header" "$@"
231
+
232
+   local headers
233
+
234
+   # OBJC is in this
235
+   headers="`get_header_include_list`" || return 1
236
+   _emit_headers "${headers}" emit_c_include_dependency
237
+}
238
+
239
+
240
+main()
241
+{
242
+   log_entry "main" "$@"
243
+
244
+   # technical flags
245
+   local MULLE_FLAG_DONT_DEFER="NO"
246
+   local MULLE_FLAG_EXEKUTOR_DRY_RUN="NO"
247
+   local MULLE_FLAG_FOLLOW_SYMLINKS="YES"
248
+   local MULLE_FLAG_LOG_CACHE="NO"
249
+   local MULLE_FLAG_LOG_DEBUG="NO"
250
+   local MULLE_FLAG_LOG_EXEKUTOR="NO"
251
+   local MULLE_FLAG_LOG_FLUFF="NO"
252
+   local MULLE_FLAG_LOG_MERGE="NO"
253
+   local MULLE_FLAG_LOG_SCRIPTS="NO"
254
+   local MULLE_FLAG_LOG_SETTINGS="NO"
255
+   local MULLE_FLAG_LOG_VERBOSE="NO"
256
+   local MULLE_TRACE_PATHS_FLIP_X="NO"
257
+   local MULLE_TRACE_POSTPONE="NO"
258
+   local MULLE_TRACE_RESOLVER_FLIP_X="NO"
259
+   local MULLE_TRACE_SETTINGS_FLIP_X="NO"
260
+
261
+   local OPTION_OBJC_HEURISTIC="NO"
262
+
263
+   while [ $# -ne 0 ]
264
+   do
265
+      if options_technical_flags "$1"
266
+      then
267
+         shift
268
+         continue
269
+      fi
270
+
271
+      case "$1" in
272
+         -h*|--help|help)
273
+            usage
274
+         ;;
275
+
276
+         --objc)
277
+            OPTION_OBJC="YES"
278
+         ;;
279
+
280
+         -*)
281
+            log_error "unknown option \"$1\""
282
+            usage
283
+         ;;
284
+
285
+         *)
286
+            break
287
+         ;;
288
+      esac
289
+
290
+      shift
291
+   done
292
+
293
+   options_setup_trace "${MULLE_TRACE}"
294
+
295
+   local text_h
296
+   local text_dep
297
+
298
+   text_h="`emit_c_header`"     || exit 1
299
+
300
+   if [ -z "${text_h}" ]
301
+   then
302
+      text_h="/* no headers */"
303
+   fi
304
+
305
+   local projectname
306
+
307
+   projectname="${MULLE_SDE_PROJECT_NAME}"
308
+   projectname="${projectname:-${PROJECT_NAME}}"
309
+   if [ -z "${projectname}" ]
310
+   then
311
+      projectname="`fast_basename "${PWD}"`" # could be nicer
312
+   fi
313
+
314
+   projectname="`tr 'A-Z-' 'a-z_' <<< "${projectname}" `"
315
+
316
+   text_h="/*
317
+   This file will be regenerated by \`mulle-sde update|monitor\`.
318
+   Edits will be lost.
319
+*/
320
+
321
+#ifndef _${projectname}__dependencies_h__
322
+#define _${projectname}__dependencies_h__
323
+
324
+${text_h}
325
+
326
+#endif"
327
+
328
+   log_fluff "Create header file (${PWD})"
329
+
330
+   MULLE_SDE_DEPENDENCIES_HEADER_FILE="${MULLE_SDE_DEPENDENCIES_HEADER_FILE:-src/_dependencies.h}"
331
+
332
+   log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_DEPENDENCIES_HEADER_FILE}"
333
+   redirect_exekutor "${MULLE_SDE_DEPENDENCIES_HEADER_FILE}" echo "${text_h}"
334
+}
335
+
336
+
337
+_init()
338
+{
339
+   if [ -z "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}" ]
340
+   then
341
+      MULLE_BASHFUNCTIONS_LIBEXEC_DIR="`mulle-bashfunctions-env "libexec-dir" 2> /dev/null`"
342
+      [ -z "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}" ] && \
343
+         echo "mulle-bashfunctions-env not installed" >&2 && \
344
+         exit 1
345
+   fi
346
+
347
+   . "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}/mulle-bashfunctions.sh" "minimal" || exit 1
348
+}
349
+
350
+_init "$@"
351
+main "$@"
352
+
0 353
new file mode 100755
... ...
@@ -0,0 +1,336 @@
1
+#! /usr/bin/env bash
2
+#
3
+#   Copyright (c) 2018 Nat! - Mulle kybernetiK
4
+#   All rights reserved.
5
+#
6
+#   Redistribution and use in source and binary forms, with or without
7
+#   modification, are permitted provided that the following conditions are met:
8
+#
9
+#   Redistributions of source code must retain the above copyright notice, this
10
+#   list of conditions and the following disclaimer.
11
+#
12
+#   Redistributions in binary form must reproduce the above copyright notice,
13
+#   this list of conditions and the following disclaimer in the documentation
14
+#   and/or other materials provided with the distribution.
15
+#
16
+#   Neither the name of Mulle kybernetiK nor the names of its contributors
17
+#   may be used to endorse or promote products derived from this software
18
+#   without specific prior written permission.
19
+#
20
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+#   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+#   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
+#   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24
+#   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+#   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+#   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+#   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
+#   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
+#   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
+#   POSSIBILITY OF SUCH DAMAGE.
31
+#
32
+# Create fresh HeadersAndSources.cmake from filesystem information
33
+#
34
+[ "${TRACE}" = "YES" ] && set -x && : "$0" "$@"
35
+
36
+
37
+CMAKE_SOURCE_UPDATE_VERSION="0.0.1"
38
+
39
+
40
+usage()
41
+{
42
+   if [ ! -z "$1" ]
43
+   then
44
+      log_error "$1"
45
+   fi
46
+
47
+   cat <<EOF >&2
48
+Usage:
49
+   mulle-sde-cmake-source-update
50
+
51
+   Let mulle-monitor or mulle-sde run this for you.
52
+
53
+EOF
54
+   exit 1
55
+}
56
+
57
+
58
+emit_cmake_var()
59
+{
60
+   log_entry "emit_cmake_var" "$@"
61
+
62
+   local name="$1"
63
+   local contents="$2"
64
+
65
+   if [ -z "${contents}" ]
66
+   then
67
+      return
68
+   fi
69
+
70
+   echo "set( ${name}"
71
+   LC_ALL="C" sed '/ /s/\(.*\)/"\1"/' <<< "${contents}"
72
+   echo ")"
73
+   echo
74
+}
75
+
76
+
77
+emit_common_directories()
78
+{
79
+   log_entry "emit_common_directories" "$@"
80
+
81
+   local items="$1"
82
+   local emitter="$2"
83
+   local parameter="$3"
84
+
85
+   [ -z "${emitter}" ] && internal_fail "emitter is empty"
86
+
87
+   local collection
88
+
89
+   collection="`rexekutor sed -n -e 's|^[^;]*;\(.*\)/[^/]*\.h|\1|p' <<< "${items}" | sort -u`"
90
+
91
+   if [ ! -z "${collection}" ]
92
+   then
93
+      "${emitter}" "${parameter}" "${collection}"
94
+   fi
95
+}
96
+
97
+
98
+emit_by_category()
99
+{
100
+   log_entry "emit_by_category" "$@"
101
+
102
+   local items="$1"
103
+   local emitter="$2"
104
+
105
+   [ -z "${emitter}" ] && internal_fail "emitter is empty"
106
+
107
+   local collectname
108
+   local collection
109
+   local remainder
110
+
111
+   remainder="${items}"
112
+
113
+   while [ ! -z "${remainder}" ]
114
+   do
115
+      # https://stackoverflow.com/questions/1773939/how-to-use-sed-to-return-something-from-first-line-which-matches-and-quit-early
116
+      collectname="`sed -n -e '/\(^[^;]*\).*/{s//\1/p;q;}' <<< "${remainder}" `"
117
+      collection="`egrep "^${collectname};" <<< "${remainder}" | cut -d ';' -f 2-`"
118
+      "${emitter}" "${collectname}" "${collection}"
119
+
120
+      remainder="`egrep -v "^${collectname};" <<< "${remainder}" `"
121
+   done
122
+
123
+   :
124
+}
125
+
126
+
127
+create_headers_file()
128
+{
129
+   log_entry "create_headers_file" "$@"
130
+
131
+   local categorized_files="$1"
132
+
133
+   local text_hdr
134
+
135
+   if [ "${MULLE_SDE_CMAKE_HEADERS_FILE}" = "NONE" ]
136
+   then
137
+      MULLE_SDE_CMAKE_HEADERS_FILE=""
138
+
139
+      text_hdr="# header generation turned off by MULLE_SDE_CMAKE_HEADERS_FILE"
140
+   else
141
+      local categorized_headers
142
+      local text_hdr1
143
+      local text_hdr2
144
+
145
+      categorized_headers="`rexekutor egrep '^[^;]*HEADERS;' <<< "${categorized_files}"`"
146
+
147
+      text_hdr1="`emit_common_directories "${categorized_headers}" emit_cmake_var INCLUDE_DIRS` "  || return 1
148
+      text_hdr2="`emit_by_category "${categorized_headers}" emit_cmake_var` "  || return 1
149
+
150
+      if [ -z "${text_hdr2}" ]
151
+      then
152
+         text_hdr2="# no headers"
153
+      fi
154
+
155
+      text_hdr="${text_hdr1}
156
+
157
+${text_hdr2}"
158
+   fi
159
+   MULLE_SDE_CMAKE_HEADERS_FILE="${MULLE_SDE_CMAKE_HEADERS_FILE:-cmake/_Headers.cmake}"
160
+
161
+   text_hdr="# ${MULLE_SDE_CMAKE_HEADERS_FILE} is generated by \`mulle-sde\`. Edits will be lost.
162
+#
163
+if( MULLE_TRACE_INCLUDE)
164
+   MESSAGE( STATUS \"# Include \\\"\${CMAKE_CURRENT_LIST_FILE}\\\"\" )
165
+endif()
166
+
167
+${text_hdr}
168
+"
169
+
170
+   log_fluff "Create cmake header files (${PWD})"
171
+
172
+   log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_CMAKE_HEADERS_FILE}"
173
+   exekutor mkdir -p  "`fast_dirname "${MULLE_SDE_CMAKE_HEADERS_FILE}"`"
174
+   exekutor chmod a+w "${MULLE_SDE_CMAKE_HEADERS_FILE}"  2> /dev/null
175
+   redirect_exekutor "${MULLE_SDE_CMAKE_HEADERS_FILE}" echo "${text_hdr}"
176
+   exekutor chmod a-w "${MULLE_SDE_CMAKE_HEADERS_FILE}"
177
+}
178
+
179
+
180
+create_sources_file()
181
+{
182
+   log_entry "create_sources_file" "$@"
183
+
184
+   local categorized_files="$1"
185
+   local text_src
186
+
187
+   if [ "${MULLE_SDE_CMAKE_SOURCES_FILE}" = "NONE" ]
188
+   then
189
+      MULLE_SDE_CMAKE_SOURCES_FILE=""
190
+
191
+      text_src="# source generation turned off by MULLE_SDE_CMAKE_SOURCES_FILE"
192
+   else
193
+      local categorized_sources
194
+
195
+      categorized_sources="`rexekutor egrep -v '^[^;]*HEADERS;' <<< "${categorized_files}"`"
196
+
197
+      text_src="`emit_by_category "${categorized_sources}" emit_cmake_var`"   || return 1
198
+
199
+      if [ -z "${text_src}" ]
200
+      then
201
+         #
202
+         # header only libraries are tricky to do portably
203
+         #
204
+         text_src="message( ERROR \" No sources found. \`mulle-sde environment set MULLE_SDE_CMAKE_SOURCES_FILE NONE\`, if this is intentional\")"
205
+      fi
206
+   fi
207
+   MULLE_SDE_CMAKE_SOURCES_FILE="${MULLE_SDE_CMAKE_SOURCES_FILE:-cmake/_Sources.cmake}"
208
+
209
+   text_src="# ${MULLE_SDE_CMAKE_SOURCES_FILE} is generated by \`mulle-sde\`. Edits will be lost.
210
+#
211
+if( MULLE_TRACE_INCLUDE)
212
+   MESSAGE( STATUS \"# Include \\\"\${CMAKE_CURRENT_LIST_FILE}\\\"\" )
213
+endif()
214
+
215
+${text_src}"
216
+
217
+   log_fluff "Create cmake source files (${PWD})"
218
+
219
+   log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_CMAKE_SOURCES_FILE}"
220
+   exekutor mkdir -p  "`fast_dirname "${MULLE_SDE_CMAKE_SOURCES_FILE}"`" 2> /dev/null
221
+   exekutor chmod a+w "${MULLE_SDE_CMAKE_SOURCES_FILE}"  2> /dev/null
222
+   redirect_exekutor "${MULLE_SDE_CMAKE_SOURCES_FILE}" echo "${text_src}"
223
+   exekutor chmod a-w "${MULLE_SDE_CMAKE_SOURCES_FILE}"
224
+}
225
+
226
+
227
+main()
228
+{
229
+   log_entry "main" "$@"
230
+
231
+   # technical flags
232
+   local MULLE_FLAG_DONT_DEFER="NO"
233
+   local MULLE_FLAG_EXEKUTOR_DRY_RUN="NO"
234
+   local MULLE_FLAG_FOLLOW_SYMLINKS="YES"
235
+   local MULLE_FLAG_LOG_CACHE="NO"
236
+   local MULLE_FLAG_LOG_DEBUG="NO"
237
+   local MULLE_FLAG_LOG_EXEKUTOR="NO"
238
+   local MULLE_FLAG_LOG_FLUFF="NO"
239
+   local MULLE_FLAG_LOG_MERGE="NO"
240
+   local MULLE_FLAG_LOG_SCRIPTS="NO"
241
+   local MULLE_FLAG_LOG_SETTINGS="NO"
242
+   local MULLE_FLAG_LOG_VERBOSE="NO"
243
+   local MULLE_TRACE_PATHS_FLIP_X="NO"
244
+   local MULLE_TRACE_POSTPONE="NO"
245
+   local MULLE_TRACE_RESOLVER_FLIP_X="NO"
246
+   local MULLE_TRACE_SETTINGS_FLIP_X="NO"
247
+
248
+   while [ $# -ne 0 ]
249
+   do
250
+      if options_technical_flags "$1"
251
+      then
252
+         shift
253
+         continue
254
+      fi
255
+
256
+      case "$1" in
257
+         -h*|--help|help)
258
+            usage
259
+         ;;
260
+
261
+         --version)
262
+            echo "${CMAKE_SOURCE_UPDATE_VERSION}"
263
+            return 0
264
+         ;;
265
+
266
+         -*)
267
+            usage "unknown option \"$1\""
268
+         ;;
269
+
270
+         *)
271
+            break
272
+         ;;
273
+      esac
274
+
275
+      shift
276
+   done
277
+
278
+   options_setup_trace "${MULLE_TRACE}"
279
+
280
+   [ $# -ne 0 ] && usage "superflous arguments $*"
281
+
282
+   MULLE_MATCH="${MULLE_MATCH:-`command -v mulle-match`}"
283
+   [ -z "${MULLE_MATCH}" ] && fail "mulle-match not in PATH"
284
+
285
+   #
286
+   # With 1000 header and 1000 source files, a full update takes ~7s on
287
+   # my machine. It certainly would be interesting to make this properly
288
+   # incremental.
289
+   #
290
+   # Foreseen problems:
291
+   #
292
+   #     missed events ?
293
+   #
294
+   local categorized_files
295
+
296
+   if ! categorized_files="`exekutor "${MULLE_MATCH}" ${MULLE_MONITOR_FLAGS} \
297
+                                 find --format "%C;%f\\n" \
298
+                                      --match-filter "source"`"
299
+   then
300
+      return 1
301
+   fi
302
+
303
+   if [ -z "${categorized_files}" ]
304
+   then
305
+      log_warning "No matching source files found. " >&2
306
+      # exit 0 # but still create empty files, otherwise cmake is unhappy
307
+   fi
308
+
309
+   categorized_files="`rexekutor sort -t';' -k 1,2 <<< "${categorized_files}" `"
310
+
311
+   create_headers_file "${categorized_files}" &
312
+   create_sources_file "${categorized_files}" &
313
+
314
+   log_verbose "waiting..."
315
+   wait
316
+   log_verbose 'done!'
317
+}
318
+
319
+
320
+_init()
321
+{
322
+   if [ -z "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}" ]
323
+   then
324
+      MULLE_BASHFUNCTIONS_LIBEXEC_DIR="`mulle-bashfunctions-env "libexec-dir" 2> /dev/null`"
325
+      [ -z "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}" ] && \
326
+         echo "mulle-bashfunctions-env not installed" >&2 && \
327
+         exit 1
328
+   fi
329
+
330
+   . "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}/mulle-bashfunctions.sh" "minimal" || exit 1
331
+}
332
+
333
+_init "$@"
334
+main "$@"
335
+
336
+
0 337
new file mode 100755
... ...
@@ -0,0 +1,498 @@
1
+#! /usr/bin/env bash
2
+#
3
+#   Copyright (c) 2018 Nat! - Mulle kybernetiK
4
+#   All rights reserved.
5
+#
6
+#   Redistribution and use in source and binary forms, with or without
7
+#   modification, are permitted provided that the following conditions are met:
8
+#
9
+#   Redistributions of source code must retain the above copyright notice, this
10
+#   list of conditions and the following disclaimer.
11
+#
12
+#   Redistributions in binary form must reproduce the above copyright notice,
13
+#   this list of conditions and the following disclaimer in the documentation
14
+#   and/or other materials provided with the distribution.
15
+#
16
+#   Neither the name of Mulle kybernetiK nor the names of its contributors
17
+#   may be used to endorse or promote products derived from this software
18
+#   without specific prior written permission.
19
+#
20
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+#   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+#   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
+#   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24
+#   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+#   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+#   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+#   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
+#   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
+#   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
+#   POSSIBILITY OF SUCH DAMAGE.
31
+#
32
+
33
+[ "${TRACE}" = "YES" ] && set -x && : "$0" "$@"
34
+
35
+
36
+CMAKE_SOURCETREE_UPDATE_VERSION="0.0.2"
37
+
38
+
39
+usage()
40
+{
41
+   [ $# -ne 0 ] && log_error "$1"
42
+
43
+   cat <<EOF >&2
44
+Usage:
45
+   ${MULLE_USAGE_NAME} <action> <filename> <category>
46
+
47
+   Let mulle-monitor run this for you. None of the arguments are actually
48
+   used.
49
+
50
+EOF
51
+   exit 1
52
+}
53
+
54
+
55
+# https://cmake.org/Wiki/CMake_Checking_Platform
56
+uname_to_cmake()
57
+{
58
+   log_entry "uname_to_cmake" "$@"
59
+
60
+   local uname="$1"
61
+
62
+   case "${uname}" in
63
+      darwin)
64
+         echo "APPLE"
65
+      ;;
66
+
67
+      "")
68
+         fail "uname is empty"
69
+      ;;
70
+
71
+      *)
72
+         tr 'a-z' 'A-Z' <<< "${uname}"
73
+      ;;
74
+   esac
75
+}
76
+
77
+
78
+osexclude_to_cmake_if()
79
+{
80
+   log_entry "osexclude_to_cmake_if" "$@"
81
+
82
+   local marks="$1"
83
+
84
+   local cmakevar
85
+
86
+   local excludes
87
+   local onlys
88
+
89
+   set -o noglob ; IFS=","
90
+
91
+   for osexclude in ${marks}