Browse code

* upgrade to newest mulle-sde

Nat! authored on 18-12-2018 23:35:27
Showing 88 changed files
... ...
@@ -1,39 +1,20 @@
1 1
 .DS_Store
2
-*[Bb]uild/
3
-.idea/
2
+._.DS_Store
3
+*~.*
4
+*.dSYM/
5
+*.exe
6
+*.debug
4 7
 *.old
5 8
 *.bak
6
-*.exe
7
-*.exe.debug
8
-*.exe.debug.dSYM
9
-xcuserdata/
9
+old/
10 10
 tmp/
11
+var/
12
+stacktrace/
13
+malloc-error/
11 14
 
12
-/research/
13
-test/include/
14
-test/lib/
15 15
 
16
-test/vararg/char/double_char
17
-test/vararg/char/int_char
18
-test/vararg/char/longlong_char
19
-test/vararg/char/pointer_char
20
-test/vararg/count/count
21
-test/vararg/double/double_double
22
-test/vararg/double/int_double
23
-test/vararg/double/longlong_double
24
-test/vararg/double/pointer_double
25
-test/vararg/int/char_int
26
-test/vararg/int/double_int
27
-test/vararg/int/int_int
28
-test/vararg/int/longlong_int
29
-test/vararg/int/pointer_int
30
-test/vararg/longlong/double_longlong
31
-test/vararg/longlong/int_longlong
32
-test/vararg/longlong/longlong_longlong
33
-test/vararg/longlong/pointer_longlong
34
-test/vararg/pointer/double_pointer
35
-test/vararg/pointer/int_pointer
36
-test/vararg/pointer/longlong_pointer
16
+environment-os-*.sh
17
+environment-host-*.sh
37 18
 
38 19
 # ### > generated by mulle-sde (extensions/mulle-sde/sde/init)
39 20
 
... ...
@@ -48,19 +29,25 @@ test/vararg/pointer/longlong_pointer
48 29
 # style is "fluctuating" on a per-user level so not interesting
49 30
 .mulle-env/etc/style
50 31
 
32
+# .mulle-sde is generally interesting
33
+
34
+# .mulle-sourcetree is generally boring, except /etc
35
+.mulle-sourcetree/var/
36
+
51 37
 # dynamically .mulle-sourcetree-fix is boring
52 38
 .mulle-sourcetree-fix
53 39
 
54 40
 # stashes are generally boring
41
+stash/
55 42
 
56 43
 # build stuff is boring too
57 44
 build/
58 45
 dependency/
59 46
 addiction/
60
-stash/
61 47
 *.tmp/
62 48
 tmp.*/
63 49
 
64 50
 # ### < generated by mulle-sde (extensions/mulle-sde/sde/init)
65 51
 
66 52
 *.sublime-workspace
53
+src/mulle-vararg-builder.h
... ...
@@ -1,7 +1 @@
1 1
 
2
-cc
3
-gcc
4
-ld
5
-inotifywait
6
-ssh
7
-ninja
... ...
@@ -62,9 +62,3 @@ tr
62 62
 vi
63 63
 wc
64 64
 which
65
-curl
66
-column
67
-git
68
-uuidgen
69
-cmake
70
-make
71 65
new file mode 100644
... ...
@@ -0,0 +1,2 @@
1
+project
2
+extension
0 3
new file mode 100644
... ...
@@ -0,0 +1,22 @@
1
+# Reset to empty
2
+export MULLE_SDE_UPDATE_CALLBACKS="sourcetree:source"
3
+
4
+
5
+# Used by `mulle-match find` to speed up the search.
6
+export MULLE_MATCH_FILENAMES="config:*.h:*.inc:*.c:CMakeLists.txt:*.cmake"
7
+
8
+
9
+# Used by `mulle-match find` to locate files
10
+export MULLE_MATCH_PATH="${PROJECT_SOURCE_DIR}:CMakeLists.txt:cmake"
11
+
12
+
13
+# Used by `mulle-match find` to ignore boring subdirectories like .git
14
+export MULLE_MATCH_IGNORE_PATH=
15
+
16
+
17
+#
18
+#
19
+#
20
+export MULLE_SDE_INSTALLED_VERSION="0.33.1"
21
+
22
+
0 23
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-mirror"
5
+export MULLE_FETCH_ARCHIVE_DIR="${HOME:-/tmp}/Library/Caches/mulle-fetch/archive"
0 6
similarity index 100%
1 7
rename from .mulle-env/share/environment-aux.sh
2 8
rename to .mulle-env/share/environment-plugin.sh
... ...
@@ -34,3 +34,21 @@ export PROJECT_DIALECT="c"
34 34
 export PROJECT_EXTENSIONS="c"
35 35
 
36 36
 
37
+#
38
+#
39
+#
40
+export PROJECT_IDENTIFIER="mulle_vararg"
41
+
42
+
43
+#
44
+#
45
+#
46
+export PROJECT_DOWNCASE_IDENTIFIER="mulle_vararg"
47
+
48
+
49
+#
50
+#
51
+#
52
+export PROJECT_UPCASE_IDENTIFIER="MULLE_VARARG"
53
+
54
+
37 55
deleted file mode 100644
... ...
@@ -1,25 +0,0 @@
1
-# Used by `mulle-match find` to speed up the search.
2
-export MULLE_MATCH_FIND_NAMES="config:*.h:*.inc:*.c:CMakeLists.txt:*.cmake"
3
-
4
-# Used by `mulle-match find` to locate files
5
-export MULLE_MATCH_FIND_LOCATIONS="${PROJECT_SOURCE_DIR}:CMakeLists.txt:cmake"
6
-
7
-#
8
-# By default assume a project has source and a sourcetree in that order.
9
-#
10
-
11
-#
12
-#
13
-#
14
-export MULLE_SDE_INSTALLED_VERSION="0.28.4"
15
-
16
-# By default assume a project has source and a sourcetree in that order.
17
-
18
-
19
-# By default assume a project has source and a sourcetree in that order.
20
-
21
-
22
-# By default assume a project has source and a sourcetree in that order.
23
-export MULLE_SDE_UPDATE_CALLBACKS="sourcetree:source"
24
-
25
-
... ...
@@ -1,4 +1,7 @@
1
-[ "${TRACE}" = "YES" -o "${MULLE_ENVIRONMENT_TRACE}" = "YES" ] && set -x  && : "$0" "$@"
1
+#######
2
+### none startup
3
+#######
4
+[ "${TRACE}" = 'YES' -o "${ENVIRONMENT_SH_TRACE}" = 'YES' ] && set -x  && : "$0" "$@"
2 5
 
3 6
 #
4 7
 # If mulle-env is broken, sometimes its nice just to source this file.
... ...
@@ -22,8 +25,14 @@ then
22 25
 your convenience" >&2
23 26
 fi
24 27
 
25
-alias mulle-env-reload='. "${MULLE_VIRTUAL_ROOT}/.mulle-env/share/include-environment.sh"'
28
+#
29
+# now read in custom envionment (required)
30
+#
31
+. "${MULLE_VIRTUAL_ROOT}/.mulle-env/share/include-environment.sh"
26 32
 
33
+#
34
+# basic setup for interactive shells
35
+#
27 36
 case "${MULLE_SHELL_MODE}" in
28 37
    *INTERACTIVE*)
29 38
       #
... ...
@@ -51,23 +60,14 @@ case "${MULLE_SHELL_MODE}" in
51 60
       . "${MULLE_ENV_LIBEXEC_DIR}/mulle-env-cd.sh"
52 61
       unset MULLE_ENV_LIBEXEC_DIR
53 62
 
54
-      mulle-env-reload
55
-   ;;
63
+      # install mulle-env-reload
56 64
 
