Add a dos installer, and improve the makefile on dos #1
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@
|
|||||||
.vscode/
|
.vscode/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
build/
|
build/
|
||||||
|
dist-dos/
|
||||||
|
|||||||
20
MAKEFILE.TC
20
MAKEFILE.TC
@ -19,11 +19,21 @@ CFLAGS = -A -w -ml -I.\include
|
|||||||
SRCDIR = src
|
SRCDIR = src
|
||||||
INCDIR = include
|
INCDIR = include
|
||||||
BUILDDIR = build
|
BUILDDIR = build
|
||||||
|
INSTALL_FILE = INSTALL.BAT
|
||||||
|
README_DOS = READ-DOS.TXT
|
||||||
|
|
||||||
.c.obj:
|
.c.obj:
|
||||||
$(CC) $(CFLAGS) -c -o$*.obj $<
|
$(CC) $(CFLAGS) -c -o$*.obj $<
|
||||||
|
|
||||||
all: $(BUILDDIR) $(BUILDDIR)\cnadd.exe $(BUILDDIR)\cndump.exe $(BUILDDIR)\cncount.exe $(BUILDDIR)\cndel.exe $(BUILDDIR)\cnfind.exe $(BUILDDIR)\cnhelp.exe
|
all: $(BUILDDIR)
|
||||||
|
$(BUILDDIR)\cnadd.exe \
|
||||||
|
$(BUILDDIR)\cndump.exe \
|
||||||
|
$(BUILDDIR)\cncount.exe \
|
||||||
|
$(BUILDDIR)\cndel.exe \
|
||||||
|
$(BUILDDIR)\cnfind.exe \
|
||||||
|
$(BUILDDIR)\cnhelp.exe \
|
||||||
|
$(BUILDDIR)\$(INSTALL_FILE) \
|
||||||
|
$(BUILDDIR)\$(README_DOS)
|
||||||
|
|
||||||
$(BUILDDIR):
|
$(BUILDDIR):
|
||||||
if not exist $(BUILDDIR) mkdir $(BUILDDIR)
|
if not exist $(BUILDDIR) mkdir $(BUILDDIR)
|
||||||
@ -46,7 +56,15 @@ $(BUILDDIR)\cnfind.exe: $(SRCDIR)\cnfind.c $(INCDIR)\platform.h $(INCDIR)\config
|
|||||||
$(BUILDDIR)\cnhelp.exe: $(SRCDIR)\cnhelp.c
|
$(BUILDDIR)\cnhelp.exe: $(SRCDIR)\cnhelp.c
|
||||||
$(CC) $(CFLAGS) -e$(BUILDDIR)\cnhelp.exe $(SRCDIR)\cnhelp.c
|
$(CC) $(CFLAGS) -e$(BUILDDIR)\cnhelp.exe $(SRCDIR)\cnhelp.c
|
||||||
|
|
||||||
|
$(BUILDDIR)\$(INSTALL_FILE): $(INSTALL_FILE)
|
||||||
|
copy $(INSTALL_FILE) $(BUILDDIR)\$(INSTALL_FILE)
|
||||||
|
|
||||||
|
$(BUILDDIR)\$(README_DOS): $(README_DOS)
|
||||||
|
copy $(README_DOS) $(BUILDDIR)\$(README_DOS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
if exist $(BUILDDIR)\*.exe del $(BUILDDIR)\*.exe
|
if exist $(BUILDDIR)\*.exe del $(BUILDDIR)\*.exe
|
||||||
if exist $(BUILDDIR)\*.obj del $(BUILDDIR)\*.obj
|
if exist $(BUILDDIR)\*.obj del $(BUILDDIR)\*.obj
|
||||||
|
if exist $(BUILDDIR)\$(INSTALL_FILE) del $(BUILDDIR)\$(INSTALL_FILE)
|
||||||
|
if exist $(BUILDDIR)\$(README_DOS) del $(BUILDDIR)\$(README_DOS)
|
||||||
if exist $(BUILDDIR) rmdir $(BUILDDIR)
|
if exist $(BUILDDIR) rmdir $(BUILDDIR)
|
||||||
|
|||||||
54
READ-DOS.TXT
Normal file
54
READ-DOS.TXT
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
cnotes v0.1.1 for DOS
|
||||||
|
=====================
|
||||||
|
|
||||||
|
A simple command-line note-taking system
|
||||||
|
Built with Turbo C++ 3.0 (large memory model)
|
||||||
|
|
||||||
|
WHAT IS THIS?
|
||||||
|
------------
|
||||||
|
cnotes lets you quickly add, view, search, count, and archive short notes
|
||||||
|
from the DOS prompt. Notes are saved in plain cnotes.csv in your notes
|
||||||
|
directory (usually current directory on DOS).
|
||||||
|
|
||||||
|
COMMANDS INCLUDED
|
||||||
|
-----------------
|
||||||
|
CNADD - Add a new note
|
||||||
|
CNDUMP - Show all notes in a table
|
||||||
|
CNCOUNT - Show statistics (total, by category, by date)
|
||||||
|
CNDEL - Archive (move) notes to cnotes.arc
|
||||||
|
CNFIND - Search notes by text/category/date
|
||||||
|
CNHELP - Show this help overview
|
||||||
|
|
||||||
|
INSTALLATION
|
||||||
|
------------
|
||||||
|
1. Unzip all files to any directory (e.g. C:\TEMP)
|
||||||
|
2. Run INSTALL.BAT from that directory
|
||||||
|
3. Follow the on-screen prompts
|
||||||
|
|
||||||
|
After installation:
|
||||||
|
- Best: add C:\CNOTES to your PATH
|
||||||
|
SET PATH=%PATH%;C:\CNOTES
|
||||||
|
(put this line in C:\AUTOEXEC.BAT to make it permanent)
|
||||||
|
- Or run commands with full path: C:\CNOTES\CNADD "Test note"
|
||||||
|
|
||||||
|
QUICK START
|
||||||
|
-----------
|
||||||
|
CNADD "Remember to call Bob"
|
||||||
|
CNADD -c Work "Meeting 3pm tomorrow"
|
||||||
|
|
||||||
|
CNDUMP - view all notes
|
||||||
|
CNHELP - full command help
|
||||||
|
CNHELP cnadd - help for one command
|
||||||
|
|
||||||
|
NOTES LOCATION
|
||||||
|
--------------
|
||||||
|
By default: current directory (cnotes.csv and cnotes.arc)
|
||||||
|
Override with environment variable:
|
||||||
|
SET CNOTES_PATH=C:\MYNOTES
|
||||||
|
|
||||||
|
Have fun logging notes the retro way!
|
||||||
|
|
||||||
|
Questions or bugs? See the project at:
|
||||||
|
https://repos.gmgauthier.com/gmgauthier/cnotes
|
||||||
|
|
||||||
|
Greg Gauthier - February 2026
|
||||||
97
make-dos-zip.sh
Normal file
97
make-dos-zip.sh
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# make-dos-zip.sh
|
||||||
|
# ================
|
||||||
|
# Packages already-built DOS cnotes binaries into a release zip.
|
||||||
|
#
|
||||||
|
# Assumes:
|
||||||
|
# - You have already run make -f makefile.tc in DOSBox
|
||||||
|
# - All .exe files + INSTALL.BAT are in the 'build/' directory
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# ./make-dos-zip.sh [version]
|
||||||
|
#
|
||||||
|
# Examples:
|
||||||
|
# ./make-dos-zip.sh 0.1.1 → creates cnotes-v0.1.1-dos.zip
|
||||||
|
# ./make-dos-zip.sh → uses date as version (YYYYMMDD)
|
||||||
|
#
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
VERSION="${1:-$(date +%Y%m%d)}"
|
||||||
|
ZIP_NAME="cnotes-v${VERSION}-dos.zip"
|
||||||
|
BUILD_DIR="build"
|
||||||
|
DIST_DIR="dist-dos"
|
||||||
|
|
||||||
|
# Colors
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
RED='\033[0;31m'
|
||||||
|
NC='\033[0m'
|
||||||
|
|
||||||
|
echo -e "${GREEN}Packaging DOS release: ${ZIP_NAME}${NC}"
|
||||||
|
|
||||||
|
# 1. Check required files exist in build/
|
||||||
|
REQUIRED_FILES=(
|
||||||
|
"cnadd.exe"
|
||||||
|
"cndump.exe"
|
||||||
|
"cncount.exe"
|
||||||
|
"cndel.exe"
|
||||||
|
"cnfind.exe"
|
||||||
|
"cnhelp.exe"
|
||||||
|
"INSTALL.BAT"
|
||||||
|
"READ-DOS.TXT"
|
||||||
|
)
|
||||||
|
|
||||||
|
missing=0
|
||||||
|
for file in "${REQUIRED_FILES[@]}"; do
|
||||||
|
if [ ! -f "${BUILD_DIR}/${file}" ]; then
|
||||||
|
echo -e "${RED}Missing required file: ${BUILD_DIR}/${file}${NC}"
|
||||||
|
missing=1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $missing -eq 1 ]; then
|
||||||
|
echo -e "${RED}Aborting: one or more required files are missing.${NC}"
|
||||||
|
echo "Make sure you have built with 'make -f makefile.tc' in DOSBox"
|
||||||
|
echo "and that INSTALL.BAT is present."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 2. Prepare clean staging directory
|
||||||
|
rm -rf "${DIST_DIR}"
|
||||||
|
mkdir -p "${DIST_DIR}"
|
||||||
|
|
||||||
|
# 3. Copy files to staging
|
||||||
|
echo "Staging files..."
|
||||||
|
cp "${BUILD_DIR}"/*.exe "${DIST_DIR}"/
|
||||||
|
cp "${BUILD_DIR}/INSTALL.BAT" "${DIST_DIR}"/
|
||||||
|
cp "$$ {BUILD_DIR}/READ-DOS.TXT" " $${DIST_DIR}"/ 2>/dev/null || {
|
||||||
|
echo -e "$$ {RED}Warning: READ-DOS.TXT not found in build/ (optional but recommended) $${NC}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Optional extras (uncomment/add if you have them)
|
||||||
|
# cp README-DOS.TXT "${DIST_DIR}"/ 2>/dev/null || true
|
||||||
|
# cp LICENSE "${DIST_DIR}"/ 2>/dev/null || true
|
||||||
|
|
||||||
|
# 4. Create zip
|
||||||
|
echo "Creating zip archive..."
|
||||||
|
cd "${DIST_DIR}"
|
||||||
|
zip -r -9 "../${ZIP_NAME}" . >/dev/null
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# 5. Optional SHA256
|
||||||
|
if command -v sha256sum >/dev/null 2>&1; then
|
||||||
|
sha256sum "${ZIP_NAME}" > "${ZIP_NAME}.sha256"
|
||||||
|
echo "Checksum: ${ZIP_NAME}.sha256"
|
||||||
|
elif command -v shasum >/dev/null 2>&1; then
|
||||||
|
shasum -a 256 "${ZIP_NAME}" > "${ZIP_NAME}.sha256"
|
||||||
|
echo "Checksum: ${ZIP_NAME}.sha256"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 6. Show result
|
||||||
|
echo -e "${GREEN}Done! Zip created:${NC}"
|
||||||
|
ls -lh "${ZIP_NAME}"*
|
||||||
|
echo ""
|
||||||
|
echo "Next steps:"
|
||||||
|
echo " 1. Upload ${ZIP_NAME} (and .sha256 if created) to Gitea release"
|
||||||
|
echo " 2. Optionally delete staging dir: rm -rf ${DIST_DIR}"
|
||||||
Loading…
Reference in New Issue
Block a user