Add the ability to write documentation in markdown and have that translated to a Teach file at build time and included in the distribution.

This commit is contained in:
Jeremy Rand 2021-07-05 17:37:31 -04:00
parent e444c7c039
commit d55f6fe348
20 changed files with 149 additions and 2 deletions

View File

@ -81,6 +81,13 @@ LDFLAGS+=
# Uncomment the following line if you want to build against the GNO libraries # Uncomment the following line if you want to build against the GNO libraries
# export ORCA=$(ORCA_BINDIR)/gno # export ORCA=$(ORCA_BINDIR)/gno
# Add any markdown files to the MD_SRCS variable to specify which files to
# convert to a Teach text file format during the build. Using this, you can
# write your documentation in markdown in your project and at build time,
# that documentation is converted to a format that is good to package with
# your software and can be opened on a GS.
MD_SRCS=
# If you want to copy one or more files or directories to the distribution disk # If you want to copy one or more files or directories to the distribution disk
# image, add the root directory to this variable. Any directories under # image, add the root directory to this variable. Any directories under
# the source directory which don't exist in the target disk image will be # the source directory which don't exist in the target disk image will be

View File

@ -66,6 +66,13 @@ REZFLAGS+=
# put the rlint somewhere weird, you can set this to the correct path # put the rlint somewhere weird, you can set this to the correct path
# RLINT_PATH=rlint # RLINT_PATH=rlint
# Add any markdown files to the MD_SRCS variable to specify which files to
# convert to a Teach text file format during the build. Using this, you can
# write your documentation in markdown in your project and at build time,
# that documentation is converted to a format that is good to package with
# your software and can be opened on a GS.
MD_SRCS=
# If you want to copy one or more files or directories to the distribution disk # If you want to copy one or more files or directories to the distribution disk
# image, add the root directory to this variable. Any directories under # image, add the root directory to this variable. Any directories under
# the source directory which don't exist in the target disk image will be # the source directory which don't exist in the target disk image will be

View File

@ -130,6 +130,10 @@ copyDirs()
find . -print | while read FILEORDIR find . -print | while read FILEORDIR
do do
if [ "$FILEORDIR" = "." ]
then
continue
fi
if [ -d "$FILEORDIR" ] if [ -d "$FILEORDIR" ]
then then
mkdirProDOS "${MOUNTDIR}/$FILEORDIR" mkdirProDOS "${MOUNTDIR}/$FILEORDIR"

BIN
make/md2teach Normal file

Binary file not shown.

View File

@ -73,17 +73,22 @@ REZ_SRCS=$(patsubst $(GENDIR)/%, %, $(patsubst ./%, %, $(wildcard $(addsuffix /*
REZ_DEPS=$(patsubst %.rez, $(OBJDIR)/%.rez.d, $(REZ_SRCS)) REZ_DEPS=$(patsubst %.rez, $(OBJDIR)/%.rez.d, $(REZ_SRCS))
REZ_OBJS=$(patsubst %.rez, $(OBJDIR)/%.r, $(REZ_SRCS)) REZ_OBJS=$(patsubst %.rez, $(OBJDIR)/%.r, $(REZ_SRCS))
TEACH_FILES=$(patsubst %.md, $(GENDIR)/Teach/%, $(MD_SRCS))
ifneq ($(TEACH_FILES),)
COPYDIRS+=$(GENDIR)/Teach
endif
ifneq ($(firstword $(REZ_SRCS)), $(lastword $(REZ_SRCS))) ifneq ($(firstword $(REZ_SRCS)), $(lastword $(REZ_SRCS)))
$(error Only a single resource file supported, found $(REZ_SRCS)) $(error Only a single resource file supported, found $(REZ_SRCS))
endif endif
BUILD_OBJS=$(C_ROOTS) $(C_OBJS) $(ASM_ROOTS) BUILD_OBJS=$(C_ROOTS) $(C_OBJS) $(ASM_ROOTS) $(TEACH_FILES)
ifeq ($(BINTARGET),) ifeq ($(BINTARGET),)
BUILD_OBJS+=$(REZ_OBJS) BUILD_OBJS+=$(REZ_OBJS)
endif endif
BUILD_OBJS_NOSUFFIX=$(C_ROOTS:.root=) $(C_OBJS:.a=) $(ASM_ROOTS:.ROOT=) BUILD_OBJS_NOSUFFIX=$(C_ROOTS:.root=) $(C_OBJS:.a=) $(ASM_ROOTS:.ROOT=)
ALL_OBJS=$(C_ROOTS:.root=.a) $(C_OBJS) $(ASM_OBJS) $(REZ_OBJS) ALL_OBJS=$(C_ROOTS:.root=.a) $(C_OBJS) $(ASM_OBJS) $(REZ_OBJS) $(TEACH_FILES)
ALL_ROOTS=$(C_ROOTS) $(C_OBJS:.a=.root) $(ASM_ROOTS) ALL_ROOTS=$(C_ROOTS) $(C_OBJS:.a=.root) $(ASM_ROOTS)
ALL_DEPS=$(C_DEPS) $(ASM_DEPS) $(REZ_DEPS) ALL_DEPS=$(C_DEPS) $(ASM_DEPS) $(REZ_DEPS)
@ -223,6 +228,10 @@ ifneq ($(RLINT_PATH),)
$(ORCA) $(RLINT_PATH) $@ $(ORCA) $(RLINT_PATH) $@
endif endif
$(GENDIR)/Teach/%: %.md
$(MKDIR) "$(GENDIR)/Teach"
$(ORCA) make/md2teach "$<" "$@"
$(OBJS): Makefile $(OBJS): Makefile
# Include the C and rez dependencies which were generated from the last build # Include the C and rez dependencies which were generated from the last build

View File

@ -11,6 +11,7 @@
<string>make/createDiskImage</string> <string>make/createDiskImage</string>
<string>make/head.mk</string> <string>make/head.mk</string>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/merlin-asm</string> <string>make/merlin-asm</string>
<string>make/orca-rez</string> <string>make/orca-rez</string>
<string>make/system601.2mg</string> <string>make/system601.2mg</string>
@ -59,6 +60,13 @@
<key>Path</key> <key>Path</key>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
</dict> </dict>
<key>make/md2teach</key>
<dict>
<key>Group</key>
<string>make</string>
<key>Path</key>
<string>make/md2teach</string>
</dict>
<key>make/merlin-asm</key> <key>make/merlin-asm</key>
<dict> <dict>
<key>Group</key> <key>Group</key>

View File

@ -12,6 +12,7 @@
<string>make/createDiskImage</string> <string>make/createDiskImage</string>
<string>make/head.mk</string> <string>make/head.mk</string>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/merlin-asm</string> <string>make/merlin-asm</string>
<string>make/orca-rez</string> <string>make/orca-rez</string>
<string>make/system601.2mg</string> <string>make/system601.2mg</string>
@ -65,6 +66,13 @@
<key>Path</key> <key>Path</key>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
</dict> </dict>
<key>make/md2teach</key>
<dict>
<key>Group</key>
<string>make</string>
<key>Path</key>
<string>make/md2teach</string>
</dict>
<key>make/merlin-asm</key> <key>make/merlin-asm</key>
<dict> <dict>
<key>Group</key> <key>Group</key>

View File

@ -12,6 +12,7 @@
<string>make/createDiskImage</string> <string>make/createDiskImage</string>
<string>make/head.mk</string> <string>make/head.mk</string>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/merlin-asm</string> <string>make/merlin-asm</string>
<string>make/orca-rez</string> <string>make/orca-rez</string>
<string>make/system601.2mg</string> <string>make/system601.2mg</string>
@ -65,6 +66,13 @@
<key>Path</key> <key>Path</key>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
</dict> </dict>
<key>make/md2teach</key>
<dict>
<key>Group</key>
<string>make</string>
<key>Path</key>
<string>make/md2teach</string>
</dict>
<key>make/merlin-asm</key> <key>make/merlin-asm</key>
<dict> <dict>
<key>Group</key> <key>Group</key>

View File

@ -12,6 +12,7 @@
<string>make/createDiskImage</string> <string>make/createDiskImage</string>
<string>make/head.mk</string> <string>make/head.mk</string>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/merlin-asm</string> <string>make/merlin-asm</string>
<string>make/orca-rez</string> <string>make/orca-rez</string>
<string>make/system601.2mg</string> <string>make/system601.2mg</string>
@ -65,6 +66,13 @@
<key>Path</key> <key>Path</key>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
</dict> </dict>
<key>make/md2teach</key>
<dict>
<key>Group</key>
<string>make</string>
<key>Path</key>
<string>make/md2teach</string>
</dict>
<key>make/merlin-asm</key> <key>make/merlin-asm</key>
<dict> <dict>
<key>Group</key> <key>Group</key>

View File

@ -10,6 +10,7 @@
<string>make/createDiskImage</string> <string>make/createDiskImage</string>
<string>make/head.mk</string> <string>make/head.mk</string>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/orca-asm</string> <string>make/orca-asm</string>
<string>make/orca-cc</string> <string>make/orca-cc</string>
<string>make/orca-rez</string> <string>make/orca-rez</string>
@ -54,6 +55,13 @@
<key>Path</key> <key>Path</key>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
</dict> </dict>
<key>make/md2teach</key>
<dict>
<key>Group</key>
<string>make</string>
<key>Path</key>
<string>make/md2teach</string>
</dict>
<key>make/orca-asm</key> <key>make/orca-asm</key>
<dict> <dict>
<key>Group</key> <key>Group</key>

View File

@ -12,6 +12,7 @@
<string>make/createDiskImage</string> <string>make/createDiskImage</string>
<string>make/head.mk</string> <string>make/head.mk</string>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/orca-asm</string> <string>make/orca-asm</string>
<string>make/orca-cc</string> <string>make/orca-cc</string>
<string>make/orca-rez</string> <string>make/orca-rez</string>
@ -66,6 +67,13 @@
<key>Path</key> <key>Path</key>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
</dict> </dict>
<key>make/md2teach</key>
<dict>
<key>Group</key>
<string>make</string>
<key>Path</key>
<string>make/md2teach</string>
</dict>
<key>make/orca-asm</key> <key>make/orca-asm</key>
<dict> <dict>
<key>Group</key> <key>Group</key>

View File

@ -12,6 +12,7 @@
<string>make/createDiskImage</string> <string>make/createDiskImage</string>
<string>make/head.mk</string> <string>make/head.mk</string>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/orca-asm</string> <string>make/orca-asm</string>
<string>make/orca-cc</string> <string>make/orca-cc</string>
<string>make/orca-rez</string> <string>make/orca-rez</string>
@ -66,6 +67,13 @@
<key>Path</key> <key>Path</key>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
</dict> </dict>
<key>make/md2teach</key>
<dict>
<key>Group</key>
<string>make</string>
<key>Path</key>
<string>make/md2teach</string>
</dict>
<key>make/orca-asm</key> <key>make/orca-asm</key>
<dict> <dict>
<key>Group</key> <key>Group</key>

View File

@ -7,6 +7,7 @@
<string>main.c</string> <string>main.c</string>
<string>Makefile</string> <string>Makefile</string>
<string>make/head.mk</string> <string>make/head.mk</string>
<string>make/md2teach</string>
<string>make/orca-asm</string> <string>make/orca-asm</string>
<string>make/orca-cc</string> <string>make/orca-cc</string>
<string>make/orca-rez</string> <string>make/orca-rez</string>
@ -27,6 +28,13 @@
<key>Path</key> <key>Path</key>
<string>make/head.mk</string> <string>make/head.mk</string>
</dict> </dict>
<key>make/md2teach</key>
<dict>
<key>Group</key>
<string>make</string>
<key>Path</key>
<string>make/md2teach</string>
</dict>
<key>make/orca-asm</key> <key>make/orca-asm</key>
<dict> <dict>
<key>Group</key> <key>Group</key>

View File

@ -12,6 +12,7 @@
<string>make/createDiskImage</string> <string>make/createDiskImage</string>
<string>make/head.mk</string> <string>make/head.mk</string>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/orca-asm</string> <string>make/orca-asm</string>
<string>make/orca-cc</string> <string>make/orca-cc</string>
<string>make/orca-rez</string> <string>make/orca-rez</string>
@ -66,6 +67,13 @@
<key>Path</key> <key>Path</key>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
</dict> </dict>
<key>make/md2teach</key>
<dict>
<key>Group</key>
<string>make</string>
<key>Path</key>
<string>make/md2teach</string>
</dict>
<key>make/orca-asm</key> <key>make/orca-asm</key>
<dict> <dict>
<key>Group</key> <key>Group</key>

View File

@ -7,6 +7,7 @@
<string>main.c</string> <string>main.c</string>
<string>Makefile</string> <string>Makefile</string>
<string>make/head.mk</string> <string>make/head.mk</string>
<string>make/md2teach</string>
<string>make/orca-asm</string> <string>make/orca-asm</string>
<string>make/orca-cc</string> <string>make/orca-cc</string>
<string>make/orca-rez</string> <string>make/orca-rez</string>
@ -27,6 +28,13 @@
<key>Path</key> <key>Path</key>
<string>make/head.mk</string> <string>make/head.mk</string>
</dict> </dict>
<key>make/md2teach</key>
<dict>
<key>Group</key>
<string>make</string>
<key>Path</key>
<string>make/md2teach</string>
</dict>
<key>make/orca-asm</key> <key>make/orca-asm</key>
<dict> <dict>
<key>Group</key> <key>Group</key>

View File

@ -10,6 +10,7 @@
<string>make/createDiskImage</string> <string>make/createDiskImage</string>
<string>make/head.mk</string> <string>make/head.mk</string>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/orca-asm</string> <string>make/orca-asm</string>
<string>make/orca-cc</string> <string>make/orca-cc</string>
<string>make/orca-rez</string> <string>make/orca-rez</string>
@ -54,6 +55,13 @@
<key>Path</key> <key>Path</key>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
</dict> </dict>
<key>make/md2teach</key>
<dict>
<key>Group</key>
<string>make</string>
<key>Path</key>
<string>make/md2teach</string>
</dict>
<key>make/orca-asm</key> <key>make/orca-asm</key>
<dict> <dict>
<key>Group</key> <key>Group</key>

View File

@ -11,6 +11,7 @@
<string>make/createDiskImage</string> <string>make/createDiskImage</string>
<string>make/head.mk</string> <string>make/head.mk</string>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/orca-asm</string> <string>make/orca-asm</string>
<string>make/orca-cc</string> <string>make/orca-cc</string>
<string>make/orca-rez</string> <string>make/orca-rez</string>
@ -60,6 +61,13 @@
<key>Path</key> <key>Path</key>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
</dict> </dict>
<key>make/md2teach</key>
<dict>
<key>Group</key>
<string>make</string>
<key>Path</key>
<string>make/md2teach</string>
</dict>
<key>make/orca-asm</key> <key>make/orca-asm</key>
<dict> <dict>
<key>Group</key> <key>Group</key>

View File

@ -11,6 +11,7 @@
<string>make/createDiskImage</string> <string>make/createDiskImage</string>
<string>make/head.mk</string> <string>make/head.mk</string>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/orca-asm</string> <string>make/orca-asm</string>
<string>make/orca-cc</string> <string>make/orca-cc</string>
<string>make/orca-rez</string> <string>make/orca-rez</string>
@ -60,6 +61,13 @@
<key>Path</key> <key>Path</key>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
</dict> </dict>
<key>make/md2teach</key>
<dict>
<key>Group</key>
<string>make</string>
<key>Path</key>
<string>make/md2teach</string>
</dict>
<key>make/orca-asm</key> <key>make/orca-asm</key>
<dict> <dict>
<key>Group</key> <key>Group</key>

View File

@ -11,6 +11,7 @@
<string>make/createDiskImage</string> <string>make/createDiskImage</string>
<string>make/head.mk</string> <string>make/head.mk</string>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/orca-asm</string> <string>make/orca-asm</string>
<string>make/orca-cc</string> <string>make/orca-cc</string>
<string>make/orca-rez</string> <string>make/orca-rez</string>
@ -60,6 +61,13 @@
<key>Path</key> <key>Path</key>
<string>make/launchEmulator</string> <string>make/launchEmulator</string>
</dict> </dict>
<key>make/md2teach</key>
<dict>
<key>Group</key>
<string>make</string>
<key>Path</key>
<string>make/md2teach</string>
</dict>
<key>make/orca-asm</key> <key>make/orca-asm</key>
<dict> <dict>
<key>Group</key> <key>Group</key>

View File

@ -7,6 +7,7 @@
<string>main.s</string> <string>main.s</string>
<string>Makefile</string> <string>Makefile</string>
<string>make/head.mk</string> <string>make/head.mk</string>
<string>make/md2teach</string>
<string>make/orca-asm</string> <string>make/orca-asm</string>
<string>make/orca-cc</string> <string>make/orca-cc</string>
<string>make/orca-rez</string> <string>make/orca-rez</string>
@ -27,6 +28,13 @@
<key>Path</key> <key>Path</key>
<string>make/head.mk</string> <string>make/head.mk</string>
</dict> </dict>
<key>make/md2teach</key>
<dict>
<key>Group</key>
<string>make</string>
<key>Path</key>
<string>make/md2teach</string>
</dict>
<key>make/orca-asm</key> <key>make/orca-asm</key>
<dict> <dict>
<key>Group</key> <key>Group</key>