57
-   *)
58
-      set -a ; mulle-env-reload     # export all definitions for command
59
-      eval ${COMMAND}  # must eval this so ls -1 ${MULLE_VIRTUAL_ROOT} works
60
-      exit $?
61
-   ;;
62
-esac
65
+      alias mulle-env-reload='. "${MULLE_VIRTUAL_ROOT}/.mulle-env/share/include-environment.sh"'
63 66
 
64 67
 
65
-#
66
-# Source in bash completion if available
67
-# Assumed is, that they are not user modifiable
68
-#
69
-case "${MULLE_SHELL_MODE}" in
70
-   *INTERACTIVE*)
68
+      #
69
+      # source in any bash completion files
70
+      #
71 71
       DEFAULT_IFS="${IFS}"
72 72
       shopt -s nullglob; IFS="
73 73
 "
... ...
@@ -79,24 +79,51 @@ case "${MULLE_SHELL_MODE}" in
79 79
 
80 80
       unset FILENAME
81 81
       unset DEFAULT_IFS
82
+
83
+
84
+      #
85
+      # show motd, if any
86
+      #
87
+      if [ -z "${NO_MOTD}" ]
88
+      then
89
+         if [ -f "${MULLE_VIRTUAL_ROOT}/.mulle-env/etc/motd" ]
90
+         then
91
+            cat "${MULLE_VIRTUAL_ROOT}/.mulle-env/etc/motd"
92
+         else
93
+            if [ -f "${MULLE_VIRTUAL_ROOT}/.mulle-env/share/motd" ]
94
+            then
95
+               cat "${MULLE_VIRTUAL_ROOT}/.mulle-env/share/motd"
96
+            fi
97
+         fi
98
+      else
99
+         unset NO_MOTD
100
+      fi
82 101
    ;;
83 102
 esac
84 103
 
85
-#
86
-#
87
-# show motd, if any
88
-#
89
-if [ -z "${NO_MOTD}" ]
90
-then
91
-   if [ -f "${MULLE_VIRTUAL_ROOT}/.mulle-env/etc/motd" ]
92
-   then
93
-      cat "${MULLE_VIRTUAL_ROOT}/.mulle-env/etc/motd"
94
-   else
95
-      if [ -f "${MULLE_VIRTUAL_ROOT}/.mulle-env/share/motd" ]
104
+#######
105
+### mulle startup
106
+#######
107
+
108
+case "${MULLE_SHELL_MODE}" in
109
+   *INTERACTIVE*)
110
+      if [ -z "" ]
96 111
       then
97
-         cat "${MULLE_VIRTUAL_ROOT}/.mulle-env/share/motd"
112
+         alias buildorder="mulle-sde buildorder"
113
+         alias clean="mulle-sde clean"
114
+         alias craft="mulle-sde craft"
115
+         alias dependency="mulle-sde dependency"
116
+         alias environment="mulle-sde environment"
117
+         alias extension="mulle-sde extension"
118
+         alias fetch="mulle-sde show"
119
+         alias show="mulle-sde find"
120
+         alias library="mulle-sde library"
121
+         alias log="mulle-sde log"
122
+         alias match="mulle-sde match"
123
+         alias monitor="mulle-sde monitor"
124
+         alias patternfile="mulle-sde patternfile"
125
+         alias subproject="mulle-sde subproject"
126
+         alias update="mulle-sde update"
98 127
       fi
99
-   fi
100
-else
101
-   unset NO_MOTD
102
-fi
128
+   ;;
129
+esac
... ...
@@ -1,44 +1,40 @@
1
-[ "${TRACE}" = "YES" ] && set -x  && : "$0" "$@"
2
-
3 1
 [ -z "${MULLE_VIRTUAL_ROOT}" -o -z "${MULLE_UNAME}"  ] && \
4 2
    echo "Your script needs to setup MULLE_VIRTUAL_ROOT \
5 3
 and MULLE_UNAME properly" >&2  && exit 1
6 4
 
7
-case "${MULLE_UNAME}" in
8
-   'mingw'*)
9
-      MULLE_HOSTNAME="`PATH=/bin:/usr/bin hostname`" # don't export it
10
-   ;;
11
-
12
-   *)
13
-      MULLE_HOSTNAME="`PATH=/bin:/usr/bin hostname -s`" # don't export it
14
-   ;;
15
-esac
16
-
17 5
 MULLE_ENV_SHARE_DIR="${MULLE_VIRTUAL_ROOT}/.mulle-env/share"
18 6
 MULLE_ENV_ETC_DIR="${MULLE_VIRTUAL_ROOT}/.mulle-env/etc"
19
-
20
-
21
-# Top/down order of inclusion.
22
-# Left overrides right if present.
7
+# Top/down order of inclusion. Left overrides right if present.
8
+# Keep these files (except environment-custom.sh) clean off manual edits so
9
+# that mulle-env can read and set environment variables.
23 10
 #
24 11
 # .mulle-env/etc                        | .mulle-env/share
25 12
 # --------------------------------------|--------------------
26
-#                                       | environment-aux.sh
13
+#                                       | environment-plugin.sh
14
+#                                       | environment-plugin-os-${MULLE_UNAME}.sh
27 15
 #                                       | environment-project.sh
28
-#                                       | environment-share.sh
16
+#                                       | environment-extension.sh
29 17
 # environment-global.sh                 |
30
-# environment-os-${MULLE_UNAME}.sh      | environment-os-${MULLE_UNAME}.sh
18
+# environment-os-${MULLE_UNAME}.sh      |
31 19
 # environment-host-${MULLE_HOSTNAME}.sh |
32 20
 # environment-user-${USER}.sh           |
33
-# custom-environment.sh                 |
21
+# environment-custom.sh                 |
34 22
 #
35 23
 
36 24
 #
37
-# The aux file, if present is to be set by a mulle-env plugin
25
+# The plugin file, if present is to be set by a mulle-env plugin
38 26
 #
39
-if [ -f "${MULLE_ENV_SHARE_DIR}/environment-aux.sh" ]
27
+if [ -f "${MULLE_ENV_SHARE_DIR}/environment-plugin.sh" ]
40 28
 then
41
-   . "${MULLE_ENV_SHARE_DIR}/environment-aux.sh"
29
+   . "${MULLE_ENV_SHARE_DIR}/environment-plugin.sh"
30
+fi
31
+
32
+#
33
+# The plugin file, if present is to be set by a mulle-env plugin
34
+#
35
+if [ -f "${MULLE_ENV_SHARE_DIR}/environment-plugin-os${MULLE_UNAME}.sh" ]
36
+then
37
+   . "${MULLE_ENV_SHARE_DIR}/environment-plugin-os${MULLE_UNAME}.sh"
42 38
 fi
43 39
 
44 40
 
... ...
@@ -52,43 +48,32 @@ then
52 48
 fi
53 49
 
54 50
 #
55
-# The share file, if present is to be set by mulle-sde extensions.
51
+# The extension file, if present is to be set by mulle-sde extensions.
56 52
 #
57
-if [ -f "${MULLE_ENV_SHARE_DIR}/environment-share.sh" ]
53
+if [ -f "${MULLE_ENV_SHARE_DIR}/environment-extension.sh" ]
58 54
 then
59
-   . "${MULLE_ENV_SHARE_DIR}/environment-share.sh"
55
+   . "${MULLE_ENV_SHARE_DIR}/environment-extension.sh"
60 56
 fi
61 57
 
62
-
58
+#
59
+# Global user settings
60
+#
63 61
 if [ -f "${MULLE_ENV_ETC_DIR}/environment-global.sh" ]
64 62
 then
65 63
    . "${MULLE_ENV_ETC_DIR}/environment-global.sh"
66 64
 fi
67 65
 
68 66
 #
69
-# "os-" can be written by extensions also
67
+# Load in some user modifications depending on os, hostname, username.
70 68
 #
71
-if [ -f "${MULLE_ENV_ETC_DIR}/environment-os-${MULLE_UNAME}.sh" ]
69
+if [ -f "${MULLE_ENV_ETC_DIR}/environment-host-${MULLE_HOSTNAME}.sh" ]
72 70
 then
73
-   . "${MULLE_ENV_ETC_DIR}/environment-os-${MULLE_UNAME}.sh"
74
-else
75
-   if [ -f "${MULLE_ENV_SHARE_DIR}/environment-os-${MULLE_UNAME}.sh" ]
76
-   then
77
-      . "${MULLE_ENV_SHARE_DIR}/environment-os-${MULLE_UNAME}.sh"
78
-   fi
71
+   . "${MULLE_ENV_ETC_DIR}/environment-host-${MULLE_HOSTNAME}.sh"
79 72
 fi
80 73
 
81
-#
82
-# Load in some modifications depending on hostname, username. These
83
-# won't be provided by extensions or plugins.
84
-#
85
-# These settings could be "cased" in a single file, but it seems convenient.
86
-# And more managable for mulle-env environment
87
-#
88
-
89
-if [ -f "${MULLE_ENV_ETC_DIR}/environment-host-${MULLE_HOSTNAME}.sh" ]
74
+if [ -f "${MULLE_ENV_ETC_DIR}/environment-os-${MULLE_UNAME}.sh" ]
90 75
 then
91
-   . "${MULLE_ENV_ETC_DIR}/environment-host-${MULLE_HOSTNAME}.sh"
76
+   . "${MULLE_ENV_ETC_DIR}/environment-os-${MULLE_UNAME}.sh"
92 77
 fi
93 78
 
94 79
 if [ -f "${MULLE_ENV_ETC_DIR}/environment-user-${USER}.sh" ]
... ...
@@ -99,11 +84,9 @@ fi
99 84
 #
100 85
 # For more complex edits, that don't work with the cmdline tool
101 86
 #
102
-if [ -f "${MULLE_ENV_ETC_DIR}/custom-environment.sh" ]
87
+if [ -f "${MULLE_ENV_ETC_DIR}/environment-custom.sh" ]
103 88
 then
104
-   . "${MULLE_ENV_ETC_DIR}/custom-environment.sh"
89
+   . "${MULLE_ENV_ETC_DIR}/environment-custom.sh"
105 90
 fi
106
-
107 91
 unset MULLE_ENV_ETC_DIR
108 92
 unset MULLE_ENV_SHARE_DIR
109
-unset MULLE_HOSTNAME
... ...
@@ -1 +1 @@
1
-0.16.1
1
+1.0.1
... ...
@@ -29,52 +29,54 @@
29 29
 #   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 30
 #   POSSIBILITY OF SUCH DAMAGE.
31 31
 #
32
-
33
-[ "${TRACE}" = "YES" ] && set -x && : "$0" "$@"
32
+[ "${TRACE}" = 'YES' -o "${C_SOURCETREE_UPDATE_TRACE}" = 'YES' ] && set -x && : "$0" "$@"
34 33
 
35 34
 
36 35
 usage()
37 36
 {
38 37
    cat <<EOF >&2
39 38
 Usage:
40
-   c-sourcetree-update <action> <filename> <category>
39
+   c-sourcetree-update [flags]
41 40
 
42 41
    Produces the _<project>-include.h files and related headers.
43 42
 
43
+Flags:
44
+      --stdout :  Emit to stdout instead
45
+
44 46
 EOF
45 47
    exit 1
46 48
 }
47 49
 
48 50
 
49
-uname_to_cpp()
51
+r_uname_to_cpp()
50 52
 {
51
-   log_entry "uname_to_cmake" "$@"
53
+   log_entry "r_uname_to_cpp" "$@"
52 54
 
53 55
    local uname="$1"  # the part after only-os or no
54 56
 
55 57
    case "${uname}" in
56 58
       'darwin')
57
-         echo "__APPLE__"
59
+         RVAL="__APPLE__"
58 60
       ;;
59 61
 
60 62
       'freebsd')
61
-         echo "BSD4_3"  # guess
63
+         RVAL="BSD4_3"  # guess
62 64
       ;;
63 65
 
64 66
       'mingw'*)
65
-         echo "_WIN32"
67
+         RVAL="_WIN32"
66 68
       ;;
67 69
 
68 70
       *)
69
-         echo "__${uname}__"
71
+         RVAL="__${uname}__"
70 72
       ;;
71 73
    esac
72 74
 }
73 75
 
74 76
 
75
-osexclude_to_cpp_if()
77
+r_osexclude_to_cpp_if()
76 78
 {
77
-   log_entry "osexclude_to_cpp_if" "$@"
79
+   log_entry "r_osexclude_to_cpp_if" "$@"
78 80
 
79 81
    local marks="$1"
80 82
 
... ...
@@ -91,13 +93,15 @@ osexclude_to_cpp_if()
91 93
 
92 94
       case "${osexclude}" in
93 95
          only-os-*)
94
-            cppvar="`uname_to_cpp "${osexclude:8}"`"
95
-            onlys="`concat "${onlys}" "defined( ${cppvar})" " || " `"
96
+				r_uname_to_cpp "${osexclude:8}"
97
+            r_concat "${onlys}" "defined( ${RVAL})" " || "
98
+            onlys="${RVAL}"
96 99
          ;;
97 100
 
98 101
          no-os-*)
99
-            cppvar="`uname_to_cpp "${osexclude:6}"`"
100
-            excludes="`concat "${excludes}" "! defined( ${cppvar})" " && "`"
102
+				r_uname_to_cpp "${osexclude:6}"
103
+            r_concat "${excludes}" "! defined( ${RVAL})" " && "
104
+            excludes="${RVAL}"
101 105
          ;;
102 106
       esac
103 107
    done
... ...
@@ -105,14 +109,17 @@ osexclude_to_cpp_if()
105 109
 
106 110
    if [ ! -z "${onlys}" ]
107 111
    then
108
-      echo "# if ${onlys}"
112
+      RVAL="# if ${onlys}"
109 113
       return
110 114
    fi
111 115
 
112 116
    if [ ! -z "${excludes}" ]
113 117
    then
114
-      echo "# if ${excludes}"
118
+      RVAL="# if ${excludes}"
119
+      return
115 120
    fi
121
+
122
+   RVAL=""
116 123
 }
117 124
 
118 125
 
... ...
@@ -128,13 +135,14 @@ _emit_c_include()
128 135
    local ifstatement
129 136
    local include
130 137
    local mark
138
+   local RVAL
131 139
 
132 140
    #
133 141
    # so objc can reuse this, make a provision for import with --objc flag
134 142
    # but allow #include if the mark no-objc is set
135 143
    #
136 144
    include="include"
137
-   if [ "${OPTION_IMPORT}" = "YES" ]
145
+   if [ "${OPTION_IMPORT}" = 'YES' ]
138 146
    then
139 147
       include="import"
140 148
 
... ...
@@ -147,7 +155,8 @@ _emit_c_include()
147 155
 
148 156
    if [ ! -z "${marks}" ]
149 157
    then
150
-      ifstatement="`osexclude_to_cpp_if "${marks}" `"
158
+   	r_osexclude_to_cpp_if "${marks}"
159
+      ifstatement="${RVAL}"
151 160
    fi
152 161
 
153 162
    if [ ! -z "${ifstatement}" ]
... ...
@@ -188,6 +197,8 @@ emit_c_include_library()
188 197
    local marks="$2"
189 198
    local header="$3"
190 199
 
200
+   local RVAL
201
+
191 202
    #
192 203
    # the default for libraries is old style <name.h> not <name/name.h>
193 204
    #
