forked from rayarachelian/lisaem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·944 lines (771 loc) · 38.6 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
#!/bin/bash
#!/usr/bin/env bash
#------------------------------------------------------------------------------------------#
# Standard block for each bashbuild script - these are used for copyright notices, packages
# this standard block ends around line 45
#------------------------------------------------------------------------------------------#
# ensure we're running from our directory and that we haven't been called from somewhere else
cd "$(dirname $0)"
[[ "$(basename $0)" != "build.sh" ]] && echo "$0 must be named build.sh" 1>&2 && exit 9
# As this is the top level script so we force remove any saved envs here before saving new
# ones, this next line can be optionally added/removed as needed.
find . -type f -name '.env-*' -exec rm -f {} \;
# Include and execute unified build library code - this part is critical
[[ -z "$TLD" ]] && export TLD="${PWD}"
# set the local top level directory for this build, as we go down into subdirs and run
# build, TLD will be the top, but XTLD will be the "local" build's TLD.
export XTLD="$( /bin/pwd )"
if [[ -x "${TLD}/bashbuild/src.build" ]]; then
is_bashbuild_loaded 2>/dev/null || source ${TLD}/bashbuild/src.build
else
echo "$PWD/$0 Cannot find $PWD/bashbuild/src.build" 1>&2
echo "This is required as it contains the shared code for the unified build system scripts." 1>&2
exit 1
fi
###########################################################################################
# if you're making your own package using the src.build system, you'll want to set
# these variables. These will help populate the appropriate fields in packages.
###########################################################################################
SOFTWARE="LisaEm" # name of the software (can contain upper case)
LCNAME="lisaem" # lower case name used for the directory
DESCRIPTION="The first fully functional Lisa Emulator™" # description of the package
VER="1.2.7" # just the version number
STABILITY="RC3a" # DEVELOP,ALPHA, BETA, RC1, RC2, RC3... RELEASE
RELEASEDATE="2020.08.24" # release date. must be YYYY.MM.DD
AUTHOR="Ray Arachelian" # name of the author
AUTHEMAIL="[email protected]" # email address for this software
COMPANY="Sunder.NET" # company (vendor for sun pkg)
CONAM="SUNDERNET" # company short name for Solaris pkgs
URL="http://lisaem.sunder.net" # url to website of package
COPYRIGHTYEAR="2020"
COPYRIGHTLINE="Copyright © ${COPYRIGHTYEAR} $AUTHOR, All Rights Reserved"
# ----------------------------------------------------------------------------------------
# vars auto built from the above.
VERSION="${VER}-${STABILITY}_${RELEASEDATE}"
BUILDDIR="${LCNAME}-${VER}" # this should match the base directory name
# copy the arguements given to us as they'll be used again when we make packages
BUILDARGS="$0 $@"
export VER STABILITY RELEASEDATE AUTHOR SOFTWARE LCNAME DESCRIPTION COMPANY CONAM URL VERSION BUILDDIR BUILDARGS
#------------------------------------------------------------------------------------------#
# end of standard section for all build scripts.
#------------------------------------------------------------------------------------------#
# you'll have to rewrite (or at least customize) the rest of this script in a similar manner for your own package
# ensure the sub-builds are executables
chmod 755 src/lib/libdc42/build.sh src/lib/libGenerator/build.sh src/tools/build.sh 2>/dev/null
#--------------------------------------------------------------------------------------------------------
# this was old way of version tracking, left here for historical reference as to release dates
#--------------------------------------------------------------------------------------------------------
#VERSION="1.2.7-RC3_2020.08.19"
#VERSION="1.2.7-RC2_2020.08.03"
#VERSION="1.2.7-RC1_2020.05.27"
#VERSION="1.2.7-BETA_2019.03.31"
#VERSION="1.2.7-BETA_2019.03.24"
#VERSION="1.2.7-BETA_2019.03.14"
#VERSION="1.2.7-BETA_2019.03.09"
#VERSION="1.2.7-BETA_2019.03.03"
#VERSION="1.2.7-BETA_2019.02.29"
#VERSION="1.2.7-BETA_2019.02.25"
#VERSION="1.2.7-BETA_2020.02.22"
#VERSION="1.2.7-ALPHA_2019.11.11"
#VERSION="1.2.7-ALPHA_2019.10.20"
#VERSION="1.2.7-ALPHA_2019.10.15"
#VERSION="1.2.7-ALPHA_2019.10.13"
#VERSION="1.2.7-ALPHA_2019.09.29"
#VERSION="1.2.6.1-RELEASE_2012.12.12"
##VERSION="1.3.0-DEVELOP_2010.05.12"##dead end
#VERSION="1.2.6-RELEASE_2007.12.12"
#VERSION="1.2.5-RELEASE_2007.11.25"
#VERSION="1.2.2-RELEASE_2007.11.11"
#VERSION="1.2.0-RELEASE_2007.09.23"
#VERSION="1.0.1-DEV_2007.08.13"
#VERSION="1.0.0-RELEASE_2007.07.07"
#VERSION="1.0.0-RC2_2007.06.27"
#--------------------------------------------------------------------------------------------------------
WITHDEBUG="" # -g for debugging, -p for profiling. -pg for both
LIBGENOPTS="" # passthrough to libGenerator
#STATIC=--static
WITHOPTIMIZE="-O2 -ffast-math -fomit-frame-pointer"
WITHUNICODE="--unicode=yes"
#if compiling for win32, edit WXDEV path to specify the
#location of wxDev-CPP 6.10 (as a cygwin, not windows path.)
#i.e. WXDEV=/cygdrive/c/wxDEV-Cpp
#if left empty, code below will try to locate it, so only set this
#if you've installed it in a different path than the default.
#WXDEV=""
#export DEBUGCOMPILE="yes"
function CLEAN() {
# note we expect to be inside src at this point, and we'll make our way out as needed.
echo "* Cleaning..." 1>&2
cd "${TLD}"
CLEANARTIFACTS "*.o" "*.a" "*.so" "*.dylib" "*.exe" get-uintX-types "cpu68k-?.c" def68k gen68k
subbuild src/lib/libGenerator --no-banner clean
subbuild src/lib/libdc42 --no-banner clean
subbuild src/tools --no-banner clean
rm -rf bin/LisaEm.app bin/lisaem bin/${MACOSX_MAJOR_VER}/*.dSYM # for macos x - this is a dir so CLEANARTIFACTS will not handle it properly
rm -f /tmp/slot.*.sh*
rm -f ./pkg/build/*; echo "Built packages go here" >pkg/build/README
cd "${TLD}/bin"; ln -sf ../bashbuild/interim-build.sh build.sh
if [[ -n "`which ccache 2>/dev/null`" ]]; then echo -n "* "; ccache -c; fi
}
function create_unvars_c {
echo Creating unvars.c
cat <<END1 >motherboard/unvars.c
/**************************************************************************************\\
* Apple Lisa 2 Emulator *
* *
* The Lisa Emulator Project $VERSION *
* Copyright (C) ${COPYRIGHTYEAR} $AUTHOR *
* All Rights Reserved *
* *
* Reset Global Variables .c file *
* *
* This is a stub file - actual variables are in vars.h. *
* (this is autogenerated by the build script. do not hand edit.) *
\**************************************************************************************/
#define IN_UNVARS_C 1
// include all the includes we'll (might) need (and want)
#include <vars.h>
#define REASSIGN( a , b , c ) {(b) = (c);}
void unvars(void)
{
#undef GLOBAL
#undef AGLOBAL
#undef ACGLOBAL
END1
egrep 'GLOBAL\(' ../include/vars.h | grep -v '*' | grep -v AGLOBAL | grep -v '#define' | grep -v FILE | grep -v get_exs | grep -v '\[' | sed 's/GLOBAL/REASSIGN/g' >>motherboard/unvars.c
echo "}" >> motherboard/unvars.c
cd ..
}
export COMPILEPHASE="preparing"
if [ -z "`echo $BUILDARGS | egrep -- '--quiet|--stfu'`" ]
then
image resources/lisaem-banner.png || (
echo
echo " +------------------+ Apple Lisa 2 Emulator -Unified Build Script"
echo " |+---------+ _____ | "
echo " || | _____ | LisaEm $VERSION"
echo " || | ---= | http://lisaem.sunder.net "
echo " |+---------+ . | The Lisa Emulator Project "
echo " +------------------+ Copyright (C) ${RELEASEDATE:0:4} ${AUTHOR}"
echo " /=______________#_=\\ All Rights Reserved "
echo " Released under the terms of the GNU GPL v2.0"
)
fi
CHECKDIRS bashbuild bin obj resources share src src/host src/include src/lib src/lisa src/printer \
src/storage src/tools src/lib/libGenerator src/lib/libdc42
# Parse command line options if any, overriding defaults.
for j in $@; do
opt=`echo "$j" | sed -e 's/without/no/g' -e 's/disable/no/g' -e 's/enable-//g' -e 's/with-//g'`
case "$opt" in
clean)
CLEAN
#if we said clean install or clean build, then do not quit, otherwise we clean and quit
Z="`echo $@ | grep -i install``echo $@ | grep -i build`"
if [[ -z "$Z" ]]; then
echo
echo -n "Done. "
elapsed=$(get_elapsed_time)
[[ -n "$elapsed" ]] && echo "$elapsed seconds" || echo
rm -f .env-*
exit 0
fi
;;
build*) echo ;; #default - nothing to do here, this is the default.
--prefix=*) export PREFIX="${i:9}" ;;
--pkg-prefix=*) export PKGPREFIX="${i:9}" ;;
install)
if [[ -z "$CYGWIN" ]]; then
[[ "`whoami`" != "root" ]] && echo "Need to be root to install. try: sudo ./build.sh $@" && exit 1
else
CygwinSudoRebuild $@
fi
export INSTALL=1
;;
package) if [[ -z "$DARWIN" ]]; then
echo "This is only implemented on macos x currently" 1>&2
exit 1
fi
export WITHPKG="yes"
;;
uninstall)
if [[ -n "$DARWIN" ]]; then
echo Uninstall commands not yet implemented.
exit 1
fi
if [[ -n "$CYGWIN" ]]; then
[[ -n "$PREFIX" ]] && echo Deleting $PREFIX && rm -rf $PREFIX
[[ -n "$PREFIXLIB" ]] && echo Deleting $PREFIXLIB && rm -rf $PREFIXLIB
exit 0
fi
#Linux, etc.
#PREFIX="/usr/local/bin"
#PREFIXLIB="/usr/local/share/"
echo Uninstalling from $PREFIX and $PREFIXLIB
rm -rf $PREFIXLIB/lisaem/
rm -f $PREFIX/lisaem
rm -f $PREFIX/lisafsh-tool
rm -f $PREFIX/lisadiskinfo
rm -f $PREFIX/patchxenix
exit 0
;;
-64|--64|-m64) export SIXTYFOURBITS="--64";
export THIRTYTWOBITS="";
export ARCH="-m64"; export SARCH="-m64" ;;
-32|--32|-m32) export SIXTYFOURBITS="";
export THIRTYTWOBITS="--32";
[[ "$MACHINE" == "x86_64" ]] && export MACHINE="i386"
export ARCH="-m32"; export SARCH="-m32" ;;
-march=*) export ARCH="${opt} $ARCH" ;;
-arch=*) export ARCH="$(echo ${opt} | sed -e 's/=/ /g') $ARCH"
export ARCHOVERRIDE="$(echo ${opt} | cut -d= -f2 )"
export SARCH="$opt $SARCH" ;;
--no-color-warn) export GCCCOLORIZED="" ;;
--no-tools) export NODC42TOOLS="yes" ;;
--no-debug)
export WITHDEBUG=""
export LIBGENOPTS="" ;;
--valgrind)
export GDB="$(which valgrind)"
if [[ -z "$GDB" ]]; then
echo "Could not find valgrind" 1>&2
exit 5
fi
export MEMTESTEROPTS="-v --show-error-list=yes --time-stamp=yes --leak-check=full --show-leak-kinds=all --track-origins=yes"
export WARNINGS="-Wall -Wextra -Wno-write-strings -g -DDEBUG"
export WITHOUTSTRIP="nostrip"
export WITHOUTUPX="noupx"
# disabled 1.3.0 core options
#LIBGENOPTS="$LIBGENOPTS --with-ipc-comments"
#LIBGENOPTS="$LIBGENOPTS --with-reg-ipc-comments"
#WITHDEBUG="$WITHDEBUG -g -DIPC_COMMENTS"
export LIBGENOPTS="$LIBGENOPTS --with-debug" ;;
-D*) export EXTRADEFINES="${EXTRADEFINES} ${opt}";;
--drmemory)
export GDB="$(which drmemory)"
if [[ -z "$(which drmemory)" ]]; then
echo "Could not find drmemory" 1>&2
exit 5
fi
#MEMTESTEROPTS="-results_to_stderr -show_reachable -summary -fuzz -- "
export MEMTESTEROPTS="-results_to_stderr -- "
export WARNINGS="-Wall -Wextra -Wno-write-strings -g -DDEBUG"
export WITHOUTSTRIP="nostrip"
export WITHOUTUPX="noupx"
# disabled 1.3.0 core options
#LIBGENOPTS="$LIBGENOPTS --with-ipc-comments"
#LIBGENOPTS="$LIBGENOPTS --with-reg-ipc-comments"
#WITHDEBUG="$WITHDEBUG -g -DIPC_COMMENTS"
export LIBGENOPTS="$LIBGENOPTS --with-debug" ;;
--debug|debuggery|bugger*)
export WARNINGS="-Wall -Wextra -Wno-write-strings -g -DDEBUG"
export WITHDEBUG="$WITHDEBUG -g -DDEBUG"
export WITHOUTSTRIP="nostrip"
export WITHOUTUPX="noupx"
export LIBGENOPTS="$LIBGENOPTS --with-debug"
export WITHOPTIMIZE="" ;;
# disabled 1.3.0 core options
#LIBGENOPTS="$LIBGENOPTS --with-ipc-comments"
#LIBGENOPTS="$LIBGENOPTS --with-reg-ipc-comments"
#WITHDEBUG="$WITHDEBUG -g -DIPC_COMMENTS"
--profile)
export WITHDEBUG="$WITHDEBUG -p"
export LIBGENOPTS="$LIBGENOPTS --with-profile" ;;
--static)
STATIC="-static" ;;
--no-static)
STATIC="" ;;
--debug*-on-start)
export LIBGENOPTS="$LIBGENOPTS --with-debug-on-start"
export WARNINGS="-Wall -Wextra -Wno-write-strings -g"
export WITHDEBUG="$WITHDEBUG -DDEBUGLOG_ON_START -DDEBUG"
export WITHOUTSTRIP="nostrip"
export WITHOUTUPX="noupx"
export WARNINGS="-Wall -Wno-write-strings"
#LIBGENOPTS="$LIBGENOPTS --with-ipc-comments"
#LIBGENOPTS="$LIBGENOPTS --with-reg-ipc-comments"
export LIBGENOPTS="$LIBGENOPTS --with-debug" ;;
--no-optimize)
export LIBGENOPTS="$LIBGENOPTS --without-optimize"
export WITHOPTIMIZE="" ;;
--trace*)
export WARNINGS="-Wall -Wextra -Wno-write-strings -g -DDEBUG -DTRACE"
export WITHOUTSTRIP="nostrip"
export WITHOUTUPX="noupx"
export LIBGENOPTS="$LIBGENOPTS --with-debug --with-tracelog"
export WITHDEBUG="$WITHDEBUG -g -DDEBUG -DTRACE"
export LIBGENOPTS="$LIBGENOPTS --with-debug"
export WITHOPTIMIZE="" ;;
#WITHDEBUG="$WITHDEBUG -g -DIPC_COMMENTS"
#WITHTRACE="-DDEBUG -DTRACE -DIPC_COMMENTS"
#LIBGENOPTS="$LIBGENOPTS --with-ipc-comments"
#LIBGENOPTS="$LIBGENOPTS --with-reg-ipc-comments"
#LIBGENOPTS="$LIBGENOPTS --with-ipc-comments"
#LIBGENOPTS="$LIBGENOPTS --with-reg-ipc-comments"
--showcmd) export DEBUGCOMPILE="yes" ;;
--debug-mem*|--mem*)
export WITHDEBUG="$WITHDEBUG -g -DIPC_COMMENTS"
export WITHTRACE="-DDEBUG -DTRACE -DDEBUGMEMCALLS"
export LIBGENOPTS="$LIBGENOPTS --with-tracelog"
export LIBGENOPTS="$LIBGENOPTS --with-debug-mem"
#LIBGENOPTS="$LIBGENOPTS --with-ipc-comments"
#LIBGENOPTS="$LIBGENOPTS --with-reg-ipc-comments"
export WARNINGS="-Wall -Wno-write-strings" ;;
--no-68kflag-opt*)
export LIBGENOPTS="$LIBGENOPTS --no-68kflag-optimize" ;;
--no-upx)
export WITHOUTUPX="noupx" ;;
--no-strip)
export WITHOUTSTRIP="nostrip" ;;
--rawbit*|--raw-bit*)
export WITHBLITS="-DUSE_RAW_BITMAP_ACCESS" ;;
--no-rawbit*|--no-raw-bit*)
export WITHBLITS="-DNO_RAW_BITMAP_ACCESS" ;;
--quiet*|--stfu|-q)
export QUIET="YES" ;;
*) UNKNOWNOPT="$UNKNOWNOPT $j" ;;
esac
done
LIBGENOPTS="$LIBGENOPTS"
if [[ -n "$UNKNOWNOPT" ]]; then
echo
echo "Unknown options $UNKNOWNOPT"
cat <<ENDHELP
Commands:
clean Removes all compiled objects, libs, executables
build Compiles lisaemm, libraries, and tools (default)
clean build Remove existing objects, compile everything cleanly
install Not yet implemented on all platforms
uninstall Not yet implemented on all platforms
package Build a package (Not yet implemented everywhere)
Options:
--without-debug Disables debug and profiling
--with-debug Enables symbol compilation
--with-tracelog Enable tracelog (needs debug on, not on win32)
--with-debug-mem Enables debug and tracelog and memory fn debugging
--with-debug-on-start Enable debug output as soon as libGenerator is invoked
--valgrind Same as debug but runs valgrind instead of gdb/lldb
--drmemory Same as debug but runs drmemory instead of gdb/lldb
--no-color-warn don't record color ESC codes in compiler warnings
--no-tools don't compile dc42 tool commands
--with-static Enables a static compile
--without-static Enables shared library compile (not recommended)
--without-optimize Disables optimizations
--without-upx Disables UPX compression (no upx on OS X)
--without-strip Disable strip when compiling without debug
-DFOO Pass extra defines to C/C++ compilers
-DFOO=BAR
--32|--64 Select 32 or 64 bit binaries (or -32|-m32|-64|-m64)
--arch={} Compile for specific architecture
i.e. x86_64, ppc, ppc64, arm64, etc...
but you should avoid -32|-64
Environment Variables you can pass:
CC Path to C Compiler
CPP Path to C++ Compiler
WXDEV Cygwin Path to wxDev-CPP 6.10 (win32 only)
PREFIX Installation directory
NUMCPUS override the number of CPUs - Set to 1 to only use 1
i.e. CC=/usr/local/bin/gcc ./build.sh ...
ENDHELP
exit 1
fi
# allow versions of LisaEm compiled under Linux, *BSD, etc. to run as compiled
# without being installed. (Some versions of wxWidgets look for the lowercase name, others, upper)
cd ${XTLD}/share || ( echo "Could not find ../share from $(/bin/pwd)" 1>&2; exit 1 )
ln -sf ../resources lisaem
cd ..
# source code lists for compilation as well as counting needed
export PHASE1INEXT=c PHASE1OUTEXT=o PHASE2OBJDIR=obj
export PHASE1LIST="\
src/lisa/io_board/floppy \
src/storage/profile \
src/lisa/motherboard/unvars \
src/lisa/motherboard/vars \
src/lisa/motherboard/glue \
src/lisa/motherboard/fliflo_queue \
src/lisa/io_board/cops \
src/lisa/io_board/zilog8530 \
src/lisa/io_board/via6522 \
src/lisa/cpu_board/irq \
src/lisa/cpu_board/mmu \
src/lisa/cpu_board/rom \
src/lisa/cpu_board/romless \
src/lisa/cpu_board/memory \
src/lisa/motherboard/symbols"
export PHASE2INEXT=cpp PHASE2OUTEXT=o PHASE2OBJDIR=obj
export PHASE2LIST="\
src/host/wxui/lisaem_wx:src/include/vars.h:src/host/wxui/include/LisaConfig.h:src/host/wxui/include/LisaConfigFrame.h:src/host/wxui/include/LisaSkin.h:./src/printer/imagewriter/include/imagewriter-wx.h \
src/host/wxui/LisaConfig:src/host/wxui/include/LisaConfig.h \
src/host/wxui/LisaConfigFrame:src/host/wxui/include/LisaConfigFrame.h \
src/host/wxui/LisaSkin:src/host/wxui/include/LisaSkin.h \
src/lisa/crt/hqx/hq3x-3x:src/lisa/crt/hqx/include/common.h:src/lisa/crt/hqx/include/hqx.h \
src/printer/imagewriter/imagewriter-wx:./src/printer/imagewriter/include/imagewriter-wx.h"
# change ^- hq3x vs hq3x-3x here as needed as well as the #define
[[ -n "${WITHDEBUG}${WITHTRACE}" ]] && if [[ -n "$INSTALL" ]];
then
echo "Warning, will not install since debug/profile/trace options are enabled"
echo "as Install command is only for production builds."
INSTALL=""
fi
if [[ -n "${WITHDEBUG}${WITHTRACE}" ]]
then
WITHOPTIMIZE="-ffast-math"
fi
cd ./src || exit 1
if needed include/vars.h lisa/motherboard/unvars.c
then
cd ./lisa || exit 1
create_unvars_c
fi
if [[ -n "$DARWIN" ]]; then
LISANAME="LisaEm"
# may need to test which versions this works with, etc.
WITHBLITS="-DUSE_RAW_BITMAP_ACCESS"
else
LISANAME="lisaem${EXT}"
fi
# Has the configuration changed since last time? if so we may need to do a clean build. -----------------------------------
[[ -f "${TLD}/.last-opts" ]] && source "${TLD}/.last-opts"
needclean=0
#debug and tracelog changes affect the whole project, so need to clean it all
[[ "$WITHTRACE" != "$LASTTRACE" ]] && needclean=1 #&& echo "Clean Needed: LASTRACE Changed" 1>&2
[[ "$WITHDEBUG" != "$LASTDEBUG" ]] && needclean=1 #&& echo "Clean Needed: WITHDEBUG Changed" 1>&2
[[ "$SIXTYFOURBITS" != "$LASTSIXTYFOURBITS" ]] && needclean=1 #&& echo "Clean Needed: SIXTYFOURBITS Changed :$SIXTYFOURBITS: :$LASTSITYFOURBITS:" 1>&2
[[ "$THIRTYTWOITS" != "$LASTTHIRTYTWOBITS" ]] && needclean=1 #&& echo "Clean Needed: THIRTYTWOBITS Changed" 1>&2
[[ "$LASTWHICHWXCONFIG" != "$WHICHWXCONFIG" ]] && needclean=1 #&& echo "Clean Needed: WHICHWXCONFIG Changed" 1>&2
[[ "$LASTARCH" != "$ARCH" ]] && needclean=1 #&& echo "Clean Needed: ARCH Changed" 1>&2
# display mode changes affect only the main executable, mark it for recomoilation
if [[ "$WITHBLITS" != "$LASTBLITS" ]]; then
# rm -rf ./lisa/lisaem_wx.o ./lisa/lisaem ./lisa/lisaem.exe ./lisa/LisaEm.app;
touch host/wxui/lisaem_wx.cpp
fi
cat > "${TLD}/.last-opts" <<ENDLAST
LASTTRACE="$WITHTRACE"
LASTDEBUG="$WITHDEBUG"
LASTBLITS="$WITHBLITS"
LASTTHIRTYTWOBITS="$THIRTYTWOBITS"
LASTSIXTYFOURBITS="$SIXTYFOURBITS"
LASTWHICHWXCONFIG="$WHICHWXCONFIG"
LASTARCH="$ARCH"
ENDLAST
[[ "$needclean" -gt 0 ]] && CLEAN
export CFLAGS="$CFLAGS $NOWARNFORMATTRUNC $NOUNKNOWNWARNING $EXTRADEFINES"
export CPPFLAGS="$CPPFLAGS $NODEPRECATEDCPY $NOWARNFORMATTRUNC $NOUNKNOWNWARNING $EXTRADEFINES"
export CXXFLAGS="$CXXFLAGS $NODEPRECATEDCPY $NOWARNFORMATTRUNC $NOUNKNOWNWARNING $EXTRADEFINES"
#2020.01.14 - ^ GCC 9.2.1 throws these on wxWidgets includes, which I'm not going to fix.
#--------------------------------------------------------------------------------------------------------------------------
# estimate how many compile passes we need. if upx is enabled, which takes a very long time, multiply it by some factor
# since upx uses a single core
ESTLIBGENCOUNT=$( subestimate src/lib/libGenerator --no-banner $LIBGENOPTS $SIXTYFOURBITS $THIRTYTWOBITS )
ESTLIBDC42COUNT=$( subestimate src/lib/libdc42 --no-banner $SIXTYFOURBITS $THIRTYTWOBITS )
[[ -z "$NODC42TOOLS" ]] && ESTTOOLSCOUNT=$( subestimate src/tools --no-banner $SIXTYFOURBITS $THIRTYTWOBITS ) || ESTTOOLSCOUNT=0
ESTPHASE1COUNT=$( INEXT=${PHASE1INEXT} OUTEXT=${PHASE1OUTEXT} OBJDIR=${PHASE2OBJDIR} VERB=Compiling COUNTNEEDED ${PHASE1LIST} )
ESTPHASE2COUNT=$( INEXT=${PHASE2INEXT} OUTEXT=${PHASE2OUTEXT} OBJDIR=${PHASE2OBJDIR} VERB=Compiling COUNTNEEDED ${PHASE2LIST} )
# multiply estimates when using UPX as UPX is very slow
if [[ -z "$WITHOUTUPX" ]] && [[ -n "$UPXCMD" ]]; then
ESTTOOLSCOUNT=$(( $ESTTOOLSCOUNT * 10 ));
ESTPHASE2COUNT=$(( $ESTPHASE2COUNT * 5 ));
fi
ESTIMATETOTALS=$(( $ESTLIBGENCOUNT + $ESTLIBDC42COUNT + $ESTTOOLSCOUNT + $ESTPHASE1COUNT + $ESTPHASE2COUNT + 5 ))
ESTLIBGENCOUNT=$(( $ESTLIBGENCOUNT * 100 / $ESTIMATETOTALS ))
ESTLIBDC42COUNT=$(( $ESTLIBDC42COUNT * 100 / $ESTIMATETOTALS ))
ESTTOOLSCOUNT=$(( $ESTTOOLSCOUNT * 100 / $ESTIMATETOTALS ))
ESTPHASE1COUNT=$(( $ESTPHASE1COUNT * 100 / $ESTIMATETOTALS ))
ESTPHASE2COUNT=$(( $ESTPHASE2COUNT * 100 / $ESTIMATETOTALS ))
#(echo "Estimates:"
#echo "libgen: $ESTLIBGENCOUNT"
#echo "libdc42: $ESTLIBDC42COUNT"
#echo "tools: $ESTTOOLSCOUNT"
#echo "Phase1: $ESTPHASE1COUNT"
#echo "Phase2: $ESTPHASE2COUNT"
#) 1>&2
#read x
#---------------------------------------------------------------------------------------------------------------------------
echo "* Building prerequisites..."
echo
create_builtby
create_machine_h
cd "${TLD}/src"
if [[ -f include/machine.h ]]; then
ln -sf include/machine.h tools/include/machine.h
ln -sf include/machine.h lib/libGenerator/include/machine.h
ln -sf include/machine.h lib/libdc42/include/machine.h
else
echo "machine.h failed to create $(pwd)" 1>&2
exit 1
fi
cd ${TLD}
# Build libraries and tools using subbuild
export PERCENTPROGRESS=0 PERCENTCEILING=${ESTLIBGENCOUNT}
if [[ $ESTLIBGENCOUNT -gt 0 ]]; then
export COMPILEPHASE="libGenerator"
export PERCENTJOB=0 REUSESAVE=""
subbuild src/lib/libGenerator --no-banner $LIBGENOPTS $SIXTYFOURBITS $THIRTYTWOBITS $EXTRADEFINES $SARCH skipinstall
unset LIST
fi
export PERCENTPROGRESS=${PERCENTCEILING}
export PERCENTCEILING=$(( $PERCENTPROGRESS + $ESTLIBGENCOUNT ))
if [[ $ESTLIBDC42COUNT -gt 0 ]]; then
export COMPILEPHASE="libdc42"
export PERCENTJOB=0 REUSESAVE="yes"
subbuild src/lib/libdc42 --no-banner $SIXTYFOURBITS $THIRTYTWOBITS $EXTRADEFINES $SARCH skipinstall
unset LIST
fi
export PERCENTPROGRESS=${PERCENTCEILING}
export PERCENTCEILING=$(( $PERCENTPROGRESS + $ESTTOOLSCOUNT ))
if [[ $ESTTOOLSCOUNT -gt 0 ]]; then
export COMPILEPHASE="tools"
export REUSESAVE="yes"
subbuild src/tools --no-banner $SIXTYFOURBITS $THIRTYTWOBITS $SARCH $EXTRADEFINES
unset LIST
fi
echo "* Building LisaEm..."
echo
echo "* LisaEm C Code (./lisa)"
# Compile C
export COMPILEPHASE="C code"
export PERCENTPROGRESS=${PERCENTCEILING}
export PERCENTCEILING=$(( $PERCENTPROGRESS + $ESTPHASE1COUNT ))
export PERCENTJOB=0 NUMJOBSINPHASE=15
export COMPILECOMMAND="$CC -W $WARNINGS -Wstrict-prototypes -Wno-format -Wno-unused $WITHDEBUG $WITHTRACE $CFLAGS $ARCH $INC -c :INFILE:.c -o :OUTFILE:.o"
LIST1=$(WAIT="" INEXT=${PHASE1INEXT} OUTEXT=${PHASE1OUTEXT} OBJDIR=${PHASE2OBJDIR} VERB=Compiled COMPILELIST ${PHASE1LIST} )
if [[ $(echo "$PHASE1LIST" | wc -w ) -ne $(echo "$LIST1" | wc -w ) ]]; then
echo "Stopping due to failure..." 1>&2
exit 12
fi
cd ${TLD}/src/host || (echo "Couldn't cd into host from $(/bin/pwd)" 1>&2; exit 1)
export WINDOWS_RES_ICONS=$( printf 'lisa2icon ICON "lisa2icon.ico"\r\n')
# used to have these too, but now switched to skins and PNGs, can use printf if we want to add such things
# to print multiple lines into that var.
#//floppy0 BITMAP "floppy0.bmp"
#//floppy1 BITMAP "floppy1.bmp"
#//floppy2 BITMAP "floppy2.bmp"
#//floppy3 BITMAP "floppy3.bmp"
#//floppyN BITMAP "floppyN.bmp"
#//lisaface0 BITMAP "lisaface0.bmp"
#//lisaface1 BITMAP "lisaface1.bmp"
#//lisaface2 BITMAP "lisaface2.bmp"
#//lisaface3 BITMAP "lisaface3.bmp"
#//power_off BITMAP "power_off.bmp"
#//power_on BITMAP "power_on.bmp"
printf ' \r' # eat twirly cursor, since we're not waitqing
if needed lisaem_static_resources.cpp ${TLD}/obj/lisaem_static_resources.o; then
qjob "!! Compiled lisaem_static_resources.cpp " $CXX $ARCH $CXXFLAGS $ARCH -c lisaem_static_resources.cpp -o ${TLD}/obj/lisaem_static_resources.o 1>&2
waitqall
fi
printf ' \r'
#echo "LIST:$LIST" >/tmp/slot.list.0
LIST="$LIST ${TLD}/obj/lisaem_static_resources.o $(windres)"
#echo "LIST:$LIST" >/tmp/slot.list.1
# ^^ this also creates the windows resource via the windres function for Windows only. windres fn must be empty elsewhere
# note the $(windres) is executing that function call
rm -f lisaem lisaem.exe
#vars.c must be linked in before any C++ source code or else there will be linking conflicts!
echo
printf ' \r'
echo "* wxWidgets C++ Code (./wxui)"
# save WARNINGS settings, add C++ extra warnings
OWARNINGS="$WARNINGS"
export WARNINGS="$WARNINGS -Weffc++ $NOIGNOREDQUALIFIERS $NODEPRECATED"
# Compile C++
cd "${TLD}"
export COMPILEPHASE="C++ code"
export PERCENTPROGRESS=${PERCENTCEILING}
export PERCENTCEILING=$(( $PERCENTPROGRESS + $ESTPHASE1COUNT ))
export PERCENTJOB=0 NUMJOBSINPHASE=6
CXXFLAGS="$CXXFLAGS -I src/include -I resources"
export COMPILECOMMAND="$CXX -W -Wno-write-strings $WARNINGS $WITHDEBUG $WITHTRACE $WITHBLITS $INC $CXXFLAGS $ARCH -c :INFILE:.cpp -o :OUTFILE:.o "
LIST=$( WAIT="yes" INEXT=${PHASE2INEXT} OUTEXT=${PHASE2OUTEXT} OBJDIR=${PHASE2OBJDIR} VERB=Compiled COMPILELIST ${PHASE2LIST} )
waitqall
#echo "LIST:$LIST" >/tmp/slot.list.2
# restore warnings
[ -n "$OWARNINGS" ] && WARNINGS="$OWARNINGS"
for i in `echo $LIST`; do WXLIST="$WXLIST `echo $i|grep -v lisaem_wx`"; done
echo
echo '---------------------------------------------------------------' >> $BUILDWARNINGS
waitqall
cd "${TLD}"
(
echo "PHASE1LIST: $PHASE1LIST"
echo "PHASE2LIST: $PHASE2LIST"
echo "LIST: $LIST"
echo "LIST1: $LIST1"
echo "WXLIST: $WXLIST"
) >/tmp/slot.lists.txt
if [[ $(echo "$PHASE2LIST" | wc -w ) -ne $(echo "$LIST" | wc -w ) ]]; then
echo "Stopping due to failure..." 1>&2
exit 12
fi
export COMPILEPHASE="linking"
export PERCENTPROCESS=98 PERCENTCEILING=99 PERCENTJOB=0 NUMJOBSINPHASE=1
update_progress_bar $PERCENTPROCESS $PERCENTJOB $NUMJOBSINPHASE $PERCENTCEILING
waitqall
qjob "!!* Linked ./bin/${LISANAME}" $CXX $ARCH $GUIAPP $GCCSTATIC $WITHTRACE $WITHDEBUG -o bin/$LISANAME $LIST1 $LIST src/lib/libGenerator/lib/libGenerator.a \
src/lib/libdc42/lib/libdc42.a $LINKOPTS $SYSLIBS $LIBS
waitqall
export COMPILEPHASE="pack/install"
export PERCENTPROCESS=98 PERCENTCEILING=100 PERCENTJOB=0 NUMJOBSINPHASE=1
update_progress_bar $PERCENTPROCESS $PERCENTJOB $NUMJOBSINPHASE $PERCENTCEILING
cd "${TLD}/bin"
if [[ -f "$LISANAME" ]]; then
strip_and_compress "${LISANAME}"
#.
#└── Contents ${TLD}/bin/LisaEm.app/Contents
# ├── Info.plist
# ├── MacOS ${TLD}/bin/LisaEm.app/Contents/MacOS
# │ └── LisaEm
# ├── PkgInfo
# └── Resources ${TLD}/bin/LisaEm.app/Contents/Resources
# └── skins
# └── default
# ├── default.conf
# ├── floppy0.png
# ├── floppy1.png
if [[ -n "$DARWIN" ]]; then
echo "* Creating macos application" 1>&2
# replace machine type if we overode it
if [[ -n "$ARCHOVERRIDE" ]]; then
export BINARYEXTENSION="-${ARCHOVERRIDE}-${OSMAJOR}.${OSMIDDLE}"
fi
CONTENTS="${TLD}/bin/LisaEm.app/Contents/"
RESOURCES="${TLD}/bin/LisaEm.app/Contents/Resources"
BIN="${TLD}/bin/LisaEm.app/Contents/MacOS"
PLISTSRC="${TLD}/resources/Info.plist"
ICONSRC="${TLD}/resources/LisaEm.icns"
mkdir -pm775 "${BIN}" "${RESOURCES}"
cp "${TLD}/resources/lisaem.sh" "${BIN}/lisaem.sh" || exit $?
chmod 755 "${BIN}/lisaem.sh" || exit $?
mv "${TLD}/bin/${LISANAME}" "${BIN}/lisaem${BINARYEXTENSION}-wx${WXVERSION}" || exit $?
sed -e "s/_VERSION_/$VERSION/g" \
-e "s/_MINMACOS_/$MACOSX_MAJOR_VER/g" < "${PLISTSRC}"> "${CONTENTS}/Info.plist" || exit $?
echo -n 'APPL????' > "${CONTENTS}/PkgInfo" || exit $?
cp "${ICONSRC}" "${RESOURCES}" || exit $?
(cd "${TLD}/resources";tar cpf - skins) | (cd "${RESOURCES}"; tar xpf - )
x=$?
if [[ "$x" -ne 0 ]]; then
echo "Failed to copy ${TLD}/resources/skins to ${RESOURCES}" 1>&2
exit $x
fi
(cd "${RESOURCES}"; rm -f resources; ln -sf . resources 2>/dev/null ) # fix cross-os path issue with a lame ass link.
LISANAME="${BIN}/lisaem${BINARYEXTENSION}-wx${WXVERSION}"
if [[ -n "$WITHDEBUG" ]]; then
echo "run -p" >gdb-run
echo "Launching debugger:"
[[ -n "$( echo $GDB | grep gdb )" ]] && $GDB -x gdb-run "$LISANAME"
[[ -n "$( echo $GDB | grep lldb )" ]] && $GDB -o "run -p" -f "$LISANAME"
fi
#if we turned on profiling, process the results
if [[ -n "$(echo $WITHDEBUG | grep p >/dev/null 2>/dev/null)" ]];then
$GPROF "${LISANAME}" >lisaem-gprof-out
echo lisaem-gprof-out created.
fi
if [[ -n "$INSTALL" ]]; then
echo "* Installing LisaEm.app" 1>&2
(cd "${TLD}/bin"; tar cf - ./LisaEm.app ) | (cd "$PREFIX"; tar xf -)
x=$?
if [[ "$x" -ne 0 ]]; then
echo "Failed to copy ${TLD}/bin/LisaEm.app to ${PREFIX}" 1>&2
exit $x
fi
echo "* Done Installing." 1>&2
elapsed=$(get_elapsed_time)
[[ -n "$elapsed" ]] && echo "$elapsed seconds" || echo
exit 0
fi
# :TODO: move this to tools build.sh + create fn for pkgbuild productbuild.
if [[ -n "$WITHPKG" ]]; then
cd "${TLD}/bin/${MACOSX_MAJOR_VER}/" || exit $?
mkdir -pm755 ./pkg/usr/local/bin || exit $?
chmod 755 pkg/usr/local pkg/usr || exit $? # fix inner dir perms
[[ -n "$ARCHOVERRIDE" ]] && MACHINE="$ARCHOVERRIDE"
TOOLLIST="patchxenix blu-to-dc42 dc42-resize-to-400k dc42-dumper lisadiskinfo lisafsh-tool dc42-copy-boot-loader lisa-serial-info los-bozo-on los-deserialize idefile-to-dc42 rraw-to-dc42"
mv ${TOOLLIST} "${TLD}/bin/${MACOSX_MAJOR_VER}/pkg/usr/local/bin/" || exit $?
pkgbuild --root pkg --install-location / \
--identifier net.sunder.lisaem-cli-tools --version "${VER}" \
../../pkg/lisaem-cli-tools-${VER}-${STABILITY}-${RELEASEDATE}-macos-${MACOSX_MAJOR_VER}-${MACHINE}.pkg 1>&2 || exit $?
mkdir -pm755 ./pkg/Applications || exit $?
mv ../LisaEm.app ./pkg/Applications || exit $?
pkgbuild --root pkg --install-location / \
--identifier net.sunder.lisaem --version "${VER}" \
../../pkg/lisaem-${VER}-${STABILITY}-${RELEASEDATE}-macos-${MACOSX_MAJOR_VER}-${MACHINE}.pkg 1>&2 || exit $?
# put things back and clean up
mv pkg/usr/local/bin/* "${TLD}/bin/${MACOSX_MAJOR_VER}/"
mv pkg/Applications/* "${TLD}/bin"
rmdir ${TLD}/bin/${MACOSX_MAJOR_VER}/pkg/usr/local/bin ${TLD}/bin/${MACOSX_MAJOR_VER}/pkg/usr/local \
${TLD}/bin/${MACOSX_MAJOR_VER}/pkg/usr ${TLD}/bin/${MACOSX_MAJOR_VER}/pkg/Applications \
${TLD}/bin/${MACOSX_MAJOR_VER}/pkg
fi
echo "Done." 1>&2
exit 0
fi
echo
####
if [[ -z "$WITHDEBUG" ]]; then
## Install ###################################################
if [[ -n "$INSTALL" ]]; then
if [[ -n "$CYGWIN" ]]; then
#PREFIX ="/cygdrive/c/Program Files/Sunder.NET/LisaEm"
#PREFIXLIB="/cygdrive/c/Program Files/Sunder.NET/LisaEm"
echo "* Installing skins in $PREFIXLIB/LisaEm"
mkdir -pm755 "$PREFIX"
(cd "${TLD}/resources"; tar cpf - skins) | (cd "$PREFIX"; tar xpf - )
echo "* Installing lisaem.exe binary in $PREFIX/lisaem"
cp "${TLD}/bin/lisaem.exe" "$PREFIX"
echo -n " Done Installing."
elapsed=$(get_elapsed_time)
[[ -n "$elapsed" ]] && echo "$elapsed seconds" || echo
exit 0
else
# PREFIX="/usr/local/bin"
PREFIXLIB="/usr/local/share"
echo "* Installing resources in $PREFIXLIB/lisaem" 1>&2
mkdir -pm755 $PREFIXLIB/LisaEm/ $PREFIX
cp ../resources/*.wav ../resources/*.png "$PREFIXLIB/lisaem/"
echo "* Installing lisaem binary in $PREFIX/lisaem" 1>&2
cp lisaem "$PREFIX"
echo -n " Done Installing." 1>&2
elapsed=$(get_elapsed_time)
[[ -n "$elapsed" ]] && echo "$elapsed seconds" 1>&2 || echo 1>&2
exit 0
fi
fi # end of INSTALL
##########################################################
else
elapsed=$(get_elapsed_time)
[[ -n "$elapsed" ]] && echo "$elapsed seconds" || echo
if [[ -z "$CYGWIN" ]]; then
cd ../bin
echo "run -p" >gdb-run
if [[ -n "$(echo $GDB | grep valgrind)" ]]; then
echo "* Note: $GDB output will be appended to ${BUILDWARNINGS}" 1>&2
echo "Running: $GDB $MEMTESTEROPTS ./lisaem 2>&1 | tee -a ${BUILDWARNINGS} from `pwd`" 1>&2
if [[ -n "$MEMTESTEROPTS" ]]; then $GDB $MEMTESTEROPTS ./lisaem -p 2>&1 | tee -a "${BUILDWARNINGS}"
else $GDB -x gdb-run ./lisaem 2>&1 | tee -a "${BUILDWARNINGS}"
fi
else
$GDB ./lisaem -x gdb-run
exit $?
fi
else
cp lisaem.exe "/cygdrive/c/Program Files/Sunder.NET/LisaEm" || exit 1
cd ../resources
tar cpf - skins | ( cd "/cygdrive/c/Program Files/Sunder.NET/LisaEm"; tar xpf - )
cd "/cygdrive/c/Program Files/Sunder.NET/LisaEm" || exit 1
echo "run -p" >gdb-run
$GDB ./lisaem.exe -x gdb-run
exit $?
fi
if [[ -n "$(echo -- $WITHDEBUG | grep p)" ]]; then
[[ -n "$CYGWIN" ]] && $GPROF lisaem.exe >obj/lisaem-gprof-out.txt
[[ -z "$CYGWIN" ]] && $GPROF lisaem >obj/lisaem-gprof-out.txt
echo "Profiling output written to lisaem-gprof-out.txt" 1>&2
exit 0
fi
fi
fi
if egrep -i 'warn:|error:' $BUILDWARNINGS >/dev/null 2>/dev/null; then
echo "Compiler warnings/errors were saved to: $BUILDWARNINGS" 1>&2
fi
elapsed=$(get_elapsed_time)
[[ -n "$elapsed" ]] && echo "$elapsed seconds" || echo
# As this is the top level script, it's allowed to exit. subbuilds may not!
exit 0