Lindenii Project Forge
Login

hare-ds

Data structures for Hare
Commit info
ID
de0282de4ce3ba8f1f42a408333d14b8b680f63e
Author
Runxi Yu <me@runxiyu.org>
Author date
Tue, 16 Sep 2025 23:21:24 +0800
Committer
Runxi Yu <me@runxiyu.org>
Committer date
Tue, 16 Sep 2025 23:21:24 +0800
Actions
Generate HTML documentation
/html
# SPDX-License-Identifier: MPL-2.0
# SPDX-FileCopyrightText: 2021-2025 Hare authors <https://harelang.org>
# SPDX-FileCopyrightText: 2025 Runxi Yu <https://runxiyu.org>

.POSIX:
.SUFFIXES:
HARE=hare
HAREFLAGS=

DESTDIR=
PREFIX=/usr/local
SRCDIR=$(PREFIX)/src
HARESRCDIR=$(SRCDIR)/hare
THIRDPARTYDIR=$(HARESRCDIR)/third-party

check:
	$(HARE) $(HAREFLAGS) test

install:
	install -dm644 ds/ $(DESTDIR)$(THIRDPARTYDIR)/

uninstall:
	rm -rf $(DESTDIR)$(THIRDPARTYDIR)/ds/

html:
	mkdir -p html
	for d in $$(scripts/moddirs); do \
		find $$d -type d | sed -E '/(\+|-)/d'; \
	done \
	| while read path; do \
		mod=$$(echo $$path | sed -E 's@/@::@g'); \
		echo $$mod; \
		mkdir -p html/$$path; \
		echo haredoc -Fhtml $$mod; \
		haredoc -Fhtml $$mod | sed "s@<a href='/'>stdlib</a>@third-party@g" > html/$$path/index.html; \
	done

.PHONY: check install uninstall html
#!/bin/sh
# SPDX-License-Identifier: MPL-2.0
# SPDX-FileCopyrightText: 2021-2025 Hare authors <https://harelang.org>
# SPDX-FileCopyrightText: 2025 Runxi Yu <https://runxiyu.org>

for i in *; do
	case "$i" in
	.* | html | scripts) ;;
	*) find -- "$i" -prune -type d ;;
	esac
done