... ...
@@ -195,7 +206,8 @@ emit_c_include_library()
195 206
    then
196 207
       local name
197 208
 
198
-      name="`fast_basename "${address}"`"
209
+      r_fast_basename "${address}"
210
+      name="${RVAL}"
199 211
       header="${name}.h"
200 212
    fi
201 213
 
... ...
@@ -212,6 +224,7 @@ emit_c_include_dependency()
212 224
    local marks="$2"
213 225
    local header="$3"
214 226
 
227
+   local RVAL
215 228
    #
216 229
    # the default for dependencies is <name/name.h>
217 230
    #
... ...
@@ -219,7 +232,8 @@ emit_c_include_dependency()
219 232
    then
220 233
       local name
221 234
 
222
-      name="`fast_basename "${address}"`"
235
+      r_fast_basename "${address}"
236
+      name="${RVAL}"
223 237
       header="${name}/${name}.h"
224 238
    fi
225 239
 
... ...
@@ -235,7 +249,8 @@ emit_c_header()
235 249
 
236 250
    local filter_marks
237 251
 
238
-   filter_marks="`comma_concat "header" "${marks}" `"
252
+   r_comma_concat "header" "${marks}"
253
+   filter_marks="${RVAL}"
239 254
 
240 255
    # since the order of the headers is important and needs to be in treeorder
241 256
    # we use mulle-sourcetree directly
... ...
@@ -298,37 +313,49 @@ c_include()
298 313
 
299 314
    local text_h
300 315
 
301
-   if [ "${MULLE_SDE_INCLUDE_FILENAME}" = "NONE" ]
302
-   then
303
-      return
304
-   fi
305
-   if [ -z "${MULLE_SDE_INCLUDE_FILENAME}" ]
306
-   then
307
-      MULLE_SDE_INCLUDE_FILENAME="${PROJECT_SOURCE_DIR}/_${projectname}-include.h"
308
-   fi
309
-
310
-   local marks
316
+   case "${MULLE_SDE_INCLUDE_FILENAME}" in
317
+      DISABLE*)
318
+         return
319
+      ;;
311 320
 
312
-   case "${PROJECT_DIALECT}" in
313
-      'objc')
314
-         marks="no-import,public"
321
+      NONE)
322
+         text_h="/* Contents suppressed by MULLE_SDE_INCLUDE_FILENAME NONE.
323
+* Use
324
+*   mulle-sde environment --global set MULLE_SDE_INCLUDE_FILENAME DISABLE
325
+* to not generate this file.
326
+*/"
315 327
       ;;
316 328
 
317
-      *)
318
-         marks="public"
329
+      "")
330
+         MULLE_SDE_INCLUDE_FILENAME="${PROJECT_SOURCE_DIR}/_${projectname}-include.h"
319 331
       ;;
320 332
    esac
321 333
 
322
-   text_h="`emit_c_header "${marks}"`" || exit 1
323
-
324 334
    if [ -z "${text_h}" ]
325 335
    then
326
-      text_h="/* no headers */"
327
-   fi
336
+      local marks
328 337
 
