Skip to content

Commit

Permalink
Add the ability to write documentation in markdown and have that tran…
Browse files Browse the repository at this point in the history
…slated to a Teach file at build time and included in the distribution.
  • Loading branch information
jeremysrand committed Jul 5, 2021
1 parent e444c7c commit d55f6fe
Show file tree
Hide file tree
Showing 20 changed files with 149 additions and 2 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ LDFLAGS+=
# Uncomment the following line if you want to build against the GNO libraries
# 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
# 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
Expand Down
7 changes: 7 additions & 0 deletions Makefile.merlin
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ REZFLAGS+=
# put the rlint somewhere weird, you can set this to the correct path
# 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
# 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
Expand Down
4 changes: 4 additions & 0 deletions make/createDiskImage
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ copyDirs()

find . -print | while read FILEORDIR
do
if [ "$FILEORDIR" = "." ]
then
continue
fi
if [ -d "$FILEORDIR" ]
then
mkdirProDOS "${MOUNTDIR}/$FILEORDIR"
Expand Down
Binary file added make/md2teach
Binary file not shown.
13 changes: 11 additions & 2 deletions make/tail.mk
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,22 @@ REZ_SRCS=$(patsubst $(GENDIR)/%, %, $(patsubst ./%, %, $(wildcard $(addsuffix /*
REZ_DEPS=$(patsubst %.rez, $(OBJDIR)/%.rez.d, $(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)))
$(error Only a single resource file supported, found $(REZ_SRCS))
endif

BUILD_OBJS=$(C_ROOTS) $(C_OBJS) $(ASM_ROOTS)
BUILD_OBJS=$(C_ROOTS) $(C_OBJS) $(ASM_ROOTS) $(TEACH_FILES)
ifeq ($(BINTARGET),)
BUILD_OBJS+=$(REZ_OBJS)
endif
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_DEPS=$(C_DEPS) $(ASM_DEPS) $(REZ_DEPS)

Expand Down Expand Up @@ -223,6 +228,10 @@ ifneq ($(RLINT_PATH),)
$(ORCA) $(RLINT_PATH) $@
endif

$(GENDIR)/Teach/%: %.md
$(MKDIR) "$(GENDIR)/Teach"
$(ORCA) make/md2teach "$<" "$@"

$(OBJS): Makefile

# Include the C and rez dependencies which were generated from the last build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<string>make/createDiskImage</string>
<string>make/head.mk</string>
<string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/merlin-asm</string>
<string>make/orca-rez</string>
<string>make/system601.2mg</string>
Expand Down Expand Up @@ -59,6 +60,13 @@
<key>Path</key>
<string>make/launchEmulator</string>
</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>
<dict>
<key>Group</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<string>make/createDiskImage</string>
<string>make/head.mk</string>
<string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/merlin-asm</string>
<string>make/orca-rez</string>
<string>make/system601.2mg</string>
Expand Down Expand Up @@ -65,6 +66,13 @@
<key>Path</key>
<string>make/launchEmulator</string>
</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>
<dict>
<key>Group</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<string>make/createDiskImage</string>
<string>make/head.mk</string>
<string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/merlin-asm</string>
<string>make/orca-rez</string>
<string>make/system601.2mg</string>
Expand Down Expand Up @@ -65,6 +66,13 @@
<key>Path</key>
<string>make/launchEmulator</string>
</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>
<dict>
<key>Group</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<string>make/createDiskImage</string>
<string>make/head.mk</string>
<string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/merlin-asm</string>
<string>make/orca-rez</string>
<string>make/system601.2mg</string>
Expand Down Expand Up @@ -65,6 +66,13 @@
<key>Path</key>
<string>make/launchEmulator</string>
</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>
<dict>
<key>Group</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<string>make/createDiskImage</string>
<string>make/head.mk</string>
<string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/orca-asm</string>
<string>make/orca-cc</string>
<string>make/orca-rez</string>
Expand Down Expand Up @@ -54,6 +55,13 @@
<key>Path</key>
<string>make/launchEmulator</string>
</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>
<dict>
<key>Group</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<string>make/createDiskImage</string>
<string>make/head.mk</string>
<string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/orca-asm</string>
<string>make/orca-cc</string>
<string>make/orca-rez</string>
Expand Down Expand Up @@ -66,6 +67,13 @@
<key>Path</key>
<string>make/launchEmulator</string>
</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>
<dict>
<key>Group</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<string>make/createDiskImage</string>
<string>make/head.mk</string>
<string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/orca-asm</string>
<string>make/orca-cc</string>
<string>make/orca-rez</string>
Expand Down Expand Up @@ -66,6 +67,13 @@
<key>Path</key>
<string>make/launchEmulator</string>
</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>
<dict>
<key>Group</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<string>main.c</string>
<string>Makefile</string>
<string>make/head.mk</string>
<string>make/md2teach</string>
<string>make/orca-asm</string>
<string>make/orca-cc</string>
<string>make/orca-rez</string>
Expand All @@ -27,6 +28,13 @@
<key>Path</key>
<string>make/head.mk</string>
</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>
<dict>
<key>Group</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<string>make/createDiskImage</string>
<string>make/head.mk</string>
<string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/orca-asm</string>
<string>make/orca-cc</string>
<string>make/orca-rez</string>
Expand Down Expand Up @@ -66,6 +67,13 @@
<key>Path</key>
<string>make/launchEmulator</string>
</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>
<dict>
<key>Group</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<string>main.c</string>
<string>Makefile</string>
<string>make/head.mk</string>
<string>make/md2teach</string>
<string>make/orca-asm</string>
<string>make/orca-cc</string>
<string>make/orca-rez</string>
Expand All @@ -27,6 +28,13 @@
<key>Path</key>
<string>make/head.mk</string>
</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>
<dict>
<key>Group</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<string>make/createDiskImage</string>
<string>make/head.mk</string>
<string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/orca-asm</string>
<string>make/orca-cc</string>
<string>make/orca-rez</string>
Expand Down Expand Up @@ -54,6 +55,13 @@
<key>Path</key>
<string>make/launchEmulator</string>
</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>
<dict>
<key>Group</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<string>make/createDiskImage</string>
<string>make/head.mk</string>
<string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/orca-asm</string>
<string>make/orca-cc</string>
<string>make/orca-rez</string>
Expand Down Expand Up @@ -60,6 +61,13 @@
<key>Path</key>
<string>make/launchEmulator</string>
</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>
<dict>
<key>Group</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<string>make/createDiskImage</string>
<string>make/head.mk</string>
<string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/orca-asm</string>
<string>make/orca-cc</string>
<string>make/orca-rez</string>
Expand Down Expand Up @@ -60,6 +61,13 @@
<key>Path</key>
<string>make/launchEmulator</string>
</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>
<dict>
<key>Group</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<string>make/createDiskImage</string>
<string>make/head.mk</string>
<string>make/launchEmulator</string>
<string>make/md2teach</string>
<string>make/orca-asm</string>
<string>make/orca-cc</string>
<string>make/orca-rez</string>
Expand Down Expand Up @@ -60,6 +61,13 @@
<key>Path</key>
<string>make/launchEmulator</string>
</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>
<dict>
<key>Group</key>
Expand Down
Loading

0 comments on commit d55f6fe

Please sign in to comment.