feat: ports - zlib, libwapcaplet, libparserutils

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Ae69wJS7sueQMUwNxV3nX
This commit is contained in:
2026-08-07 20:11:55 +02:00
co-authored by Claude Opus 5
parent 48e97f4e09
commit acb169e2c4
13 changed files with 358 additions and 4 deletions
+49
View File
@@ -0,0 +1,49 @@
# Smoke test for the ports sysroot.
#
# Links one program against every library port and exercises a little of each,
# printing PASS/FAIL per library. Building it proves the sysroot's headers and
# archives resolve; RUNNING it on MontaukOS is the only way to prove the code
# is correct, since none of this can execute on the build host.
#
# make -C test build out/test/porttest.elf
# make -C test install copy it into the MontaukOS ramdisk as a system
# program, then rebuild the image and run
# `porttest.elf` from the terminal
# make -C test uninstall remove it again (do this before cutting a
# release -- it is not an app bundle, so it
# carries no .port marker and the release step
# will NOT prune it automatically)
PORT_NAME := porttest
include ../mk/port.mk
SYSROOT_LIBS := \
$(PORT_SYSROOT_LIB)/libparserutils.a \
$(PORT_SYSROOT_LIB)/libwapcaplet.a \
$(PORT_SYSROOT_LIB)/libz.a
TEST_ELF := $(OUTDIR)/test/porttest.elf
CFLAGS := -std=gnu11 $(PORT_CFLAGS_COMMON) -Wall
.PHONY: all clean install uninstall
all: $(TEST_ELF)
$(TEST_ELF): porttest.c $(SYSROOT_LIBS) $(LIBC_A) Makefile
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(PORT_LDFLAGS_COMMON) porttest.c \
$(SDK_LIB)/libc/crt1.o $(SYSROOT_LIBS) $(LIBC_A) -o $@
@echo "Built: $@"
install: $(TEST_ELF)
cp $(TEST_ELF) $(MONTAUKOS)/programs/bin/os/porttest.elf
@echo "installed: 0:/os/porttest.elf - rebuild the image, then run 'porttest.elf'"
@echo "REMINDER: 'make -C test uninstall' before cutting a release ISO."
uninstall:
rm -f $(MONTAUKOS)/programs/bin/os/porttest.elf
@echo "removed: $(MONTAUKOS)/programs/bin/os/porttest.elf"
clean:
rm -rf $(OUTDIR)/test