329
-   text_h="/*
330
-   This file will be regenerated by \`mulle-sde update|monitor\`.
331
-   Edits will be lost.
338
+      case "${PROJECT_DIALECT}" in
339
+         'objc')
340
+            marks="no-import,public"
341
+         ;;
342
+
343
+         *)
344
+            marks="public"
345
+         ;;
346
+      esac
347
+
348
+      text_h="`emit_c_header "${marks}"`" || exit 1
349
+
350
+      if [ -z "${text_h}" ]
351
+      then
352
+         text_h="/* no headers */"
353
+      fi
354
+
355
+      text_h="/*
356
+*   This file will be regenerated by \`mulle-sde update|monitor\`.
357
+* Edits will be lost.
358
+* Suppress this file with MULLE_SDE_INCLUDE_FILENAME NONE|DISABLE.
332 359
 */
333 360
 
334 361
 #ifndef _${projectidentifier}_include_h__
... ...
@@ -337,9 +364,16 @@ c_include()
337 364
 ${text_h}
338 365
 
339 366
 #endif"
367
+   fi
340 368
 
341
-   log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_INCLUDE_FILENAME}"
342
-   redirect_exekutor "${MULLE_SDE_INCLUDE_FILENAME}" echo "${text_h}"
369
+   if [ "${MULLE_SDE_INCLUDE_FILENAME}" = "-" ]
370
+   then
371
+      log_info "-include.h"
372
+      rexekutor echo "${text_h}"
373
+   else
374
+      log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_INCLUDE_FILENAME}"
375
+      redirect_exekutor "${MULLE_SDE_INCLUDE_FILENAME}" echo "${text_h}"
376
+   fi
343 377
 }
344 378
 
345 379
 
... ...
@@ -352,26 +386,38 @@ objc_import()
352 386
 
353 387
    local text_h
354 388
 
355
-   if [ "${MULLE_SDE_IMPORT_FILENAME}" = "NONE" ]
356
-   then
357
-      return
358
-   fi
359
-   if [ -z "${MULLE_SDE_IMPORT_FILENAME}" ]
360
-   then
361
-      MULLE_SDE_IMPORT_FILENAME="${PROJECT_SOURCE_DIR}/_${projectname}-import.h"
362
-   fi
389
+   case "${MULLE_SDE_IMPORT_FILENAME}" in
390
+      DISABLE*)
391
+         return
392
+      ;;
363 393
 
364
-   text_h="`emit_c_header "import,public"`" || exit 1
394
+      NONE)
395
+         text_h="/* Contents suppressed by MULLE_SDE_IMPORT_FILENAME NONE.
396
+* Use
397
+*   mulle-sde environment --global set MULLE_SDE_IMPORT_FILENAME DISABLE
398
+* to not generate this file.
399
+*/"
400
+      ;;
401
+
402
+      "")
403
+         MULLE_SDE_IMPORT_FILENAME="${PROJECT_SOURCE_DIR}/_${projectname}-import.h"
404
+      ;;
405
+   esac
365 406
 
366 407
    if [ -z "${text_h}" ]
367 408
    then
368
-      text_h="/* no headers */"
369
-   fi
409
+      text_h="`emit_c_header "import,public"`" || exit 1
410
+
411
+      if [ -z "${text_h}" ]
412
+      then
413
+         text_h="/* no headers */"
414
+      fi
370 415
 
371 416
 
372
-   text_h="/*
373
-   This file will be regenerated by \`mulle-sde update|monitor\`.
374
-   Edits will be lost.
417
+      text_h="/*
418
+* This file will be regenerated by \`mulle-sde update|monitor\`.
419
+* Edits will be lost.
420
+* Suppress this file with MULLE_SDE_IMPORT_FILENAME NONE|DISABLE.
375 421
 */
376 422
 
377 423
 #ifndef _${projectidentifier}_import_h__
... ...
@@ -380,9 +426,16 @@ objc_import()
380 426
 ${text_h}
381 427
 
382 428
 #endif"
429
+   fi
383 430
 
384
-   log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_IMPORT_FILENAME}"
385
-   redirect_exekutor "${MULLE_SDE_IMPORT_FILENAME}" echo "${text_h}"
431
+   if [ "${MULLE_SDE_IMPORT_FILENAME}" = "-" ]
432
+   then
433
+      log_info "-import.h"
434
+      rexekutor echo "${text_h}"
435
+   else
436
+      log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_IMPORT_FILENAME}"
437
+      redirect_exekutor "${MULLE_SDE_IMPORT_FILENAME}" echo "${text_h}"
438
+   fi
386 439
 }
387 440
 
388 441
 
... ...
@@ -395,37 +448,49 @@ c_include_private()
395 448
 
396 449
    local text_h
397 450
 
398
-   if [ "${MULLE_SDE_INCLUDE_PRIVATE_FILENAME}" = "NONE" ]
399
-   then
400
-      return
401
-   fi
402
-   if [ -z "${MULLE_SDE_INCLUDE_PRIVATE_FILENAME}" ]
403
-   then
404
-      MULLE_SDE_INCLUDE_PRIVATE_FILENAME="${PROJECT_SOURCE_DIR}/_${projectname}-include-private.h"
405
-   fi
406
-
407
-   local marks
451
+   case "${MULLE_SDE_INCLUDE_PRIVATE_FILENAME}" in
452
+      DISABLE*)
453
+         return
454
+      ;;
408 455
 
409
-   case "${PROJECT_DIALECT}" in
410
-      'objc')
411
-         marks="no-import,no-public"
456
+      NONE)
457
+         text_h="/* Contents suppressed by MULLE_SDE_INCLUDE_PRIVATE_FILENAME NONE.
458
+* Use
459
+*   mulle-sde environment --global set MULLE_SDE_INCLUDE_PRIVATE_FILENAME DISABLE
460
+* to not generate this file.
461
+*/"
412 462
       ;;
413 463
 
414
-      *)
415
-         marks="no-public"
464
+      "")
465
+         MULLE_SDE_INCLUDE_PRIVATE_FILENAME="${PROJECT_SOURCE_DIR}/_${projectname}-include-private.h"
416 466
       ;;
417 467
    esac
418 468
 
419
-   text_h="`emit_c_header "${marks}"`" || exit 1
420
-
421 469
    if [ -z "${text_h}" ]
422 470
    then
423
-      text_h="/* no headers */"
424
-   fi
471
+      local marks
425 472
 
426
-   text_h="/*
473
+      case "${PROJECT_DIALECT}" in
474
+         'objc')
475
+            marks="no-import,no-public"
476
+         ;;
477
+
478
+         *)
479
+            marks="no-public"
480
+         ;;
481
+      esac
482
+
483
+      text_h="`emit_c_header "${marks}"`" || exit 1
484
+
485
+      if [ -z "${text_h}" ]
486
+      then
487
+         text_h="/* no headers */"
488
+      fi
489
+
490
+      text_h="/*
427 491
    This file will be regenerated by \`mulle-sde update|monitor\`.
428 492
    Edits will be lost.
493
+   Suppress this file with MULLE_SDE_INCLUDE_PRIVATE_FILENAME NONE|DISABLE.
429 494
 */
430 495
 
431 496
 #ifndef _${projectidentifier}_include_private_h__
... ...
@@ -434,9 +499,16 @@ c_include_private()
434 499
 ${text_h}
435 500
 
436 501
 #endif"
502
+   fi
437 503
 
438
-   log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_INCLUDE_PRIVATE_FILENAME}"
439
-   redirect_exekutor "${MULLE_SDE_INCLUDE_PRIVATE_FILENAME}" echo "${text_h}"
504
+   if [ "${MULLE_SDE_INCLUDE_PRIVATE_FILENAME}" = "-" ]
505
+   then
506
+      log_info "-include-private.h"
507
+      rexekutor echo "${text_h}"
508
+   else
509
+      log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_INCLUDE_PRIVATE_FILENAME}"
510
+      redirect_exekutor "${MULLE_SDE_INCLUDE_PRIVATE_FILENAME}" echo "${text_h}"
511
+   fi
440 512
 }
441 513
 
442 514
 
... ...
@@ -449,26 +521,39 @@ objc_import_private()
449 521
 
450 522
    local text_h
451 523
 
452
-   if [ "${MULLE_SDE_IMPORT_PRIVATE_FILENAME}" = "NONE" ]
453
-   then
454
-      return
455
-   fi
456
-   if [ -z "${MULLE_SDE_IMPORT_PRIVATE_FILENAME}" ]
457
-   then
458
-      MULLE_SDE_IMPORT_PRIVATE_FILENAME="${PROJECT_SOURCE_DIR}/_${projectname}-import-private.h"
459
-   fi
524
+   case "${MULLE_SDE_IMPORT_PRIVATE_FILENAME}" in
525
+      DISABLE*)
526
+         return
527
+      ;;
460 528
 
461
-   text_h="`emit_c_header "import,no-public"`" || exit 1
529
+      NONE)
530
+         text_h="/* Contents suppressed by MULLE_SDE_IMPORT_PRIVATE_FILENAME NONE.
531
+* Use
532
+*   mulle-sde environment --global set MULLE_SDE_IMPORT_PRIVATE_FILENAME DISABLE
533
+* to not generate this file.
534
+*/"
535
+      ;;
536
+
537
+
538
+      "")
539
+         MULLE_SDE_IMPORT_PRIVATE_FILENAME="${PROJECT_SOURCE_DIR}/_${projectname}-import-private.h"
540
+      ;;
541
+   esac
462 542
 
463 543
    if [ -z "${text_h}" ]
464 544
    then
465
-      text_h="/* no headers */"
466
-   fi
545
+      text_h="`emit_c_header "import,no-public"`" || exit 1
467 546
 
547
+      if [ -z "${text_h}" ]
548
+      then
549
+         text_h="/* no headers */"
550
+      fi
468 551
 
469
-   text_h="/*
470
-   This file will be regenerated by \`mulle-sde update|monitor\`.
471
-   Edits will be lost.
552
+
553
+      text_h="/*
554
+* This file will be regenerated by \`mulle-sde update|monitor\`.
555
+* Edits will be lost.
556
+* Suppress this file with MULLE_SDE_IMPORT_PRIVATE_FILENAME NONE|DISABLE.
472 557
 */
473 558
 
474 559
 #ifndef _${projectidentifier}_import_private_h__
... ...
@@ -477,9 +562,16 @@ objc_import_private()
477 562
 ${text_h}
478 563
 
479 564
 #endif"
565
+   fi
480 566
 
481
-   log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_IMPORT_PRIVATE_FILENAME}"
482
-   redirect_exekutor "${MULLE_SDE_IMPORT_PRIVATE_FILENAME}" echo "${text_h}"
567
+   if [ "${MULLE_SDE_IMPORT_PRIVATE_FILENAME}" = "-" ]
568
+   then
569
+      log_info "-import-private.h"
570
+      rexekutor echo "${text_h}"
571
+   else
572
+      log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_IMPORT_PRIVATE_FILENAME}"
573
+      redirect_exekutor "${MULLE_SDE_IMPORT_PRIVATE_FILENAME}" echo "${text_h}"
574
+   fi
483 575
 }
484 576
 
485 577
 
... ...
@@ -489,21 +581,21 @@ main()
489 581
 
490 582
    # technical flags
491 583
    local MULLE_TRACE
492
-   local MULLE_FLAG_DONT_DEFER="NO"
493
-   local MULLE_FLAG_EXEKUTOR_DRY_RUN="NO"
494
-   local MULLE_FLAG_FOLLOW_SYMLINKS="YES"
495
-   local MULLE_FLAG_LOG_CACHE="NO"
496
-   local MULLE_FLAG_LOG_DEBUG="NO"
497
-   local MULLE_FLAG_LOG_EXEKUTOR="NO"
498
-   local MULLE_FLAG_LOG_FLUFF="NO"
499
-   local MULLE_FLAG_LOG_MERGE="NO"
500
-   local MULLE_FLAG_LOG_SCRIPTS="NO"
501
-   local MULLE_FLAG_LOG_SETTINGS="NO"
502
-   local MULLE_FLAG_LOG_VERBOSE="NO"
503
-   local MULLE_TRACE_PATHS_FLIP_X="NO"
504
-   local MULLE_TRACE_POSTPONE="NO"
505
-   local MULLE_TRACE_RESOLVER_FLIP_X="NO"
506
-   local MULLE_TRACE_SETTINGS_FLIP_X="NO"
584
+   local MULLE_FLAG_DONT_DEFER='NO'
585
+   local MULLE_FLAG_EXEKUTOR_DRY_RUN='NO'
586
+   local MULLE_FLAG_FOLLOW_SYMLINKS='YES'
587
+   local MULLE_FLAG_LOG_CACHE='NO'
588
+   local MULLE_FLAG_LOG_DEBUG='NO'
589
+   local MULLE_FLAG_LOG_EXEKUTOR='NO'
590
+   local MULLE_FLAG_LOG_FLUFF='NO'
591
+   local MULLE_FLAG_LOG_MERGE='NO'
592
+   local MULLE_FLAG_LOG_SCRIPTS='NO'
593
+   local MULLE_FLAG_LOG_SETTINGS='NO'
594
+   local MULLE_FLAG_LOG_VERBOSE='NO'
595
+   local MULLE_TRACE_PATHS_FLIP_X='NO'
596
+   local MULLE_TRACE_POSTPONE='NO'
597
+   local MULLE_TRACE_RESOLVER_FLIP_X='NO'
598
+   local MULLE_TRACE_SETTINGS_FLIP_X='NO'
507 599
 
508 600
    local OPTION_IMPORT="DEFAULT"
509 601
 
... ...
@@ -521,11 +613,11 @@ main()
521 613
          ;;
522 614
 
523 615
          --import)
524
-            OPTION_IMPORT="YES"
616
+            OPTION_IMPORT='YES'
525 617
          ;;
526 618
 
527 619
          --no-import)
528
-            OPTION_IMPORT="NO"
620
+            OPTION_IMPORT='NO'
529 621
          ;;
530 622
 
531 623
          -p|--project-name)
... ...
@@ -556,6 +648,13 @@ main()
556 648
             PROJECT_DIALECT="$1"
557 649
          ;;
558 650
 
651
+         --stdout)
652
+            MULLE_SDE_INCLUDE_FILENAME="-"
653
+            MULLE_SDE_INCLUDE_PRIVATE_FILENAME="-"
654
+            MULLE_SDE_IMPORT_FILENAME="-"
655
+            MULLE_SDE_IMPORT_PRIVATE_FILENAME="-"
656
+         ;;
657
+
559 658
          -*)
560 659
             log_error "Unknown option \"$1\""
561 660
             usage
... ...
@@ -571,39 +670,45 @@ main()
571 670
 
572 671
    options_setup_trace "${MULLE_TRACE}"
573 672
 
673
+   [ -z "${MULLE_VIRTUAL_ROOT}" ] && fail "Must run inside the mulle-sde environment"
674
+
574 675
    if [ -z "${MULLE_CASE_SH}" ]
575 676
    then
576 677
       # shellcheck source=mulle-case.sh
577
-      . "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}/mulle-case.sh"      || return 1
678
+      . "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}/mulle-case.sh" || return 1
578 679
    fi
579 680
 
681
+   local RVAL
682
+
580 683
    if [ -z "${PROJECT_NAME}" ]
581 684
    then
582
-      PROJECT_NAME="`fast_basename "${PWD}"`" # could be nicer
685
+   	r_fast_basename "${PWD}"
686
+      PROJECT_NAME="${RVAL}" # could be nicer
583 687
    fi
584 688
 
585 689
    local PROJECT_IDENTIFIER
586 690
    local PROJECT_DOWNCASE_IDENTIFIER
587 691
 
588
-   PROJECT_IDENTIFIER="`tweaked_de_camel_case "${PROJECT_NAME}"`"
692
+   r_tweaked_de_camel_case "${PROJECT_NAME}"
693
+   PROJECT_IDENTIFIER="${RVAL}"
589 694
    PROJECT_IDENTIFIER="`printf "%s" "${PROJECT_IDENTIFIER}" | tr -c 'a-zA-Z0-9' '_'`"
590 695
    PROJECT_DOWNCASE_IDENTIFIER="`tr 'A-Z' 'a-z' <<< "${PROJECT_IDENTIFIER}"`"
591 696
 
592 697
    [ -z "${PROJECT_SOURCE_DIR}" ] && internal_fail "PROJECT_SOURCE_DIR not set"
593 698
    [ -z "${PROJECT_DIALECT}" ] && log_warning "PROJECT_DIALECT not set"
594 699
 
595
-   c_include "${PROJECT_NAME}" "${PROJECT_DOWNCASE_IDENTIFIER}"
596
-   c_include_private "${PROJECT_NAME}" "${PROJECT_DOWNCASE_IDENTIFIER}"
700
+   c_include "${PROJECT_NAME}" "${PROJECT_DOWNCASE_IDENTIFIER}" || exit 1
701
+   c_include_private "${PROJECT_NAME}" "${PROJECT_DOWNCASE_IDENTIFIER}" || exit 1
597 702
 
598 703
    if [ "${PROJECT_DIALECT}" = "objc" ]
599 704
    then
600 705
       if [ "${OPTION_IMPORT}" = "DEFAULT" ]
601 706
       then
602
-         OPTION_IMPORT="YES"
707
+         OPTION_IMPORT='YES'
603 708
       fi
604 709
 
605
-      objc_import "${PROJECT_NAME}" "${PROJECT_DOWNCASE_IDENTIFIER}"
606
-      objc_import_private "${PROJECT_NAME}" "${PROJECT_DOWNCASE_IDENTIFIER}"
710
+      objc_import "${PROJECT_NAME}" "${PROJECT_DOWNCASE_IDENTIFIER}" || exit 1
711
+      objc_import_private "${PROJECT_NAME}" "${PROJECT_DOWNCASE_IDENTIFIER}" || exit 1
607 712
    fi
608 713
 }
609 714
 
... ...
@@ -31,7 +31,7 @@
31 31
 #
32 32
 # Create fresh HeadersAndSources.cmake from filesystem information
33 33
 #
34
-[ "${TRACE}" = "YES" ] && set -x && : "$0" "$@"
34
+[ "${TRACE}" = 'YES' ] && set -x && : "$0" "$@"
35 35
 
36 36
 
37 37
 CMAKE_SOURCE_UPDATE_VERSION="0.0.1"
... ...
@@ -140,11 +140,12 @@ create_headers_file()
140 140
    local text_hdr
141 141
 
142 142
    case "${MULLE_SDE_CMAKE_HEADERS_FILE}" in
143
-      "DISABLED")
144
-         log_verbose "Header generation disabled by MULLE_SDE_CMAKE_HEADERS_FILE=DISABLED"
143
+      DISABLE*)
144
+         log_verbose "Header generation disabled by MULLE_SDE_CMAKE_HEADERS_FILE=DISABLE"
145
+         return
145 146
       ;;
146 147
 
147
-      "NONE")
148
+      NONE)
148 149
          text_hdr="# Header generation disabled by MULLE_SDE_CMAKE_HEADERS_FILE=NONE"
149 150
          MULLE_SDE_CMAKE_HEADERS_FILE=""
150 151
       ;;
... ...
@@ -173,7 +174,8 @@ ${text_hdr2}"
173 174
 
174 175
    MULLE_SDE_CMAKE_HEADERS_FILE="${MULLE_SDE_CMAKE_HEADERS_FILE:-cmake/_Headers.cmake}"
175 176
 
176
-   text_hdr="# ${MULLE_SDE_CMAKE_HEADERS_FILE} is generated by \`mulle-sde\`. Edits will be lost.
177
+   text_hdr="#
178
+# ${MULLE_SDE_CMAKE_HEADERS_FILE} is generated by \`mulle-sde\`. Edits will be lost.
177 179
 #
178 180
 if( MULLE_TRACE_INCLUDE)
179 181
    MESSAGE( STATUS \"# Include \\\"\${CMAKE_CURRENT_LIST_FILE}\\\"\" )
... ...
@@ -182,11 +184,20 @@ endif()
182 184
 ${text_hdr}
183 185
 "
184 186
 
187
+   if [ "${MULLE_SDE_CMAKE_HEADERS_FILE}" = '-' ]
188
+   then
189
+   	log_info "Sources"
190
+   	echo "${text_src}"
191
+   	return 0
192
+   fi
193
+
185 194
    log_fluff "Create cmake header files (${PWD})"
186 195
 
187 196
    log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_CMAKE_HEADERS_FILE}"
188
-   exekutor mkdir -p  "`fast_dirname "${MULLE_SDE_CMAKE_HEADERS_FILE}"`"
197
+   r_fast_dirname "${MULLE_SDE_CMAKE_HEADERS_FILE}"
198
+   exekutor mkdir -p  "${RVAL}"
189 199
    exekutor chmod a+w "${MULLE_SDE_CMAKE_HEADERS_FILE}"  2> /dev/null
200
+   r_mkdir_parent_if_missing "${MULLE_SDE_CMAKE_HEADERS_FILE}"
190 201
    redirect_exekutor "${MULLE_SDE_CMAKE_HEADERS_FILE}" echo "${text_hdr}"
191 202
    exekutor chmod a-w "${MULLE_SDE_CMAKE_HEADERS_FILE}"
192 203
 }
... ...
@@ -201,11 +212,12 @@ create_sources_file()
201 212
    local text_src
202 213
 
203 214
    case "${MULLE_SDE_CMAKE_SOURCES_FILE}" in
204
-      "DISABLED")
205
-         log_verbose "Source generation disabled by MULLE_SDE_CMAKE_SOURCES_FILE=DISABLED"
215
+      DISABLE*)
216
+         log_verbose "Source generation disabled by MULLE_SDE_CMAKE_SOURCES_FILE=DISABLE"
217
+         return
206 218
       ;;
207 219
 
208
-      "NONE")
220
+      NONE)
209 221
          text_src="# Source generation disabled by MULLE_SDE_CMAKE_SOURCES_FILE=NONE"
210 222
          MULLE_SDE_CMAKE_SOURCES_FILE=""
211 223
       ;;
... ...
@@ -222,14 +234,14 @@ create_sources_file()
222 234
             #
223 235
             # header only libraries are tricky to do portably
224 236
             #
225
-            text_src="message( ERROR \" No sources found. \`mulle-sde environment set MULLE_SDE_CMAKE_SOURCES_FILE NONE\`, if this is intentional\")"
237
+            text_src="message( FATAL_ERROR \" No sources found. \`mulle-sde environment set MULLE_SDE_CMAKE_SOURCES_FILE NONE\`, if this is intentional\")"
226 238
          fi
227
-
228 239
       ;;
229 240
    esac
230 241
 
231 242
    MULLE_SDE_CMAKE_SOURCES_FILE="${MULLE_SDE_CMAKE_SOURCES_FILE:-cmake/_Sources.cmake}"
232
-   text_src="# ${MULLE_SDE_CMAKE_SOURCES_FILE} is generated by \`mulle-sde\`. Edits will be lost.
243
+   text_src="#
244
+# ${MULLE_SDE_CMAKE_SOURCES_FILE} is generated by \`mulle-sde\`. Edits will be lost.
233 245
 #
234 246
 if( MULLE_TRACE_INCLUDE)
235 247
    MESSAGE( STATUS \"# Include \\\"\${CMAKE_CURRENT_LIST_FILE}\\\"\" )
... ...
@@ -239,9 +251,18 @@ ${text_src}"
239 251
 
240 252
    log_fluff "Create cmake source files (${PWD})"
241 253
 
254
+   if [ "${MULLE_SDE_CMAKE_SOURCES_FILE}" = '-' ]
255
+   then
256
+   	log_info "Sources"
257
+   	echo "${text_src}"
258
+   	return 0
259
+   fi
260
+
242 261
    log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_CMAKE_SOURCES_FILE}"
243
-   exekutor mkdir -p  "`fast_dirname "${MULLE_SDE_CMAKE_SOURCES_FILE}"`" 2> /dev/null
262
+   r_fast_dirname "${MULLE_SDE_CMAKE_SOURCES_FILE}"
263
+   exekutor mkdir -p  "${RVAL}" 2> /dev/null
244 264
    exekutor chmod a+w "${MULLE_SDE_CMAKE_SOURCES_FILE}"  2> /dev/null
265
+   r_mkdir_parent_if_missing "${MULLE_SDE_CMAKE_SOURCES_FILE}"
245 266
    redirect_exekutor "${MULLE_SDE_CMAKE_SOURCES_FILE}" echo "${text_src}"
246 267
    exekutor chmod a-w "${MULLE_SDE_CMAKE_SOURCES_FILE}"
247 268
 }
... ...
@@ -253,23 +274,25 @@ main()
253 274
 
254 275
    # technical flags
255 276
    local MULLE_TRACE
256
-   local MULLE_FLAG_DONT_DEFER="NO"
257
-   local MULLE_FLAG_EXEKUTOR_DRY_RUN="NO"
258
-   local MULLE_FLAG_FOLLOW_SYMLINKS="YES"
259
-   local MULLE_FLAG_LOG_CACHE="NO"
260
-   local MULLE_FLAG_LOG_DEBUG="NO"
261
-   local MULLE_FLAG_LOG_EXEKUTOR="NO"
262
-   local MULLE_FLAG_LOG_FLUFF="NO"
263
-   local MULLE_FLAG_LOG_MERGE="NO"
264
-   local MULLE_FLAG_LOG_SCRIPTS="NO"
265
-   local MULLE_FLAG_LOG_SETTINGS="NO"
266
-   local MULLE_FLAG_LOG_VERBOSE="NO"
267
-   local MULLE_TRACE_PATHS_FLIP_X="NO"
268
-   local MULLE_TRACE_POSTPONE="NO"
269
-   local MULLE_TRACE_RESOLVER_FLIP_X="NO"
270
-   local MULLE_TRACE_SETTINGS_FLIP_X="NO"
271
-
272
-   local OPTION_PARALLEL="YES"
277
+   local MULLE_FLAG_DONT_DEFER='NO'
278
+   local MULLE_FLAG_EXEKUTOR_DRY_RUN='NO'
279
+   local MULLE_FLAG_FOLLOW_SYMLINKS='YES'
280
+   local MULLE_FLAG_LOG_CACHE='NO'
281
+   local MULLE_FLAG_LOG_DEBUG='NO'
282
+   local MULLE_FLAG_LOG_EXEKUTOR='NO'
283
+   local MULLE_FLAG_LOG_FLUFF='NO'
284
+   local MULLE_FLAG_LOG_MERGE='NO'
285
+   local MULLE_FLAG_LOG_SCRIPTS='NO'
286
+   local MULLE_FLAG_LOG_SETTINGS='NO'
287
+   local MULLE_FLAG_LOG_VERBOSE='NO'
288
+   local MULLE_TRACE_PATHS_FLIP_X='NO'
289
+   local MULLE_TRACE_POSTPONE='NO'
290
+   local MULLE_TRACE_RESOLVER_FLIP_X='NO'
291
+   local MULLE_TRACE_SETTINGS_FLIP_X='NO'
292
+
293
+   local OPTION_PARALLEL='YES'
294
+   local OPTION_HEADERS='YES'
295
+   local OPTION_SOURCES='YES'
273 296
 
274 297
    while [ $# -ne 0 ]
275 298
    do
... ...
@@ -285,9 +308,27 @@ main()
285 308
          ;;
286 309
 
287 310
          --no-parallel)
288
-            OPTION_PARALLEL="NO"
311
+            OPTION_PARALLEL='NO'
289 312
          ;;
290 313
 
314
+         --no-headers)
315
+				OPTION_HEADERS='NO'
316
+			;;
317
+
318
+         --no-sources)
319
+				OPTION_SOURCES='NO'
320
+			;;
321
+
322
+         --headers-file)
323
+				shift
324
+				MULLE_SDE_CMAKE_HEADERS_FILE="$1"
325
+			;;
326
+
327
+         --sources-file)
328
+				shift
329
+				MULLE_SDE_CMAKE_SOURCES_FILE="$1"
330
+			;;
331
+
291 332
          --version)
292 333
             echo "${CMAKE_SOURCE_UPDATE_VERSION}"
293 334
             return 0
... ...
@@ -312,6 +353,8 @@ main()
312 353
    MULLE_MATCH="${MULLE_MATCH:-`command -v mulle-match`}"
313 354
    [ -z "${MULLE_MATCH}" ] && fail "mulle-match not in PATH"
314 355
 
356
+   [ -z "${MULLE_VIRTUAL_ROOT}" ] && fail "Must run inside the mulle-sde environment"
357
+
315 358
    #
316 359
    # With 1000 header and 1000 source files, a full update takes ~7s on
317 360
    # my machine. It certainly would be interesting to make this properly
... ...
@@ -340,17 +383,29 @@ main()
340 383
 
341 384
    categorized_files="`LC_ALL=C rexekutor sort -d -t';' -k 1,2 <<< "${categorized_files}" `"
342 385
 
343
-   if [ "${OPTION_PARALLEL}" = "YES" ]
386
+   if [ "${OPTION_PARALLEL}" = 'YES' ]
344 387
    then
345
-      create_headers_file "${categorized_files}" &
346
-      create_sources_file "${categorized_files}" &
388
+   	if [ "${OPTION_HEADERS}" = 'YES' ]
389
+   	then
390
+      	create_headers_file "${categorized_files}" &
391
+      fi
392
+   	if [ "${OPTION_SOURCES}" = 'YES' ]
393
+   	then
394
+      	create_sources_file "${categorized_files}" &
395
+      fi
347 396
 
348 397
       log_fluff "waiting..."
349 398
       wait
350 399
       log_fluff 'done!'
351 400
    else
352
-      create_headers_file "${categorized_files}"
353
-      create_sources_file "${categorized_files}"
401
+   	if [ "${OPTION_HEADERS}" = 'YES' ]
402
+   	then
403
+   	   create_headers_file "${categorized_files}"
404
+      fi
405
+   	if [ "${OPTION_SOURCES}" = 'YES' ]
406
+   	then
407
+   	   create_sources_file "${categorized_files}"
408
+      fi
354 409
    fi
355 410
 }
356 411
 
... ...
@@ -365,7 +420,7 @@ _init()
365 420
          exit 1
366 421
    fi
367 422
 
368
-   . "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}/mulle-bashfunctions.sh" "minimal" || exit 1
423
+   . "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}/mulle-bashfunctions.sh"  || exit 1
369 424
 }
370 425
 
371 426
 _init "$@"
... ...
@@ -30,7 +30,7 @@
30 30
 #   POSSIBILITY OF SUCH DAMAGE.
31 31
 #
32 32
 
33
-[ "${TRACE}" = "YES" ] && set -x && : "$0" "$@"
33
+[ "${TRACE}" = 'YES' ] && set -x && : "$0" "$@"
34 34
 
35 35
 
36 36
 CMAKE_SOURCETREE_UPDATE_VERSION="0.0.2"
... ...
@@ -44,18 +44,38 @@ usage()
44 44
 Usage:
45 45
    ${MULLE_USAGE_NAME} <action> <filename> <category>
46 46
 
47
+   Create the _Dependencies.cmake and _Libraries.cmake files from the
48
+   information contained in the subtree.
49
+
50
+   ${MULLE_USAGE_NAME} has to run in a mulle-sde environment. You can run it
51
+   with \`mulle-sde run ${MULLE_USAGE_NAME}\`.
52
+
53
+   Subtree marks used:
54
+      no-all-load        : do not emit ObjC specifica
55
+      no-cmakeadd        : do not add to the list of libraries to link
56
+      no-cmakedependency : don't inherit foreign DependenciesAndLibraries.cmake
57
+      no-cmakeinherit    : do not inherit anything from foreign library
58
+      no-cmakeloader     : don't inherit foreign objc-loader.h
59
+      no-require         : combines no-require-link and no-require-header
60
+      no-require-header  : the header does not need to exist
61
+      no-require-link    : the library need not exist, omit from link if missing
62
+
47 63
    Let mulle-monitor run this for you. None of the arguments are actually
48 64
    used.
49 65
 
66
+Environment:
67
+   MULLE_SDE_DEPENDENCIES_FILE  : name of the dependencies output file
68
+   MULLE_SDE_LIBRARIES_FILE     : name of the libraries output file
69
+
50 70
 EOF
51 71
    exit 1
52 72
 }
53 73
 
54 74
 
55 75
 # https://cmake.org/Wiki/CMake_Checking_Platform
56
-uname_to_cmake()
76
+r_uname_to_cmake()
57 77
 {
58
-   log_entry "uname_to_cmake" "$@"
78
+   log_entry "r_uname_to_cmake" "$@"
59 79
 
60 80
    local uname="$1"
61 81
 
... ...
@@ -69,25 +89,23 @@ uname_to_cmake()
69 89
       'mingw')
70 90
          systemname="Windows"
71 91
       ;;
72
-      
92
+
73 93
       *)
74 94
          systemname="`tr 'a-z' 'A-Z' <<< "${uname:0:1}"`"
75 95
          systemname="${systemname}${uname:1}"
76 96
       ;;
77 97
    esac
78 98
 
79
-   echo "\${CMAKE_SYSTEM_NAME} MATCHES \"${systemname}\""
99
+   RVAL="\${CMAKE_SYSTEM_NAME} MATCHES \"${systemname}\""
80 100
 }
81 101
 
82 102
 
83
-osexclude_to_cmake_if()
103
+r_osexclude_to_cmake_if()
84 104
 {
85
-   log_entry "osexclude_to_cmake_if" "$@"
105
+   log_entry "r_osexclude_to_cmake_if" "$@"
86 106
 
87 107
    local marks="$1"
88 108
 
89
-   local cmakevar
90
-
91 109
    local excludes
92 110
    local onlys
93 111
 
... ...
@@ -99,13 +117,15 @@ osexclude_to_cmake_if()
99 117
 
100 118
       case "${osexclude}" in
101 119
          only-os-*)
102
-            cmakevar="`uname_to_cmake "${osexclude:8}"`"
103
-            onlys="`concat "${onlys}" "${cmakevar}" " OR " `"
120
+            r_uname_to_cmake "${osexclude:8}"
121
+            r_concat "${onlys}" "${RVAL}" " OR "
122
+            onlys="${RVAL}"
104 123
          ;;
105 124
 
106 125
          no-os-*)
107
-            cmakevar="`uname_to_cmake "${osexclude:6}"`"
108
-            excludes="`concat "${excludes}" "${cmakevar}" " AND "`"
126
+            r_uname_to_cmake "${osexclude:6}"
127
+            r_concat "${excludes}" "${RVAL}" " AND "
128
+            excludes="${RVAL}"
109 129
          ;;
110 130
       esac
111 131
    done
... ...
@@ -115,7 +135,7 @@ osexclude_to_cmake_if()
115 135
 
116 136
    if [ ! -z "${onlys}" ]
117 137
    then
118
-      echo "if( ${onlys})"
138
+      RVAL="if( ${onlys})"
119 139
       return
120 140
    fi
121 141
 
... ...
@@ -123,17 +143,121 @@ osexclude_to_cmake_if()
123 143