-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
1773 lines (1462 loc) · 48.2 KB
/
Makefile
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
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Makefile
# This file is part of Solo Forth
# http://programandala.net/en.program.solo_forth.html
# Last modified: 20230406T0811+0200.
# See change log at the end of the file.
# ==============================================================
# Author {{{1
# Marcos Cruz (programandala.net), 2015, 2016, 2017, 2018, 2020, 2021, 2023.
# ==============================================================
# License {{{1
# You may do whatever you want with this work, so long as you
# retain every copyright, credit and authorship notice, and this
# license. There is no warranty.
# ==============================================================
# Requirements {{{1
# Asciidoctor (by Dan Allen, Sarah White et al.)
# http://asciidoctor.org
# Asciidoctor EPUB3 (by Dan Allen and Sarah White)
# (>v0.5.0.alpha.15)
# http://github.com/asciidoctor/asciidoctor-epub3
# Asciidoctor PDF (by Dan Allen and Sarah White)
# http://github.com/asciidoctor/asciidoctor-pdf
# bin2code (by Metalbrain)
# http://metalbrain.speccy.org/link-eng.htm
# cat (by Torbjorn Granlund and Richard M. Stallman)
# Part of GNU Coreutils
# http://gnu.org/software/coreutils
# dbtoepub
# http://docbook.sourceforge.net/release/xsl/current/epub/README
# dd
# Part of GNU Coreutils
# http://gnu.org/software/coreutils
# DOSBox (by The DOSBox Team)
# http://www.dosbox.com
# Forth Foundation Library (by Dick van Oudheusden)
# http://irdvo.github.io/ffl/
# fsb2 (by Marcos Cruz)
# http://programandala.net/en.program.fsb2.html
# Gforth (by Anton Erlt, Bernd Paysan et al.)
# http://gnu.org/software/gforth
# Glosara (by Marcos Cruz)
# http://programandala.net/en.program.glosara.html
# head (by David MacKenzie and Jim Meyering)
# Part of GNU Coreutils
# http://gnu.org/software/coreutils
# mkmgt (by Marcos Cruz)
# http://programandala.net/en.program.mkmgt.html
# Pandoc (by John MaFarlane)
# http://pandoc.org
# sort (by Mike Haertel and Paul Eggert)
# Part of GNU Coreutils
# http://gnu.org/software/coreutils
# tap2dsk (by John Elliott)
# Part of taptools
# http://www.seasip.info/ZX/unix.html
# zmakebas (by Russell Marks)
# Usually included in Linux distros. Also see:
# http://sourceforge.net/p/emuscriptoria/code/HEAD/tree/desprot/ZMakeBas.c
# https://github.com/catseye/zmakebas
# http://zmakebas.sourcearchive.com/documentation/1.2-1/zmakebas_8c-source.html
# zx7 (by Einar Saukas)
# http://www.worldofspectrum.org/infoseekid.cgi?id=0027996
# ==============================================================
# Config {{{1
VPATH = ./
MAKEFLAGS = --no-print-directory
#.ONESHELL:
book=solo_forth
title="Solo Forth"
lang="en"
editor="Marcos Cruz"
publisher="programandala.net"
description="Solo Forth user manual"
cover=$(book)_cover
cover_author="Marcos Cruz\n(programandala.net)"
cover_title="Solo Forth"
cover_gplusdos_subtitle="Version $(full_version) for G+DOS"
cover_plus3dos_subtitle="Version $(full_version) for +3DOS"
cover_trdos_subtitle="Version $(full_version) for TR-DOS"
# ==============================================================
# Metadata {{{1
full_version=$(shell gforth -e 's" ../src/version.z80s" 3' make/version_number.fs)
release=$(shell gforth -e 's" ../src/version.z80s" 2' make/version_number.fs)
# ==============================================================
# Disk images {{{1
gplusdos_disks=\
disks/gplusdos/disk_0_boot.mgt \
disks/gplusdos/disk_1_library.mgt \
disks/gplusdos/disk_2_programs.mgt \
disks/gplusdos/disk_3_workbench.mgt
plus3dos_disks=\
disks/plus3dos/disk_0_boot.dsk \
disks/plus3dos/disk_1_library.dsk \
disks/plus3dos/disk_2_programs.dsk \
disks/plus3dos/disk_3_workbench.dsk
trdos_block_disks=\
disks/trdos/disk_1a_library.trd \
disks/trdos/disk_1b_library.trd \
disks/trdos/disk_2_programs.trd \
disks/trdos/disk_3_workbench.trd
trdos_128_boot_disk=\
disks/trdos/disk_0_boot.128.trd
trdos_pentagon_boot_disks=\
disks/trdos/disk_0_boot.pentagon_512.trd \
disks/trdos/disk_0_boot.pentagon_1024.trd
trdos_scorpion_boot_disk=\
disks/trdos/disk_0_boot.scorpion_zs_256.trd
trdos_disks=\
$(trdos_block_disks) \
$(trdos_128_boot_disk) \
$(trdos_pentagon_boot_disks) \
$(trdos_scorpion_boot_disk)
# ==============================================================
# Interface {{{1
.PHONY: all
all: gplusdos trdos plus3dos
.PHONY: gplusdos
gplusdos: gplusdosdisks
.PHONY: gplusdosdisks
gplusdosdisks: $(gplusdos_disks)
.PHONY: plus3dos
plus3dos: plus3dosdisks
.PHONY: plus3dosdisks
plus3dosdisks: $(plus3dos_disks)
.PHONY: trdos
trdos: trdosdisks
.PHONY: trdosdisks
trdosdisks: \
trdos128 \
pentagon \
scorpion
.PHONY: trdosblockdisks
trdosblockdisks: $(trdos_block_disks)
.PHONY: t128
t128: trdos128
.PHONY: trdos128
trdos128: \
$(trdos_128_boot_disk) \
$(trdos_block_disks)
.PHONY: pentagon
pentagon: \
$(trdos_pentagon_boot_disks) \
$(trdos_block_disks)
.PHONY: scorpion
scorpion: \
$(trdos_scorpion_boot_disk) \
$(trdos_block_disks)
.PHONY: disk_9
disk_9: \
disks/gplusdos/disk_9_library_without_dos.mgt \
disks/plu3sdos/disk_9_library_without_dos.dsk \
disks/trdos/disk_9_library_without_dos.trd
# XXX REMARK -- disk_9 is a special disk image used for
# debugging. It contains the core library except the DOS
# modules. This means disk_9 contains exactly the same blocks in
# all DOS implementations. This is useful to check if disk
# access works fine when a new DOS is implemented, comparing
# the output of `blks` (a debug tool, temporarily included in
# the kernel).
.PHONY: clean
clean: cleantmp cleandisks cleandoc cleancover
.PHONY: cleandisks
cleandisks: cleangplusdosdisks cleanplus3dosdisks cleantrdosdisks
.PHONY: cleangplusdosdisks
cleangplusdosdisks:
rm -f disks/gplusdos/*.mgt
.PHONY: cleanplus3dosdisks
cleanplus3dosdisks:
rm -f disks/plus3dos/*.dsk
.PHONY: cleantrdosdisks
cleantrdosdisks:
rm -f disks/trdos/*.trd
.PHONY: cleantmp
cleantmp:
rm -f tmp/*
.PHONY: cleandoc
cleandoc:
rm -f doc/* tmp/doc.*
.PHONY: doc
doc: gplusdosdoc plus3dosdoc trdosdoc
.PHONY: gplusdosdoc
gplusdosdoc: gplusdosepub gplusdoshtml gplusdospdf
.PHONY: plus3dosdoc
plus3dosdoc: plus3dosepub plus3doshtml plus3dospdf
.PHONY: trdosdoc
trdosdoc: trdosepub trdoshtml trdospdf
.PHONY: dbk
dbk: gplusdosdbk plus3dosdbk trdosdbk
.PHONY: gplusdosdbk
gplusdosdbk: \
doc/gplusdos_solo_forth_manual.dbk
.PHONY: plus3dosdbk
plus3dosdbk: \
doc/plus3dos_solo_forth_manual.dbk
.PHONY: trdosdbk
trdosdbk: \
doc/trdos_solo_forth_manual.dbk
.PHONY: epub
epub: gplusdosepub plus3dosepub trdosepub
.PHONY: epuba
epuba: gplusdosepuba plus3dosepuba trdosepuba
.PHONY: gplusdosepub
gplusdosepub: gplusdosepuba gplusdosepubd
.PHONY: gplusdosepuba
gplusdosepuba: \
doc/gplusdos_solo_forth_manual.epub
.PHONY: gplusdosepubd
gplusdosepubd: \
doc/gplusdos_solo_forth_manual.dbk.dbtoepub.epub
.PHONY: gplusdosepubp
gplusdosepubp: \
doc/gplusdos_solo_forth_manual.dbk.pandoc.epub
.PHONY: plus3dosepub
plus3dosepub: plus3dosepuba plus3dosepubd
.PHONY: plus3dosepuba
plus3dosepuba: \
doc/plus3dos_solo_forth_manual.epub
.PHONY: plus3dosepubd
plus3dosepubd: \
doc/plus3dos_solo_forth_manual.dbk.dbtoepub.epub
.PHONY: plus3dosepubp
plus3dosepubp: \
doc/plus3dos_solo_forth_manual.dbk.pandoc.epub
.PHONY: trdosepub
trdosepub: trdosepuba trdosepubd
.PHONY: trdosepuba
trdosepuba: \
doc/trdos_solo_forth_manual.epub
.PHONY: trdosepubd
trdosepubd: \
doc/trdos_solo_forth_manual.dbk.dbtoepub.epub
.PHONY: trdosepubp
trdosepubp: \
doc/trdos_solo_forth_manual.dbk.pandoc.epub
.PHONY: html
html: gplusdoshtml plus3doshtml trdoshtml
.PHONY: gplusdoshtml
gplusdoshtml: gplusdoshtmla
.PHONY: gplusdoshtmla
gplusdoshtmla: \
doc/gplusdos_solo_forth_manual.html.gz
.PHONY: gplusdoshtmlp
gplusdoshtmlp: \
doc/gplusdos_solo_forth_manual.dbk.pandoc.html.gz
.PHONY: plus3doshtml
plus3doshtml: plus3doshtmla
.PHONY: plus3doshtmla
plus3doshtmla: \
doc/plus3dos_solo_forth_manual.html.gz
.PHONY: plus3doshtmlp
plus3doshtmlp: \
doc/plus3dos_solo_forth_manual.dbk.pandoc.html.gz
.PHONY: trdoshtml
trdoshtml: trdoshtmla
.PHONY: trdoshtmla
trdoshtmla: \
doc/trdos_solo_forth_manual.html.gz
.PHONY: trdoshtmlp
trdoshtmlp: \
doc/trdos_solo_forth_manual.dbk.pandoc.html.gz
.PHONY: md
md: gplusdosmd plus3dosmd trdosmd
.PHONY: gplusdosmd
gplusdosmd: \
doc/gplusdos_solo_forth_manual.md
.PHONY: plus3dosmd
plus3dosmd: \
doc/plus3dos_solo_forth_manual.md
.PHONY: trdosmd
trdosmd: \
doc/trdos_solo_forth_manual.md
.PHONY: odt
odt: gplusdosodt plus3dosodt trdosodt
.PHONY: gplusdosodt
gplusdosodt: \
doc/gplusdos_solo_forth_manual.dbk.pandoc.odt
.PHONY: plus3dosodt
plus3dosodt: \
doc/plus3dos_solo_forth_manual.dbk.pandoc.odt
.PHONY: trdosodt
trdosodt: \
doc/trdos_solo_forth_manual.dbk.pandoc.odt
.PHONY: pdf
pdf: gplusdospdf plus3dospdf trdospdf
.PHONY: gplusdospdf
gplusdospdf: \
doc/gplusdos_solo_forth_manual.pdf.gz
.PHONY: plus3dospdf
plus3dospdf: \
doc/plus3dos_solo_forth_manual.pdf.gz
.PHONY: trdospdf
trdospdf: \
doc/trdos_solo_forth_manual.pdf.gz
# -------------------------------------
.PHONY: covers
covers: gplusdoscover plus3doscover trdoscover
.PHONY: gplusdoscover
gplusdoscover: doc/gplusdos_$(cover).jpg
.PHONY: plus3doscover
plus3doscover: doc/plus3dos_$(cover).jpg
.PHONY: trdoscover
trdoscover: doc/trdos_$(cover).jpg
.PHONY: thumbs
thumbs: \
doc/gplusdos_$(cover)_thumb.jpg \
doc/plus3dos_$(cover)_thumb.jpg \
doc/trdos_$(cover)_thumb.jpg
.PHONY: cleancover
cleancover:
rm -f doc/*_cover*.jpg tmp/*.png
# ==============================================================
# Debug {{{1
# .PHONY: try
# ==============================================================
# Kernel {{{1
include Makefile.pasmo
# ==============================================================
# Loader {{{1
# The BASIC loader of the system is coded in plain text. The addresses
# that depend on the kernel (its load address and entry points) are
# represented in the source by labels. A Forth program replaces the
# labels with the actual values, extracted from the symbols file
# created by the assembler. Then zmakebas converts the patched loader
# into a TAP file, ready to be copied to a disk image.
# ----------------------------------------------
# G+DOS loader {{{2
tmp/loader.gplusdos.bas: \
tmp/kernel.symbols.gplusdos.z80s \
src/loader/gplusdos.bas \
src/kernel.z80s
gforth make/patch_the_loader.fs $@ $^
tmp/loader.gplusdos.bas.tap: tmp/loader.gplusdos.bas
zmakebas -n Autoload -a 1 -o $@ $<
# ----------------------------------------------
# +3DOS loader {{{2
tmp/loader.plus3dos.bas: \
tmp/kernel.symbols.plus3dos.z80s \
src/loader/plus3dos.bas \
src/kernel.z80s
gforth make/patch_the_loader.fs $@ $^
tmp/loader.plus3dos.bas.tap: tmp/loader.plus3dos.bas
zmakebas -n DISK -a 1 -o $@ $<
# ----------------------------------------------
# TR-DOS loader {{{2
tmp/loader.trdos.bas: \
tmp/kernel.symbols.trdos.z80s \
src/loader/trdos.bas \
src/kernel.z80s
gforth make/patch_the_loader.fs $@ $^
tmp/loader.trdos.bas.tap: \
tmp/loader.trdos.bas
zmakebas -n boot -a 1 -o $@ $<
# ==============================================================
# Addons {{{1
# These addons (font drivers) are not part of the Solo Forth
# library yet. Meanwhile, their binary files are included in
# the boot disk.
# XXX WARNING -- 2016-03-19. bin2code returns error 97 when one
# of the filenames has a path, but it creates the tap file as
# usual. A hyphen at the beginning of the target forces
# `make` to ignore the error.
tmp/pr42.tap: bin/addons/pr42.bin
cd bin/addons/ ; \
bin2code pr42.bin pr42.tap 63610 ; \
cd - ; \
mv bin/addons/pr42.tap tmp/pr42.tap
# ==============================================================
# Fonts {{{1
# Note: The DSK disk image needs the fzx files to be packed
# into TAP first.
fzx_fonts = $(wildcard bin/fonts/*.fzx)
tmp/fzx_fonts.tap : $(fzx_fonts)
cd bin/fonts ; \
for file in $(notdir $(fzx_fonts)); do \
bin2code $$file $$file.tap; \
done; \
cd -
cat $(addsuffix .tap,$(fzx_fonts)) > $@ ; \
rm -f $(addsuffix .tap, $(fzx_fonts))
f64_fonts = $(wildcard bin/fonts/*.f64)
tmp/f64_fonts.tap : $(f64_fonts)
cd bin/fonts ; \
for file in $(notdir $(f64_fonts)); do \
bin2code $$file $$file.tap; \
done; \
cd -
cat $(addsuffix .tap,$(f64_fonts)) > $@ ; \
rm -f $(addsuffix .tap, $(f64_fonts))
# ==============================================================
# Compressed test screen {{{1
# A ZX Spectrum screen compressed with ZX7 is included in the
# boot disk, in order to try the ZX7 decompressor.
tmp/img.tap: bin/test/img.zx7
cd bin/test/ ; \
bin2code img.zx7 img.tap 16384 ; \
cd - ; \
mv bin/test/img.tap tmp/img.tap
# ==============================================================
# Boot disk {{{1
# ----------------------------------------------
# G+DOS boot disk {{{2
disks/gplusdos/disk_0_boot.mgt: \
tmp/loader.gplusdos.bas.tap \
tmp/kernel.gplusdos.bin.tap \
tmp/pr42.tap \
bin/fonts/ea5a.f42.tap \
tmp/f64_fonts.tap \
tmp/fzx_fonts.tap \
tmp/img.tap
mkmgt $@ bin/dos/gplusdos-sys-2a.tap $^
# ----------------------------------------------
# +3DOS boot disk {{{2
tmp/disk_0_boot.plus3dos.tap: \
tmp/loader.plus3dos.bas.tap \
tmp/kernel.plus3dos.bin.tap \
tmp/pr42.tap \
bin/fonts/ea5a.f42.tap \
tmp/f64_fonts.tap \
tmp/fzx_fonts.tap \
tmp/img.tap
cat $^ > $@
disks/plus3dos/disk_0_boot.dsk: tmp/disk_0_boot.plus3dos.tap
tap2dsk -720 -label SoloForth $< $@
# ----------------------------------------------
# TR-DOS boot disk {{{2
tmp/disk_0_boot.trdos.tap: \
tmp/loader.trdos.bas.tap \
tmp/kernel.trdos.bin.tap \
tmp/pr42.tap \
bin/fonts/ea5a.f42.tap \
tmp/f64_fonts.tap \
tmp/fzx_fonts.tap \
tmp/img.tap
cat $^ > $@
disks/trdos/disk_0_boot.128.trd: tmp/disk_0_boot.trdos.tap
cd tmp && ln -sf $(notdir $<) TRDOS-D0.TAP && cd -
rm -f $@
ln -f make/emptytrd.exe make/writetrd.exe tmp/
cd tmp && \
echo "EMPTYTRD.EXE SoloFth0.TRD" > mktrd.bat && \
echo "WRITETRD.EXE SoloFth0.TRD TRDOS-D0.TAP" >> mktrd.bat && \
dosbox -exit mktrd.bat && \
cd -
mv tmp/SOLOFTH0.TRD $@
# ----------------------------------------------
# TR-DOS boot disk for Scorpion ZS 256 {{{2
tmp/disk_0_boot.trdos.scorpion_zs_256.tap: \
tmp/loader.trdos.bas.tap \
tmp/kernel.trdos.scorpion_zs_256.bin.tap \
tmp/pr42.tap \
bin/fonts/ea5a.f42.tap \
tmp/f64_fonts.tap \
tmp/fzx_fonts.tap
cat $^ > $@
disks/trdos/disk_0_boot.scorpion_zs_256.trd: tmp/disk_0_boot.trdos.scorpion_zs_256.tap
cd tmp && ln -sf $(notdir $<) TRDOS-D0.TAP && cd -
rm -f $@
ln -f make/emptytrd.exe make/writetrd.exe tmp/
cd tmp && \
echo "EMPTYTRD.EXE SoloFth0.TRD" > mktrd.bat && \
echo "WRITETRD.EXE SoloFth0.TRD TRDOS-D0.TAP" >> mktrd.bat && \
dosbox -exit mktrd.bat && \
cd -
mv tmp/SOLOFTH0.TRD $@
# ----------------------------------------------
# TR-DOS boot disk for Pentagon 512 {{{2
tmp/disk_0_boot.trdos.pentagon_512.tap: \
tmp/loader.trdos.bas.tap \
tmp/kernel.trdos.pentagon_512.bin.tap \
tmp/pr42.tap \
bin/fonts/ea5a.f42.tap \
tmp/f64_fonts.tap \
tmp/fzx_fonts.tap
cat $^ > $@
disks/trdos/disk_0_boot.pentagon_512.trd: tmp/disk_0_boot.trdos.pentagon_512.tap
cd tmp && ln -sf $(notdir $<) TRDOS-D0.TAP && cd -
rm -f $@
ln -f make/emptytrd.exe make/writetrd.exe tmp/
cd tmp && \
echo "EMPTYTRD.EXE SoloFth0.TRD" > mktrd.bat && \
echo "WRITETRD.EXE SoloFth0.TRD TRDOS-D0.TAP" >> mktrd.bat && \
dosbox -exit mktrd.bat && \
cd -
mv tmp/SOLOFTH0.TRD $@
# ----------------------------------------------
# TR-DOS boot disk for Pentagon 1024 {{{2
tmp/disk_0_boot.trdos.pentagon_1024.tap: \
tmp/loader.trdos.bas.tap \
tmp/kernel.trdos.pentagon_1024.bin.tap \
tmp/pr42.tap \
bin/fonts/ea5a.f42.tap \
tmp/f64_fonts.tap \
tmp/fzx_fonts.tap
cat $^ > $@
disks/trdos/disk_0_boot.pentagon_1024.trd: tmp/disk_0_boot.trdos.pentagon_1024.tap
cd tmp && ln -sf $(notdir $<) TRDOS-D0.TAP && cd -
rm -f $@
ln -f make/emptytrd.exe make/writetrd.exe tmp/
cd tmp && \
echo "EMPTYTRD.EXE SoloFth0.TRD" > mktrd.bat && \
echo "WRITETRD.EXE SoloFth0.TRD TRDOS-D0.TAP" >> mktrd.bat && \
dosbox -exit mktrd.bat && \
cd -
mv tmp/SOLOFTH0.TRD $@
# ==============================================================
# Source file lists {{{1
#not_ready = src/lib/meta.test.forth2012-test-suite.fs
not_ready =
lib_files = $(sort $(wildcard src/lib/*.fs))
dos_lib_files = $(sort $(wildcard src/lib/dos.*.fs))
editor_prog_lib_files = $(sort $(wildcard src/lib/prog.editor.*.fs))
app_prog_lib_files = $(sort $(wildcard src/lib/prog.app.*.fs))
prog_lib_files = $(sort $(wildcard src/lib/prog.*.fs))
exception_codes_lib_files = $(sort $(wildcard src/lib/exception.codes.*.fs))
meta_lib_files = $(filter-out $(not_ready),$(sort $(wildcard src/lib/meta.*.fs)))
# XXX OLD:
meta_benchmark_lib_files = $(filter-out $(not_ready),$(sort $(wildcard src/lib/meta.benchmark.*.fs)))
meta_benchmark_misc_lib_files = src/lib/meta.benchmark.MISC.fs
meta_benchmark_rng_lib_files = src/lib/meta.benchmark.rng.fs
meta_benchmark_flow_lib_files = src/lib/meta.benchmark.flow.fs
meta_test_lib_files = $(filter-out $(not_ready),$(sort $(wildcard src/lib/meta.test*.fs)))
core_lib_files = \
$(filter-out \
$(not_ready) $(prog_lib_files) $(meta_lib_files), \
$(lib_files))
no_dos_core_lib_files = \
$(filter-out $(dos_lib_files), $(core_lib_files))
gplusdos_core_lib_files = \
$(filter-out %idedos.fs %plus3dos.fs %trdos.fs, $(core_lib_files))
plus3dos_core_lib_files = \
$(filter-out %gplusdos.fs %idedos.fs %trdos.fs, $(core_lib_files))
trdos_core_lib_files = \
$(filter-out %gplusdos.fs %idedos.fs %plus3dos.fs, $(core_lib_files))
gplusdos_exception_codes_lib_files = \
$(filter-out %idedos.fs %plus3dos.fs %trdos.fs , $(exception_codes_lib_files))
plus3dos_exception_codes_lib_files = \
$(filter-out %gplusdos.fs %idedos.fs %trdos.fs, $(exception_codes_lib_files))
trdos_exception_codes_lib_files = \
$(filter-out %gplusdos.fs %idedos.fs %plus3dos.fs, $(exception_codes_lib_files))
# ==============================================================
# Block files {{{1
# XXX UNDER DEVELOPMENT
# Copying the whole library to a disk image, as one single
# file, is not possible with ordinary tools, which are written
# to manipulate only the ordinary filetypes that can be stored
# on a ZX Spectrum tape.
#
# Therefore, this first approach can not work:
%.fb: %.fs
fsb2 $<
library_block_file=solo.fb
tmp/library.gplusdos.tap: tmp/library.gplusdos.fb
cd tmp/; \
ln -f $(notdir $<) $(library_block_file);\
bin2code $(library_block_file) $(library_block_file).tap 0;\
mv $(library_block_file).tap $(notdir $@);\
cd -;
tmp/library.trdos.tap: tmp/library.trdos.fb
cd tmp/; \
ln -f $(notdir $<) $(library_block_file);\
bin2code $(library_block_file) $(library_block_file).tap 0;\
mv $(library_block_file).tap $(notdir $@);\
cd -;
tmp/library.plus3dos.tap: tmp/library.plus3dos.fb
cd tmp/; \
ln -sf $(notdir $<) $(library_block_file);\
bin2code $(library_block_file) $(library_block_file).tap 0;\
mv $(library_block_file).tap $(notdir $@);\
cd -;
# ==============================================================
# Block disks {{{1
# The block disks contain the source blocks of the library and
# additional code.
tmp/library_without_dos.fs: $(no_dos_core_lib_files)
cat $^ > $@
tmp/workbench.fs: $(meta_lib_files)
cat $^ > $@
tmp/programs.fs: $(prog_lib_files)
cat $^ > $@
# ----------------------------------------------
# G+DOS block disks {{{2
# ------------------------------
# Library disk {{{3
tmp/library.gplusdos.fs: $(gplusdos_core_lib_files)
cat $(gplusdos_core_lib_files) > $@
disks/gplusdos/disk_1_library.mgt: tmp/library.gplusdos.fs
fsb2-mgt $< ;\
mv $(basename $<).mgt $@
# ------------------------------
# Additional disks {{{3
disks/gplusdos/disk_2_programs.mgt: tmp/programs.fs
fsb2-mgt $< ;\
mv $(basename $<).mgt $@
disks/gplusdos/disk_3_workbench.mgt: tmp/workbench.fs
fsb2-mgt $< ;\
mv $(basename $<).mgt $@
# ----------------------------------------------
# +3DOS block disks {{{2
# ------------------------------
# Library disk {{{3
tmp/library.plus3dos.fs: $(plus3dos_core_lib_files)
cat $(plus3dos_core_lib_files) > $@
disks/plus3dos/disk_1_library.dsk: tmp/library.plus3dos.fs
fsb2-dsk tmp/library.plus3dos.fs ;\
mv $(basename $<).dsk $@
# ------------------------------
# Additional disks {{{3
disks/plus3dos/disk_2_programs.dsk: tmp/programs.fs
fsb2-dsk $< ;\
mv $(basename $<).dsk $@
disks/plus3dos/disk_3_workbench.dsk: tmp/workbench.fs
fsb2-dsk $< ;\
mv $(basename $<).dsk $@
# ----------------------------------------------
# TR-DOS block disks {{{2
# ------------------------------
# Library disks {{{3
tmp/library.trdos.fs: $(trdos_core_lib_files)
cat $(trdos_core_lib_files) > $@
tmp/library.trdos.fb: tmp/library.trdos.fs
fsb2 $<
tmp/library_a.trdos.fb: tmp/library.trdos.fb
dd if=$< of=$@ bs=1K count=636
tmp/library_b.trdos.fb: tmp/library.trdos.fb
dd if=$< of=$@ bs=1K count=636 skip=636
tmp/library_a.trdos.fs: tmp/library_a.trdos.fb
dd if=$< of=$@ bs=1K cbs=64 conv=unblock
tmp/library_b.trdos.fs: tmp/library_b.trdos.fb
dd if=$< of=$@ bs=1K cbs=64 conv=unblock
disks/trdos/disk_1a_library.trd: tmp/library_a.trdos.fs
fsb2-trd $< SoloF1a ; \
mv $(basename $<).trd $@
disks/trdos/disk_1b_library.trd: tmp/library_b.trdos.fs
fsb2-trd $< SoloF1b ; \
mv $(basename $<).trd $@
# ------------------------------
# Additional disks {{{3
disks/trdos/disk_2_programs.trd: tmp/programs.fs
fsb2-trd $< SoloFth2 ; \
mv $(basename $<).trd $@
disks/trdos/disk_3_workbench.trd: tmp/workbench.fs
fsb2-trd $< SoloFth3 ; \
mv $(basename $<).trd $@
# ==============================================================
# Background images {{{1
# Starting from version 0.12.0, Solo Forth shows a background
# image every time it boots.
# First, create a link to the Netpbm image selected for the current
# version of Solo Forth:
backgrounds/current.pbm: src/version.z80s
version=$(shell gforth -e 's" ../$<" 0' make/version_number.fs) ; \
cd backgrounds ; \
cp -f v$${version}.pbm $(notdir $@) ; \
cd ..
# ln -f v$${version}.pbm $(notdir $@) ; \
# Second, convert it to a SCR format file (which will be included in
# the assembled binary of the system):
backgrounds/current.scr: backgrounds/current.pbm
make/pbm2scr.fs $<
# ==============================================================
# Documentation {{{1
# ----------------------------------------------
# Common rules {{{2
%.zip: %
zip -9 $@ $<
%.gz: %
gzip -9 --force --keep $<
%.html: %.adoc
asciidoctor --out-file=$@ $<
%.glossary.adoc: %.files.txt
glosara --level=4 --sections --input=$< > $@
tmp/doc.README.linked.adoc: README.adoc
glosara --annex $< > $@
tmp/doc.manual_skeleton.linked.adoc: \
src/doc/manual_skeleton.adoc \
tmp/doc.README.linked.adoc
glosara --annex $< > $@
tmp/doc.%.linked.adoc: src/doc/%.adoc
glosara --annex $< > $@
%doc.gplusdos.manual.dbk: %doc.gplusdos.manual.adoc
asciidoctor \
--backend=docbook \
--attribute=gplusdos \
--attribute=doslabel=gplusdos \
--attribute=dosname=G+DOS \
--attribute=version=$(full_version) \
--out-file=$@ $<
%doc.plus3dos.manual.dbk: %doc.plus3dos.manual.adoc
asciidoctor \
--backend=docbook \
--attribute=plus3dos \
--attribute=doslabel=plus3dos \
--attribute=dosname=+3DOS \
--attribute=version=$(full_version) \
--out-file=$@ $<
%doc.trdos.manual.dbk: %doc.trdos.manual.adoc
asciidoctor \
--backend=docbook \
--attribute=trdos \
--attribute=doslabel=trdos \
--attribute=dosname=TR-DOS \
--attribute=version=$(full_version) \
--out-file=$@ $<
%.dbk.dbtoepub.epub: %.dbk
dbtoepub -o $@ $<
# XXX REMARK -- Pandoc is not used anymore to create an EPUB, because the
# internal links don't work:
%.dbk.pandoc.epub: %.dbk
pandoc \
--from docbook \
--to epub \
--epub-chapter-level=3 \
--output=$@ $<
# XXX REMARK -- Pandoc is not used anymore to create an HTML, because the
# glossary links don't work:
%.dbk.pandoc.html: %.dbk
pandoc \
--from docbook \
--to html \
--output=$@ $<
%.dbk.pandoc.odt: %.dbk
pandoc \
--from docbook \
--to odt \
--output=$@ $<
# XXX REMARK -- 2020-04-05: This PDF is not build by default anymore, because
# the links don't work:
%.html.pandoc.pdf: %.html
pandoc \
--from html \
--to pdf \
--pdf-engine=wkhtmltopdf \
--output=$@ $<
# ----------------------------------------------
# Documentation for G+DOS {{{2
doc/gplusdos_solo_forth_manual.epub: \
tmp/doc.gplusdos.manual.adoc \
README.adoc \
doc/gplusdos_$(cover).jpg
asciidoctor-epub3 \
--trace \
--attribute=gplusdos \
--attribute=doslabel=gplusdos \
--attribute=dosname=G+DOS \
--attribute=epub-chapter-level=2 \
--attribute=version=$(full_version) \
--out-file=$@ $< \
2> tmp/doc.gplusdos.unknown_anchors.log
doc/gplusdos_solo_forth_manual.pdf: \
tmp/doc.gplusdos.manual.adoc \
README.adoc \
tmp/gplusdos_$(cover).pdf
asciidoctor-pdf \
--trace \
--attribute=gplusdos \
--attribute=doslabel=gplusdos \
--attribute=dosname=G+DOS \
--attribute=version=$(full_version) \