From 535290cf40680db138d1fb29151f8e576a1a0044 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Sat, 3 Sep 2022 23:04:31 +0200 Subject: [PATCH] Add doc generation --- .gitignore | 1 + Makefile | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1f65368..bd25471 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ disk.img kernel kernel.sym userspace/user +docs/*.html diff --git a/Makefile b/Makefile index 811dc31..57cf894 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,8 @@ gasmobj=$(gasmsrc:%.S=%.o) csrc=$(shell find $(SUBDIRS) -type f -name "*.c")# $(wildcard *.c) cobj=$(csrc:%.c=%.o) deps=$(csrc:%.c=%.d) $(gasmsrc:%.S=%.d) +docsrc=$(wildcard docs/*.md) +docobj=$(docsrc:%.md=%.html) kernel kernel.sym &: $(asmobj) $(gasmobj) $(cobj) linker.ld $(LD) $(LDFLAGS) $(asmobj) $(gasmobj) $(cobj) -o kernel -T linker.ld $(LIBGCC) @@ -41,6 +43,8 @@ userspace: FORCE FORCE: @ +doc: $(docobj) + disk.img: disk.sfdisk userspace qemu-img create -f raw $@ 32M sfdisk $@ < $< @@ -57,6 +61,8 @@ disk.img: disk.sfdisk userspace %.o: %.S $(CC) $(CFLAGS) $(CPPFLAGS) -c "$<" -o "$@" +%.html: %.md + markdown -o $@ $< test: CFLAGS += -DRUN_TEST test: clean kernel disk.img @@ -77,7 +83,7 @@ screenshot: shutter --window=qemu -o screenshot_1.png -e && zopflipng screenshot_1.png screenshot_1.png clean: - $(RM) kernel $(asmobj) $(gasmobj) $(cobj) $(deps) fd.iso kernel.sym + $(RM) kernel $(asmobj) $(gasmobj) $(cobj) $(deps) fd.iso kernel.sym $(docobj) $(RM) -r isodir .PHONY: