Browse code

* modernized mulle-sde

Nat! authored on 06-07-2018 14:33:28
Showing 57 changed files
... ...
@@ -1,60 +1,46 @@
1
-# By default assume a project has source and a sourcetree
2
-export MULLE_SDE_UPDATE_CALLBACKS="source:sourcetree"
3
-
4
-
5
-#
6 1
 #
2
+# Git mirror and Zip/TGZ cache to conserve bandwidth
3
+# Memo: override in os-specific env file
7 4
 #
8
-export MULLE_SDE_INSTALLED_VERSION="0.15.6"
5
+export MULLE_FETCH_MIRROR_DIR="${HOME:-/tmp}/.cache/mulle-fetch/git-mirror"
9 6
 
10
-
11
-#
12 7
 #
8
+# Git mirror and Zip/TGZ cache to conserve bandwidth
13 9
 #
14
-export PROJECT_NAME="mulle-concurrent"
15
-
10
+export MULLE_FETCH_ARCHIVE_DIR="${HOME:-/tmp}/.cache/mulle-fetch/archive"
16 11
 
17 12
 #
13
+# PATH to search for git repositories locally
18 14
 #
19
-#
20
-export PROJECT_LANGUAGE="c"
21
-
15
+export MULLE_FETCH_SEARCH_PATH="${MULLE_VIRTUAL_ROOT}/.."
22 16
 
23 17
 #
18
+# Prefer symlinking to local git repositories found via MULLE_FETCH_SEARCH_PATH
24 19
 #
25
-#
26
-export PROJECT_TYPE="library"
20
+export MULLE_SOURCETREE_SYMLINK="YES"
27 21
 
28
-
29
-#
30 22
 #
23
+# Use common folder for sharable projects
31 24
 #
32
-export PROJECT_DIALECT="c"
33
-
25
+export MULLE_SOURCETREE_SHARE_DIR="${MULLE_VIRTUAL_ROOT}/stash"
34 26
 
35 27
 #
28
+# Share dependency directory (absolute for ease of use)
36 29
 #
37
-#
38
-# export DIALECT_EXTENSION="c"
39
-
40
-
41
-# These are used by `mulle-match find` to speed up the search.
42
-export MULLE_MATCH_FIND_NAMES="config:CMakeLists.txt:*.cmake:*.h:*.inc:*.c"
43
-
44
-
45
-# These are used by `mulle-match find` to locate files
46
-export MULLE_MATCH_FIND_LOCATIONS=".mulle-sourcetree/etc/config:CMakeLists.txt:cmake:src"
47
-
30
+export DEPENDENCY_DIR="${MULLE_VIRTUAL_ROOT}/dependency"
48 31
 
49 32
 #
33
+# Share addiction directory (absolute for ease of use)
50 34
 #
51
-#
52
-# export DIALECT_EXTENSIONS="c"
53
-
35
+export ADDICTION_DIR="${MULLE_VIRTUAL_ROOT}/addiction"
54 36
 
55 37
 #
38
+# Use common build directory
56 39
 #
57
-#
58
-export PROJECT_EXTENSIONS="c"
59
-
40
+export BUILD_DIR="${MULLE_VIRTUAL_ROOT}/build"
60 41
 
42
+#
43
+# Modify path so that dependency and addictions executables are found and
44
+# preferred.
45
+#
46
+export PATH="${DEPENDENCY_DIR}/bin:${ADDICTION_DIR}/bin:$PATH"
... ...
@@ -1,63 +1,19 @@
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-mirror"
6
-
7
-#
8
-# Git mirror and Zip/TGZ cache to conserve bandwidth
9
-#
10
-export MULLE_FETCH_ARCHIVE_DIR="${HOME:-/tmp}/.cache/mulle-fetch/archive"
11
-
12
-#
13
-# PATH to search for git repositories locally
14
-#
15
-export MULLE_FETCH_SEARCH_PATH="${MULLE_VIRTUAL_ROOT}/.."
16
-
17
-#
18
-# Prefer symlinking 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}/stash"
26
-
27
-#
28
-# Share dependency directory (absolute for ease of use)
29
-#
30
-export DEPENDENCY_DIR="${MULLE_VIRTUAL_ROOT}/dependency"
31
-
32
-#
33
-# Share addiction directory (absolute for ease of use)
34
-#
35
-export ADDICTION_DIR="${MULLE_VIRTUAL_ROOT}/addiction"
36
-
37
-#
38
-# Use common build directory
39
-#
40
-export BUILD_DIR="${MULLE_VIRTUAL_ROOT}/build"
41 1
 # Used by `mulle-match find` to speed up the search.
42 2
 export MULLE_MATCH_FIND_NAMES="config:*.h:*.inc:*.c:CMakeLists.txt:*.cmake"
43 3
 
44
-
45 4
 # Used by `mulle-match find` to locate files
46 5
 export MULLE_MATCH_FIND_LOCATIONS="${PROJECT_SOURCE_DIR}:CMakeLists.txt:cmake"
47 6
 
48
-
49
-# By default assume a project has source and a sourcetree
50
-# The order should be sourcetree then source
51
-
7
+#
8
+# By default assume a project has source and a sourcetree in that order.
9
+#
52 10
 
53 11
 #
54 12
 #
55 13
 #
56
-export MULLE_SDE_INSTALLED_VERSION="0.18.1"
57
-
14
+export MULLE_SDE_INSTALLED_VERSION="0.24.3"
58 15
 
59
-# By default assume a project has source and a sourcetree
60
-# The order should be sourcetree then source
16
+# By default assume a project has source and a sourcetree in that order.
61 17
 export MULLE_SDE_UPDATE_CALLBACKS="sourcetree:source"
62 18
 
63 19
 
... ...
@@ -56,7 +56,7 @@ case "${MULLE_SHELL_MODE}" in
56 56
 
57 57
    *)
58 58
       set -a ; mulle-env-reload     # export all definitions for command
59
-      eval ${COMMAND}  # must eval this so ls -1  works
59
+      eval ${COMMAND}  # must eval this so ls -1 ${MULLE_VIRTUAL_ROOT} works
60 60
       exit $?
61 61
    ;;
62 62
 esac
... ...
@@ -86,7 +86,7 @@ esac
86 86
 #
87 87
 # show motd, if any
88 88
 #
89
-if [ -z ""]
89
+if [ -z "${NO_MOTD}" ]
90 90
 then
91 91
    if [ -f "${MULLE_VIRTUAL_ROOT}/.mulle-env/etc/motd" ]
92 92
    then
... ...
@@ -15,6 +15,7 @@ MULLE_ENV_ETC_DIR="${MULLE_VIRTUAL_ROOT}/.mulle-env/etc"
15 15
 #
16 16
 # .mulle-env/etc                        | .mulle-env/share
17 17
 # --------------------------------------|--------------------
18
+#                                       | environment-aux.sh
18 19
 #                                       | environment-project.sh
19 20
 #                                       | environment-share.sh
20 21
 # environment-global.sh                 |
... ...
@@ -24,6 +25,15 @@ MULLE_ENV_ETC_DIR="${MULLE_VIRTUAL_ROOT}/.mulle-env/etc"
24 25
 # custom-environment.sh                 |
25 26
 #
26 27
 
28
+#
29
+# The aux file, if present is to be set by a mulle-env plugin
30
+#
31
+if [ -f "${MULLE_ENV_SHARE_DIR}/environment-aux.sh" ]
32
+then
33
+   . "${MULLE_ENV_SHARE_DIR}/environment-aux.sh"
34
+fi
35
+
36
+
27 37
 #
28 38
 # The project file, if present is to be set by mulle-sde init itself
29 39
 # w/o extensions
... ...
@@ -36,9 +46,6 @@ fi
36 46
 #
37 47
 # The share file, if present is to be set by mulle-sde extensions.
38 48
 #
39
-# A trick here is that mulle-env doesn't clobber this file
40
-# when doing an init -f, which can be useful.
41
-#
42 49
 if [ -f "${MULLE_ENV_SHARE_DIR}/environment-share.sh" ]
43 50
 then
44 51
    . "${MULLE_ENV_SHARE_DIR}/environment-share.sh"
... ...
@@ -64,7 +71,7 @@ else
64 71
 fi
65 72
 
66 73
 #
67
-# Load in some modifications depending on  hostname, username. These
74
+# Load in some modifications depending on hostname, username. These
68 75
 # won't be provided by extensions or plugins.
69 76
 #
70 77
 # These settings could be "cased" in a single file, but it seems convenient.
... ...
@@ -1 +1 @@
1
-0.12.1
1
+0.15.4
... ...
@@ -39,33 +39,30 @@ usage()
39 39
 Usage:
40 40
    c-sourcetree-update <action> <filename> <category>
41 41
 
42
-   This produces the _dependencies.h or some similiarly named file.
42
+   Produces the _<project>-include.h files and related headers.
43 43
 
44 44
 EOF
45 45
    exit 1
46 46
 }
47 47
 
48 48
 
49
-#
50
-# this is bullshit right now, just in the process of building it up
51
-#
52 49
 uname_to_cpp()
53 50
 {
54 51
    log_entry "uname_to_cmake" "$@"
55 52
 
56
-   local uname="$1"
53
+   local uname="$1"  # the part after only-os or no
57 54
 
58 55
    case "${uname}" in
59
-      darwin)
56
+      "darwin")
60 57
          echo "__APPLE__"
61 58
       ;;
62 59
 
63
-      "")
64
-         fail "uname is empty"
60
+      "freebsd")
61
+         echo "BSD4_3"  # guess
65 62
       ;;
66 63
 
67 64
       *)
68
-         echo "__`tr 'a-z' 'A-Z' <<< "${uname}"`__"
65
+         echo "__${uname}__"
69 66
       ;;
70 67
    esac
71 68
 }
... ...
@@ -134,20 +131,15 @@ _emit_c_include()
134 131
    # but allow #include if the mark no-objc is set
135 132
    #
136 133
    include="include"
137
-   if [ "${OPTION_OBJC}" = "YES" ]
134
+   if [ "${OPTION_IMPORT}" = "YES" ]
138 135
    then
139 136
       include="import"
140 137
 
141
-      set -o noglob ; IFS=","
142
-      for mark in ${marks}
143
-      do
144
-         if [ "${mark}" = "no-objc" ]
145
-         then
138
+      case ",${marks}," in
139
+         *,no-import,*)
146 140
             include="include"
147
-            break
148
-         fi
149
-      done
150
-      IFS="${DEFAULT_IFS}" ; set o noglob
141
+         ;;
142
+      esac
151 143
    fi
152 144
 
153 145
    if [ ! -z "${marks}" ]
... ...
@@ -161,7 +153,21 @@ _emit_c_include()
161 153
       indent=" "
162 154
    fi
163 155
 
164
-   echo "# ${indent}include <${header}>   // ${address}"
156
+   # TODO: remove support __has_include for C ? Not all C compilers have
157
+   #       __has_include
158
+   case ",${marks}," in
159
+      *,no-require,*)
160
+         echo "# if __has_include(<${header}>)"
161
+         echo "#  ${indent}${include} <${header}>   // ${address}"
162
+         echo "# endif"
163
+      ;;
164
+
165
+      *)
166
+         echo "# ${indent}${include} <${header}>   // ${address}"
167
+      ;;
168
+   esac
169
+
170
+
165 171
    if [ ! -z "${ifstatement}" ]
166 172
    then
167 173
       echo "# endif"
... ...
@@ -224,6 +230,12 @@ emit_c_header()
224 230
 {
225 231
    log_entry "emit_c_header" "$@"
226 232
 
233
+   local marks="$1"
234
+
235
+   local filter_marks
236
+
237
+   filter_marks="`comma_concat "header" "${marks}" `"
238
+
227 239
    # since the order of the headers is important and needs to be in treeorder
228 240
    # we use mulle-sourcetree directly
229 241
    local headers
... ...
@@ -231,7 +243,7 @@ emit_c_header()
231 243
    headers="`exekutor mulle-sourcetree list \
232 244
                                        --format "%a;%m;%i={aliases,,-------};\
233 245
 %i={include,,-------}\\n" \
234
-                                       --marks header \
246
+                                       --marks "${filter_marks}" \
235 247
                                        --output-raw \
236 248
                                        --no-output-header`" || return 1
237 249
 
... ...
@@ -254,7 +266,7 @@ emit_c_header()
254 266
          continue
255 267
       fi
256 268
 
257
-      log_verbose "Emit statements for ${C_MAGENTA}${C_BOLD}${address}"
269
+      log_verbose "Emit cmake statements for ${C_MAGENTA}${C_BOLD}${address}"
258 270
 
259 271
       case ",${marks}," in
260 272
          *,no-dependency,*)
... ...
@@ -279,6 +291,200 @@ emit_c_header()
279 291
 }
280 292
 
281 293
 
294
+c_include()
295
+{
296
+   log_entry "c_include" "$@"
297
+
298
+   local projectname="$1"
299
+   local projectidentifier="$2"
300
+
301
+   local text_h
302
+
303
+   if [ "${MULLE_SDE_INCLUDE_FILENAME}" = "NONE" ]
304
+   then
305
+      return
306
+   fi
307
+   if [ -z "${MULLE_SDE_INCLUDE_FILENAME}" ]
308
+   then
309
+      MULLE_SDE_INCLUDE_FILENAME="${PROJECT_SOURCE_DIR}/_${projectname}-include.h"
310
+   fi
311
+
312
+   local marks
313
+
314
+   case "${PROJECT_DIALECT}" in
315
+      'objc')
316
+         marks="no-import,public"
317
+      ;;
318
+
319
+      *)
320
+         marks="public"
321
+      ;;
322
+   esac
323
+
324
+   text_h="`emit_c_header "${marks}"`" || exit 1
325
+
326
+   if [ -z "${text_h}" ]
327
+   then
328
+      text_h="/* no headers */"
329
+   fi
330
+
331
+   text_h="/*
332
+   This file will be regenerated by \`mulle-sde update|monitor\`.
333
+   Edits will be lost.
334
+*/
335
+
336
+#ifndef _${projectidentifier}_include_h__
337
+#define _${projectidentifier}_include_h__
338
+
339
+${text_h}
340
+
341
+#endif"
342
+
343
+   log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_INCLUDE_FILENAME}"
344
+   redirect_exekutor "${MULLE_SDE_INCLUDE_FILENAME}" echo "${text_h}"
345
+}
346
+
347
+
348
+objc_import()
349
+{
350
+   log_entry "objc_import" "$@"
351
+
352
+   local projectname="$1"
353
+   local projectidentifier="$2"
354
+
355
+   local text_h
356
+
357
+   if [ "${MULLE_SDE_IMPORT_FILENAME}" = "NONE" ]
358
+   then
359
+      return
360
+   fi
361
+   if [ -z "${MULLE_SDE_IMPORT_FILENAME}" ]
362
+   then
363
+      MULLE_SDE_IMPORT_FILENAME="${PROJECT_SOURCE_DIR}/_${projectname}-import.h"
364
+   fi
365
+
366
+   text_h="`emit_c_header "import,public"`" || exit 1
367
+
368
+   if [ -z "${text_h}" ]
369
+   then
370
+      text_h="/* no headers */"
371
+   fi
372
+
373
+
374
+   text_h="/*
375
+   This file will be regenerated by \`mulle-sde update|monitor\`.
376
+   Edits will be lost.
377
+*/
378
+
379
+#ifndef _${projectidentifier}_import_h__
380
+#define _${projectidentifier}_import_h__
381
+
382
+${text_h}
383
+
384
+#endif"
385
+
386
+   log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_IMPORT_FILENAME}"
387
+   redirect_exekutor "${MULLE_SDE_IMPORT_FILENAME}" echo "${text_h}"
388
+}
389
+
390
+
391
+c_include_private()
392
+{
393
+   log_entry "c_include_private" "$@"
394
+
395
+   local projectname="$1"
396
+   local projectidentifier="$2"
397
+
398
+   local text_h
399
+
400
+   if [ "${MULLE_SDE_INCLUDE_PRIVATE_FILENAME}" = "NONE" ]
401
+   then
402
+      return
403
+   fi
404
+   if [ -z "${MULLE_SDE_INCLUDE_PRIVATE_FILENAME}" ]
405
+   then
406
+      MULLE_SDE_INCLUDE_PRIVATE_FILENAME="${PROJECT_SOURCE_DIR}/_${projectname}-include-private.h"
407
+   fi
408
+
409
+   local marks
410
+
411
+   case "${PROJECT_DIALECT}" in
412
+      'objc')
413
+         marks="no-import,no-public"
414
+      ;;
415
+
416
+      *)
417
+         marks="no-public"
418
+      ;;
419
+   esac
420
+
421
+   text_h="`emit_c_header "${marks}"`" || exit 1
422
+
423
+   if [ -z "${text_h}" ]
424
+   then
425
+      text_h="/* no headers */"
426
+   fi
427
+
428
+   text_h="/*
429
+   This file will be regenerated by \`mulle-sde update|monitor\`.
430
+   Edits will be lost.
431
+*/
432
+
433
+#ifndef _${projectidentifier}_include_private_h__
434
+#define _${projectidentifier}_include_private_h__
435
+
436
+${text_h}
437
+
438
+#endif"
439
+
440
+   log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_INCLUDE_PRIVATE_FILENAME}"
441
+   redirect_exekutor "${MULLE_SDE_INCLUDE_PRIVATE_FILENAME}" echo "${text_h}"
442
+}
443
+
444
+
445
+objc_import_private()
446
+{
447
+   log_entry "objc_import_private" "$@"
448
+
449
+   local projectname="$1"
450
+   local projectidentifier="$2"
451
+
452
+   local text_h
453
+
454
+   if [ "${MULLE_SDE_IMPORT_PRIVATE_FILENAME}" = "NONE" ]
455
+   then
456
+      return
457
+   fi
458
+   if [ -z "${MULLE_SDE_IMPORT_PRIVATE_FILENAME}" ]
459
+   then
460
+      MULLE_SDE_IMPORT_PRIVATE_FILENAME="${PROJECT_SOURCE_DIR}/_${projectname}-import-private.h"
461
+   fi
462
+
463
+   text_h="`emit_c_header "import,no-public"`" || exit 1
464
+
465
+   if [ -z "${text_h}" ]
466
+   then
467
+      text_h="/* no headers */"
468
+   fi
469
+
470
+
471
+   text_h="/*
472
+   This file will be regenerated by \`mulle-sde update|monitor\`.
473
+   Edits will be lost.
474
+*/
475
+
476
+#ifndef _${projectidentifier}_import_private_h__
477
+#define _${projectidentifier}_import_private_h__
478
+
479
+${text_h}
480
+
481
+#endif"
482
+
483
+   log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_IMPORT_PRIVATE_FILENAME}"
484
+   redirect_exekutor "${MULLE_SDE_IMPORT_PRIVATE_FILENAME}" echo "${text_h}"
485
+}
486
+
487
+
282 488
 main()
283 489
 {
284 490
    log_entry "main" "$@"
... ...
@@ -301,7 +507,7 @@ main()
301 507
    local MULLE_TRACE_RESOLVER_FLIP_X="NO"
302 508
    local MULLE_TRACE_SETTINGS_FLIP_X="NO"
303 509
 
304
-   local OPTION_OBJC_HEURISTIC="NO"
510
+   local OPTION_IMPORT="DEFAULT"
305 511
 
306 512
    while [ $# -ne 0 ]
307 513
    do
... ...
@@ -316,12 +522,44 @@ main()
316 522
             usage
317 523
          ;;
318 524
 
319
-         --objc)
320
-            OPTION_OBJC="YES"
525
+         --import)
526
+            OPTION_IMPORT="YES"
527
+         ;;
528
+
529
+         --no-import)
530
+            OPTION_IMPORT="NO"
531
+         ;;
532
+
533
+         -p|--project-name)
534
+            [ "$#" -eq 1 ] && usage "Missing argument to \"$1\""
535
+            shift
536
+
537
+            PROJECT_NAME="$1"
538
+         ;;
539
+
540
+         -t|--project-type)
541
+            [ "$#" -eq 1 ] && usage "Missing argument to \"$1\""
542
+            shift
543
+
544
+            PROJECT_TYPE="$1"
545
+         ;;
546
+
547
+         --project-source-dir)
548
+            [ "$#" -eq 1 ] && usage "Missing argument to \"$1\""
549
+            shift
550
+
551
+            PROJECT_SOURCE_DIR="$1"
552
+         ;;
553
+
554
+         --project-dialect)
555
+            [ "$#" -eq 1 ] && usage "Missing argument to \"$1\""
556
+            shift
557
+
558
+            PROJECT_DIALECT="$1"
321 559
          ;;
322 560
 
323 561
          -*)
324
-            log_error "unknown option \"$1\""
562
+            log_error "Unknown option \"$1\""
325 563
             usage
326 564
          ;;
327 565
 
... ...
@@ -335,55 +573,40 @@ main()
335 573
 
336 574
    options_setup_trace "${MULLE_TRACE}"
337 575
 
338
-
339
-   local projectname
340
-
341
-   projectname="${PROJECT_NAME}"
342
-   if [ -z "${projectname}" ]
576
+   if [ -z "${MULLE_CASE_SH}" ]
343 577
    then
344
-      projectname="`fast_basename "${PWD}"`" # could be nicer
578
+      # shellcheck source=mulle-case.sh
579
+      . "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}/mulle-case.sh"      || return 1
345 580
    fi
346 581
 
347
-   if [ "${MULLE_SDE_DEPENDENCIES_HEADER_FILE}" = "NONE" ]
582
+   if [ -z "${PROJECT_NAME}" ]
348 583
    then
349
-      return
350
-   fi
351
-
352
-   if [ -z "${MULLE_SDE_DEPENDENCIES_HEADER_FILE}" ]
353
-   then
354
-      MULLE_SDE_DEPENDENCIES_HEADER_FILE="${PROJECT_SOURCE_DIR:-src}/_${projectname}-dependencies.h"
355
-   fi
356
-
357
-   local text_h
358
-   local text_dep
359
-
360
-   text_h="`emit_c_header`"     || exit 1
361
-
362
-   if [ -z "${text_h}" ]
363
-   then
364
-      text_h="/* no headers */"
584
+      PROJECT_NAME="`fast_basename "${PWD}"`" # could be nicer
365 585
    fi
366 586
 
367
-   local projectidentifier
587
+   local PROJECT_IDENTIFIER
588
+   local PROJECT_DOWNCASE_IDENTIFIER
368 589
 
369
-   projectidentifier="`tr 'A-Z-' 'a-z_' <<< "${projectname}" `"
590
+   PROJECT_IDENTIFIER="`tweaked_de_camel_case "${PROJECT_NAME}"`"
591
+   PROJECT_IDENTIFIER="`printf "%s" "${PROJECT_IDENTIFIER}" | tr -c 'a-zA-Z0-9' '_'`"
592
+   PROJECT_DOWNCASE_IDENTIFIER="`tr 'A-Z' 'a-z' <<< "${PROJECT_IDENTIFIER}"`"
370 593
 
371
-   text_h="/*
372
-   This file will be regenerated by \`mulle-sde update|monitor\`.
373
-   Edits will be lost.
374
-*/
375
-
376
-#ifndef _${projectidentifier}__dependencies_h__
377
-#define _${projectidentifier}__dependencies_h__
378
-
379
-${text_h}
594
+   [ -z "${PROJECT_SOURCE_DIR}" ] && internal_fail "PROJECT_SOURCE_DIR not set"
595
+   [ -z "${PROJECT_DIALECT}" ] && log_warning "PROJECT_DIALECT not set"
380 596
 
381
-#endif"
597
+   c_include "${PROJECT_NAME}" "${PROJECT_DOWNCASE_IDENTIFIER}"
598
+   c_include_private "${PROJECT_NAME}" "${PROJECT_DOWNCASE_IDENTIFIER}"
382 599
 
383
-   log_fluff "Create header file (${PWD})"
600
+   if [ "${PROJECT_DIALECT}" = "objc" ]
601
+   then
602
+      if [ "${OPTION_IMPORT}" = "DEFAULT" ]
603
+      then
604
+         OPTION_IMPORT="YES"
605
+      fi
384 606
 
385
-   log_verbose "Writing ${C_RESET_BOLD}${MULLE_SDE_DEPENDENCIES_HEADER_FILE}"
386
-   redirect_exekutor "${MULLE_SDE_DEPENDENCIES_HEADER_FILE}" echo "${text_h}"
607
+      objc_import "${PROJECT_NAME}" "${PROJECT_DOWNCASE_IDENTIFIER}"
608
+      objc_import_private "${PROJECT_NAME}" "${PROJECT_DOWNCASE_IDENTIFIER}"
609
+   fi
387 610
 }
388 611
 
389 612
 
390 613
new file mode 100755
... ...
@@ -0,0 +1,146 @@
1
+#!/usr/bin/env bash
2
+
3
+
4
+get_includes()
5
+{
6
+   local filename="$1"
7
+
8
+   sed -n -e 's/^.*include([ ]*\([^) ]*\)[ ]*\([^ ]*\)[ ]*).*/\1;\2/p' "${filename}"
9
+}
10
+
11
+
12
+find_cmake_file()
13
+{
14
+   local filename="$1"
15
+   local originator="$2"
16
+   local searchpath="$3"
17
+
18
+   case "${filename}" in
19
+      *.*)
20
+         searchpath="`dirname -- "${originator}"`"
21
+      ;;
22
+
23
+      *)
24
+         filename="${filename}.cmake"
25
+      ;;
26
+   esac
27
+
28
+   local directory
29
+
30
+   IFS=":"
31
+   for directory in ${searchpath}
32
+   do
33
+      IFS="${DEFAULT_IFS}"
34
+
35
+      if [ -f "${directory}/${filename}" ]
36
+      then
37
+         echo "${directory}/${filename}"
38
+         return 0
39
+      fi
40
+   done
41
+   IFS="${DEFAULT_IFS}"
42
+
43
+   return 1
44
+}
45
+
46
+
47
+pretty()
48
+{
49
+   local filename="$1"
50
+
51
+   case "${filename}" in
52
+      ./*)
53
+         pretty "${filename#./}"
54
+         return
55
+      ;;
56
+   esac
57
+
58
+   echo "${filename}"
59
+}
60
+
61
+_list_cmake_include()
62
+{
63
+   local filename="$1"
64
+   local originator="$2"
65
+   local searchpath="$3"
66
+
67
+   local actualfile
68
+
69
+   if ! actualfile="`find_cmake_file "${filename}" "${originator}" "${searchpath}"`"
70
+   then
71
+      if [ -z "${optional}" ]
72
+      then
73
+         echo "\"${filename}\" not found" >&2
74
+         return 1
75
+      fi
76
+         return 0
77
+   fi
78
+
79
+   echo "   \"`pretty "${originator}"`\" -> \"`pretty "${actualfile}"`\""
80
+
81
+   list_cmake_includes "${actualfile}" "${searchpath}"
82
+}
83
+
84
+
85
+list_cmake_includes()
86
+{
87
+   local filename="$1"
88
+   local searchpath="$2"
89
+
90
+   local actualfile
91
+   local includefile
92
+   local includeinfo
93
+   local optional
94
+
95
+   IFS="
96
+"
97
+   for includeinfo in `get_includes "${filename}"`
98
+   do
99
+      IFS="${DEFAULT_IFS}"
100
+
101
+      includefile="${includeinfo%;*}"
102
+      optional="${includeinfo%*#}"
103
+
104
+      if [ "${includefile}" = '"${FILE}"' ]
105
+      then
106
+         local directory
107
+
108
+         directory="`dirname -- "${filename}"`"
109
+         for includefile in "${directory}"/cmake/[A-Za-z0-9]*.cmake
110
+         do
111
+            _list_cmake_include "${includefile}" "${filename}" "${searchpath}"
112
+         done
113
+      else
114
+         _list_cmake_include "${includefile}" "${filename}" "${searchpath}"
115
+      fi
116
+   done
117
+   IFS="${DEFAULT_IFS}"
118
+}
119
+
120
+
121
+main()
122
+{
123
+   local filename="${1:-CMakeLists.txt}"
124
+
125
+   CMAKE_SEARCHPATH="${CMAKE_SEARCHPATH:-cmake:cmake/share:.}"
126
+
127
+   if [ ! -f "${filename}" ]
128
+   then
129
+      echo "\"${filename}\" not found" >&2
130
+      exit 1
131
+   fi
132
+
133
+   echo "digraph xxx {"
134
+   echo "   ordering=out"
135
+   echo "   rankdir=\"LR\""
136
+   echo "   node [ shape=\"note\" ]"
137
+   echo "   \"`pretty "${filename}"`\""
138
+
139
+   list_cmake_includes "${filename}" "${CMAKE_SEARCHPATH}"
140
+   echo "}"
141
+}
142
+
143
+
144
+DEFAULT_IFS="${IFS}"
145
+
146
+main "$@"
... ...
@@ -86,10 +86,16 @@ emit_common_directories()
86 86
 
87 87
    local collection
88 88
 
89
-   collection="`rexekutor sed -n -e 's|^[^;]*;\(.*\)/[^/]*\.h|\1|p' <<< "${items}" | sort -u`"
89
+   collection="`rexekutor sed -n -e 's|^[^;]*;\(.*\)/[^/]*\.h|\1|p' <<< "${items}" | LC_ALL=C sort -u`"
90 90
 
91 91
    if [ ! -z "${collection}" ]
92 92
    then
93
+      if [ "${PROJECT_SOURCE_DIR}" = "." ]
94
+      then
95
+         collection=".
96
+${collection}"
97
+      fi
98
+
93 99
       "${emitter}" "${parameter}" "${collection}"
94 100
    fi
95 101
 }
... ...
@@ -115,6 +121,7 @@ emit_by_category()
115 121
       # https://stackoverflow.com/questions/1773939/how-to-use-sed-to-return-something-from-first-line-which-matches-and-quit-early
116 122
       collectname="`sed -n -e '/\(^[^;]*\).*/{s//\1/p;q;}' <<< "${remainder}" `"
117 123
       collection="`egrep "^${collectname};" <<< "${remainder}" | cut -d ';' -f 2-`"
124
+
118 125
       "${emitter}" "${collectname}" "${collection}"
119 126
 
120 127
       remainder="`egrep -v "^${collectname};" <<< "${remainder}" `"
... ...
@@ -138,7 +145,8 @@ create_headers_file()
138 145
       ;;
139 146
 
140 147
       "NONE")
141
-         text_hdr2="# Header generation disabled by MULLE_SDE_CMAKE_HEADERS_FILE=NONE"
148
+         text_hdr="# Header generation disabled by MULLE_SDE_CMAKE_HEADERS_FILE=NONE"
149
+         MULLE_SDE_CMAKE_HEADERS_FILE=""
142 150
       ;;
143 151
 
144 152
       *)
... ...
@@ -158,12 +166,13 @@ create_headers_file()
158 166
 
159 167
          text_hdr="${text_hdr1}
160 168
 
161
-      ${text_hdr2}"
169
+${text_hdr2}"
162 170
 
163
-         MULLE_SDE_CMAKE_HEADERS_FILE="${MULLE_SDE_CMAKE_HEADERS_FILE:-cmake/_Headers.cmake}"
164 171
       ;;
165 172
    esac
166 173
 
174
+   MULLE_SDE_CMAKE_HEADERS_FILE="${MULLE_SDE_CMAKE_HEADERS_FILE:-cmake/_Headers.cmake}"
175
+
167 176
    text_hdr="# ${MULLE_SDE_CMAKE_HEADERS_FILE} is generated by \`mulle-sde\`. Edits will be lost.
168 177
 #
169 178
 if( MULLE_TRACE_INCLUDE)
... ...
@@ -197,7 +206,8 @@ create_sources_file()
197 206
       ;;
198 207
 
199 208
       "NONE")
200
-         text_hdr2="# Source generation disabled by MULLE_SDE_CMAKE_SOURCES_FILE=NONE"
209
+         text_src="# Source generation disabled by MULLE_SDE_CMAKE_SOURCES_FILE=NONE"
210
+         MULLE_SDE_CMAKE_SOURCES_FILE=""
201 211
       ;;
202 212
 
203 213
       *)
... ...
@@ -215,10 +225,10 @@ create_sources_file()
215 225
             text_src="message( ERROR \" No sources found. \`mulle-sde environment set MULLE_SDE_CMAKE_SOURCES_FILE NONE\`, if this is intentional\")"
216 226
          fi
217 227
 
218
-         MULLE_SDE_CMAKE_SOURCES_FILE="${MULLE_SDE_CMAKE_SOURCES_FILE:-cmake/_Sources.cmake}"
219 228
       ;;
220 229
    esac
221 230
 
231
+   MULLE_SDE_CMAKE_SOURCES_FILE="${MULLE_SDE_CMAKE_SOURCES_FILE:-cmake/_Sources.cmake}"
222 232
    text_src="# ${MULLE_SDE_CMAKE_SOURCES_FILE} is generated by \`mulle-sde\`. Edits will be lost.
223 233
 #
224 234
 if( MULLE_TRACE_INCLUDE)
... ...
@@ -259,6 +269,8 @@ main()
259 269
    local MULLE_TRACE_RESOLVER_FLIP_X="NO"
260 270
    local MULLE_TRACE_SETTINGS_FLIP_X="NO"
261 271
 
272
+   local OPTION_PARALLEL="YES"
273
+
262 274
    while [ $# -ne 0 ]
263 275
    do
264 276
       if options_technical_flags "$1"
... ...
@@ -272,13 +284,17 @@ main()
272 284
             usage
273 285
          ;;
274 286
 
287
+         --no-parallel)
288
+            OPTION_PARALLEL="NO"
289
+         ;;
290
+
275 291
          --version)
276 292
             echo "${CMAKE_SOURCE_UPDATE_VERSION}"
277 293
             return 0
278 294
          ;;
279 295
 
280 296
          -*)
281
-            usage "unknown option \"$1\""
297
+            usage "Unknown option \"$1\""
282 298
          ;;
283 299
 
284 300
          *)
... ...
@@ -307,7 +323,9 @@ main()
307 323
    #
308 324
    local categorized_files
309 325
 
310
-   if ! categorized_files="`exekutor "${MULLE_MATCH}" ${MULLE_MONITOR_FLAGS} \
326
+   if ! categorized_files="`exekutor "${MULLE_MATCH}" \
327
+                                 ${MULLE_TECHNICAL_FLAGS} \
328
+                                 ${MULLE_MATCH_FLAGS} \
311 329
                                  find --format "%C;%f\\n" \
312 330
                                       --match-filter "source"`"
313 331
    then
... ...
@@ -320,14 +338,20 @@ main()
320 338
       # exit 0 # but still create empty files, otherwise cmake is unhappy
321 339
    fi
322 340
 
323
-   categorized_files="`rexekutor sort -t';' -k 1,2 <<< "${categorized_files}" `"
324
-
325
-   create_headers_file "${categorized_files}" &
326
-   create_sources_file "${categorized_files}" &
341
+   categorized_files="`LC_ALL=C rexekutor sort -d -t';' -k 1,2 <<< "${categorized_files}" `"
327 342
 
328
-   log_verbose "waiting..."
329
-   wait
330
-   log_verbose 'done!'
343
+   if [ "${OPTION_PARALLEL}" = "YES" ]
344
+   then
345
+      create_headers_file "${categorized_files}" &
346
+      create_sources_file "${categorized_files}" &
347
+
348
+      log_fluff "waiting..."
349
+      wait
350
+      log_fluff 'done!'
351
+   else
352
+      create_headers_file "${categorized_files}"
353
+      create_sources_file "${categorized_files}"
354
+   fi
331 355
 }
332 356
 
333 357
 
... ...
@@ -59,19 +59,20 @@ uname_to_cmake()
59 59
 
60 60
    local uname="$1"
61 61
 
62
-   case "${uname}" in
63
-      darwin)
64
-         echo "APPLE"
65
-      ;;
62
+   local systemname
66 63
 
64
+   case "${uname}" in
67 65
       "")
68 66
          fail "uname is empty"
69 67
       ;;
70 68
 
71 69
       *)
72
-         tr 'a-z' 'A-Z' <<< "${uname}"
70
+         systemname="`tr 'a-z' 'A-Z' <<< "${uname:0:1}"`"
71
+         systemname="${systemname}${uname:1}"
73 72
       ;;
74 73
    esac
74
+
75
+   echo "\${CMAKE_SYSTEM_NAME} MATCHES \"${systemname}\""
75 76
 }
76 77
 
77 78
 
... ...
@@ -104,6 +105,8 @@ osexclude_to_cmake_if()
104 105
          ;;
105 106
       esac
106 107
    done
108
+
109
+
107 110
    IFS="${DEFAULT_IFS}"; set +o noglob
108 111
 
109 112
    if [ ! -z "${onlys}" ]
... ...
@@ -142,11 +145,9 @@ _emit_cmake_find_library()
142 145
    local libraries
143 146
    local i
144 147
 
145
-   IFS=","; shopt -s nullglob
148
+   IFS=","; set -o noglob
146 149
    for i in ${aliases}
147 150
    do
148
-      IFS="${DEFAULT_IFS}"; shopt -u nullglob
149
-
150 151
       case "${preference}" in
151 152
          "static")
152 153
             libraries="`concat "${libraries}" "\\\${CMAKE_STATIC_LIBRARY_PREFIX}${i}\\\${CMAKE_STATIC_LIBRARY_SUFFIX}"`"
... ...
@@ -160,7 +161,7 @@ _emit_cmake_find_library()
160 161
       # fallback to whatever linkage
161 162
       libraries="`concat "${libraries}" "${i}"`"
162 163
    done
163
-   IFS="${DEFAULT_IFS}"; shopt -u nullglob
164
+   IFS="${DEFAULT_IFS}"; set -o noglob
164 165
 
165 166
    local failstring
166 167
    local failstatus
... ...
@@ -178,6 +179,9 @@ _emit_cmake_find_library()
178 179
       ;;
179 180
    esac
180 181
 
182
+#
183
+# this is getting unwieldy, should probably use a function
184
+#
181 185
    cat <<EOF
182 186
 ${indent}if( NOT ${identifier}_LIBRARY)
183 187
 ${indent}   find_library( ${identifier}_LIBRARY NAMES ${libraries})
... ...
@@ -212,6 +216,35 @@ ${indent}            )
212 216
 ${indent}            break()
213 217
 ${indent}         endif()
214 218
 ${indent}      endforeach()
219
+EOF
220
+
221
+   #
222
+   # for objective-c we find objc-loader.inc in the public include files
223
+   #
224
+   case ",${marks}," in
225
+      *,no-all-load,*)
226
+      ;;
227
+
228
+      *)
229
+         cat <<EOF
230
+${indent}
231
+${indent}      # search for objc-loader.inc in include directory
232
+${indent}      foreach( _TMP_${identifier}_NAME in ${aliases})
233
+${indent}         set( _TMP_${identifier}_FILE "\${_TMP_${identifier}_ROOT}/include/\${_TMP_${identifier}_NAME}/objc-loader.inc")
234
+${indent}         if( EXISTS "\${_TMP_${identifier}_FILE}")
235
+${indent}            set( INHERITED_OBJC_LOADERS
236
+${indent}               \${INHERITED_OBJC_LOADERS}
237
+${indent}               \${_TMP_${identifier}_FILE}
238
+${indent}               CACHE INTERNAL "need to cache this"
239
+${indent}            )
240
+${indent}            break()
241
+${indent}         endif()
242
+${indent}      endforeach()
243
+EOF
244
+      ;;
245
+   esac
246
+
247
+   cat <<EOF
215 248
 ${indent}   else()
216 249
 ${indent}      message( ${failstatus} "${failstring}")
217 250
 ${indent}   endif()
... ...
@@ -251,13 +284,13 @@ _emit_cmake_header_only()
251 284
    local headers
252 285
    local i
253 286
 
254
-   IFS=","; shopt -s nullglob
287
+   IFS=","; set -o noglob
255 288
    for i in ${aliases}
256 289
    do
257 290
       headers="`concat "${headers}" "${i}.h"`"
258 291
       headers="`concat "${headers}" "${i}/${i}.h"`"
259 292
    done
260
-   IFS="${DEFAULT_IFS}"; shopt -u nullglob
293
+   IFS="${DEFAULT_IFS}"; set +o noglob
261 294
 
262 295
    case ",${marks}," in
263 296
       *,no-require-link,*)
... ...
@@ -363,7 +396,16 @@ emit_cmake_dependency()
363 396
 
364 397
    # first alias determines the identifier
365 398
    filename="`fast_basename "${aliases%%,*}"`"
366
-   identifier="` tr 'a-z-' 'A-Z_' <<< "${filename}" `"
399
+
400
+   if [ -z "${MULLE_CASE_SH}" ]
401
+   then
402
+      # shellcheck source=mulle-case.sh
403
+      . "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}/mulle-case.sh" || return 1
404
+   fi
405
+
406
+   identifier="`tweaked_de_camel_case "${filename}"`"
407
+   identifier="`printf "%s" "${identifier}" | tr -c 'a-zA-Z0-9' '_'`"
408
+   identifier="`tr 'a-z' 'A-Z' <<< "${identifier}"`"
367 409
 
368 410
    "${emitter}" "${aliases}" \
369 411
                 "${identifier}" \
... ...
@@ -385,9 +427,9 @@ emit_cmake_dependencies()
385 427
 {
386 428
    log_entry "emit_cmake_dependencies" "$@"
387 429
 
388
-   local dependencies="$1"
389
-   local emitter="$2"
390
-   local containername="$3"
430
+   local emitter="$1"
431
+   local containername="$2"
432
+   local dependencies="$3"
391 433
 
392 434
    local dependency
393 435
 
... ...
@@ -411,7 +453,7 @@ emit_cmake_dependencies()
411 453
 
412 454
       if [ ! -z "${address}" ]
413 455
       then
414
-         log_verbose "Emit statements for ${C_MAGENTA}${C_BOLD}${address}"
456
+         log_verbose "Emit cmake statements for ${C_MAGENTA}${C_BOLD}${address}"
415 457
          emit_cmake_dependency "${emitter}" \
416 458
                                "${containername}" \
417 459
                                "${address}" \
... ...
@@ -423,6 +465,72 @@ emit_cmake_dependencies()
423 465
 }
424 466
 
425 467
 
468
+emit_dependency_subproject()
469
+{
470
+   log_entry "emit_dependency_subproject" "$@"
471
+
472
+   local dependency
473
+   local header
474
+
475
+   header="`exekutor "${MULLE_SOURCETREE}" -V \
476
+                           ${MULLE_TECHNICAL_FLAGS} \
477
+                           ${MULLE_SOURCETREE_FLAGS} \
478
+                           list \
479
+                              --format '%a;%m;%i={aliases,,-------};%i={include,,}\n' \
480
+                              --marks 'dependency,header,no-link' \
481
+                              --output-raw \
482
+                              --no-output-header`" || return 1
483
+   emit_cmake_dependencies "_emit_cmake_header_only" \
484
+                           "HEADER_ONLY_LIBRARIES" \
485
+                           "${header}"
486
+
487
+   dependency="`exekutor "${MULLE_SOURCETREE}" -V \
488
+                           ${MULLE_TECHNICAL_FLAGS} \
489
+                           ${MULLE_SOURCETREE_FLAGS} \
490
+                           list \
491
+                              --format '%a;%m;%i={aliases,,};%i={include,,}\n' \
492
+                              --marks 'dependency,link' \
493
+                              --output-raw \
494
+                              --no-output-header`" || return 1
495
+
496
+   emit_cmake_dependencies "_emit_cmake_dependency" \
497
+                           "DEPENDENCY_LIBRARIES" \
498
+                           "${dependency}"
499
+}
500
+
501
+
502
+emit_library()
503
+{
504
+   log_entry "emit_library" "$@"
505
+
506
+   local library
507
+   local header
508
+
509
+   header="`exekutor "${MULLE_SDE}" \
510
+                        ${MULLE_TECHNICAL_FLAGS} \
511
+                        ${MULLE_SDE_FLAGS} \
512
+                        library list \
513
+                           --marks header,no-link \
514
+                           -- \
515
+                           --output-raw \
516
+                           --output-no-header`" || return 1
517
+   emit_cmake_dependencies "_emit_cmake_header_only" \
518
+                           "HEADER_ONLY_LIBRARIES" \
519
+                           "${header}"
520
+
521
+   library="`exekutor "${MULLE_SDE}" \
522
+                        ${MULLE_TECHNICAL_FLAGS} \
523
+                        ${MULLE_SDE_FLAGS} \
524
+                        library list \
525
+                           --marks link \
526
+                           -- \
527
+                           --output-raw \
528
+                           --output-no-header`" || return 1
529
+   emit_cmake_dependencies "_emit_cmake_library" \
530
+                           "OS_SPECIFIC_LIBRARIES" \
531
+                           "${library}"
532
+}
533
+
426 534
 #
427 535
 # collect library and dependency, with routines in
428 536
 # mulle-sde-updatesupport.sh for reuse with stuff other than cmake
... ...
@@ -439,32 +547,8 @@ write_libraries_file()
439 547
 
440 548
       text_lib="# library generation turned off by MULLE_SDE_LIBRARIES_FILE"
441 549
    else
442
-      local library
443
-      local header
444
-      local text_header
445
-
446
-      header="`exekutor "${MULLE_SDE}" ${MULLE_SDE_FLAGS} library list \
447
-                                                         --marks header,no-link \
448
-                                                         -- \
449
-                                                         --output-raw \
450
-                                                         --output-no-header`" || return 1
451
-      log_debug "header: ${header}"
452
-      text_header="`emit_cmake_dependencies "${header}" \
453
-                                            "_emit_cmake_header_only" \
454
-                                            "HEADER_ONLY_LIBRARIES"`"
455
-
456
-      library="`exekutor "${MULLE_SDE}" ${MULLE_SDE_FLAGS} library list \
457
-                                                         --marks link \
458
-                                                         -- \
459
-                                                         --output-raw \
460
-                                                         --output-no-header`" || return 1
461
-      log_debug "library: ${library}"
462
-      text_lib="`emit_cmake_dependencies "${library}" \
463
-                                         "_emit_cmake_library" \
464
-                                         "OS_SPECIFIC_LIBRARIES"`" || return 1
465
-
466
-      text_lib="`add_line "${text_header}" "${text_lib}"`"
467 550
       #
551
+      text_lib="`emit_library`" || return 1
468 552
       if [ -z "${text_lib}" ]
469 553
       then
470 554
          text_lib="# there are no libraries in the sourcetree"
... ...
@@ -499,35 +583,10 @@ write_dependencies_file()
499 583
       MULLE_SDE_DEPENDENCIES_FILE=""
500 584
       text_dep="# dependency generation turned off by MULLE_SDE_DEPENDENCIES_FILE"
501 585
    else
502
-      local dependency
503
-      local header
504
-      local text_header
505
-
506
-      header="`exekutor "${MULLE_SDE}" ${MULLE_SDE_FLAGS} dependency list \
507
-                                                        --marks header,no-link \
508
-                                                        -- \
509
-                                                        --output-raw \
510
-                                                        --no-output-header`" || return 1
511
-      log_debug "header: ${header}"
512
-
513
-      text_header="`emit_cmake_dependencies "${header}" \
514
-                                            "_emit_cmake_header_only" \
515
-                                            "HEADER_ONLY_LIBRARIES"`"
516
-
517
-      dependency="`exekutor "${MULLE_SDE}" ${MULLE_SDE_FLAGS} dependency list \
518
-                                                        --marks link \
519
-                                                        -- \
520
-                                                        --output-raw \
521
-                                                        --no-output-header`" || return 1
522
-      log_debug "header: ${header}"
523
-      text_dep="`emit_cmake_dependencies "${dependency}" \
524
-                                         "_emit_cmake_dependency" \
525
-                                         "DEPENDENCY_LIBRARIES"`"
526
-      text_dep="`add_line "${text_header}" "${text_dep}"`"
527
-
586
+      text_dep="`emit_dependency_subproject`"  || return 1
528 587
       if [ -z "${text_dep}" ]
529 588
       then
530
-         text_dep="# there are no linkable dependencies in the sourcetree"
589
+         text_dep="# there are no applicable dependencies in the sourcetree"
531 590
       fi
532 591
    fi
533 592
 
... ...
@@ -551,34 +610,6 @@ ${text_dep}"
551 610
 }
552 611
 
553 612
 
554
-# should get results from mulle-sde subprojects here
555
-run_update_on_subproject()
556
-{
557
-   log_entry "write_dependencies_file" "$@"
558
-
559
-   local text_dep
560
-
561
-   if [ -z  "${MULLE_SDE_SUBPROJECTS}" -o "${MULLE_SDE_SUBPROJECTS}" = "NONE" ]
562
-   then
563
-      return
564
-   fi
565
-
566
-   set -f; IFS=":"
567
-   for i in ${MULLE_SDE_SUBPROJECTS}
568
-   do
569
-      set +f; IFS="${DEFAULT_IFS}"
570
-
571
-      [ ! -d "${i}" ] && log_error "Subproject \"${i}\" does not exist"
572
-
573
-      (
574
-         MULLE_SDE="${MULLE_SDE}" \
575
-            "${MULLE_SDE}" --subproject "${i}" ${MULLE_SDE_FLAGS} update
576
-      )
577
-   done
578
-   set +f; IFS="${DEFAULT_IFS}"
579
-}
580
-
581
-
582 613
 main()
583 614
 {
584 615
    log_entry "main" "$@"
... ...
@@ -600,6 +631,8 @@ main()
600 631
    local MULLE_TRACE_RESOLVER_FLIP_X="NO"
601 632
    local MULLE_TRACE_SETTINGS_FLIP_X="NO"
602 633
 
634
+   local OPTION_PARALLEL="YES"
635
+
603 636
    while [ $# -ne 0 ]
604 637
    do
605 638
       if options_technical_flags "$1"
... ...
@@ -614,19 +647,23 @@ main()
614 647
          ;;
615 648
 
616 649
          -p|--projectname)
617
-            [ "$#" -eq 1 ] && usage "missing argument to \"$1\""
650
+            [ "$#" -eq 1 ] && usage "Missing argument to \"$1\""
618 651
             shift
619 652
 
620 653
             PROJECT_NAME="$1"
621 654
          ;;
622 655
 
656
+         --no-parallel)
657
+            OPTION_PARALLEL="NO"
658
+         ;;
659
+
623 660
          --version)
624 661
             echo "${CMAKE_SOURCETREE_UPDATE_VERSION}"
625 662
             return 0
626 663
          ;;
627 664
 
628 665
          -*)
629
-            usage "unknown option \"$1\""
666
+            usage "Unknown option \"$1\""
630 667
          ;;
631 668
 
632 669
          *)
... ...
@@ -640,14 +677,23 @@ main()
640 677
    MULLE_SDE="${MULLE_SDE:-`command -v mulle-sde`}"
641 678
    [ -z "${MULLE_SDE}" ] && fail "mulle-sde not in PATH"
642 679
 
680
+   MULLE_SOURCETREE="${MULLE_SOURCETREE:-`command -v mulle-sourcetree`}"
681
+   [ -z "${MULLE_SOURCETREE}" ] && fail "mulle-sourcetree not in PATH"
682
+
643 683
    options_setup_trace "${MULLE_TRACE}"
644 684
 
645
-   write_dependencies_file "${categorized_files}" &
646
-   write_libraries_file "${categorized_files}" &
685
+   if [ "${OPTION_PARALLEL}" = "YES" ]
686
+   then
687
+      write_dependencies_file "${categorized_files}" &
688
+      write_libraries_file "${categorized_files}" &
647 689
 
648
-   log_verbose "waiting..."
649
-   wait
650
-   log_verbose 'done!'
690
+      log_fluff "waiting..."
691
+      wait
692
+      log_fluff 'done!'
693
+   else
694
+      write_dependencies_file "${categorized_files}"
695
+      write_libraries_file "${categorized_files}"
696
+   fi
651 697
 }
652 698
 
653 699
 
... ...
@@ -43,7 +43,7 @@ emit_executable_motd()
43 43
 
44 44
    filepath="`filepath_concat "${builddir}" "${name}" `"
45 45
    printf "%b\n"  "${C_INFO}Run your executable:${C_RESET}"
46
-   printf "%b\n"  "${C_BOLD}   ${filepath}${C_RESET}"
46
+   printf "%b\n"  "${C_BOLD}   ${filepath#${MULLE_VIRTUAL_ROOT#/}}${C_RESET}"
47 47
 }
48 48
 
49 49
 
... ...
@@ -2,7 +2,7 @@ mulle-c/c-developer;meta
2 2
 mulle-c/c;runtime
3 3
 mulle-sde/c;runtime
4 4
 mulle-sde/sde;extra
5
-mulle-c/cmake;buildtool
5
+mulle-c/c-cmake;buildtool
6 6
 mulle-sde/c-cmake;buildtool
7 7
 mulle-sde/cmake;buildtool
8 8
 mulle-c/travis;extra
... ...
@@ -1 +1,2 @@
1
-src/_*dependencies.h
1
+_*-include.h
2
+_*-include-private.h
... ...
@@ -31,7 +31,9 @@
31 31
 #
32 32
 cmake_source_update_task_run()
33 33
 {
34
-   log_entry "cmake_source_update_task_run" "$@"
34
+   log_entry "mulle-sde/cmake::cmake_source_update_task_run" "$@"
35 35
 
36
-   exekutor cmake-source-update ${CMAKE_SOURCE_UPDATE_FLAGS}
36
+   log_info "Updating ${C_MAGENTA}${C_BOLD}${PROJECT_NAME}${C_INFO} source"
37
+
38
+   exekutor cmake-source-update ${CMAKE_SOURCE_UPDATE_FLAGS} "$@"
37 39
 }
... ...
@@ -36,8 +36,10 @@
36 36
 #
37 37
 cmake_sourcetree_update_task_run()
38 38
 {
39
-   log_entry "cmake_sourcetree_update_task_run" "$@"
39
+   log_entry "mulle-sde/cmake::cmake_sourcetree_update_task_run" "$@"
40 40
 
41
-   exekutor cmake-sourcetree-update  ${CMAKE_SOURCETREE_UPDATE_FLAGS} &&
42
-   exekutor c-sourcetree-update ${C_SOURCETREE_UPDATE_FLAGS}
41
+   log_info "Updating ${C_MAGENTA}${C_BOLD}${PROJECT_NAME}${C_INFO} sourcetree"
42
+
43
+   exekutor cmake-sourcetree-update ${CMAKE_SOURCETREE_UPDATE_FLAGS} "$@" &&
44
+   exekutor c-sourcetree-update ${C_SOURCETREE_UPDATE_FLAGS} "$@"
43 45
 }
... ...
@@ -1,3 +1,4 @@
1