Skip to content

Commit

Permalink
Update build workflow and Makefile with separate phone steps to clari…
Browse files Browse the repository at this point in the history
…fy any build failures.
  • Loading branch information
dthain committed Dec 15, 2023
1 parent f527119 commit dfaaa1e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,19 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install
- name: Setup
run: sudo apt-get install -y genisoimage

- name: Build
run: make

- name: Build Kernel
run: make build-kernel

- name: Build Standard Library
run: make build-library

- name: Build Userspace
run: make build-userspace

- name: Build CDROM Image
run: make build-cdrom-image


30 changes: 20 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,27 @@ USER_PROGRAMS=$(USER_SOURCES:c=exe)
KERNEL_SOURCES=$(wildcard kernel/*.[chS])
WORDS=/usr/share/dict/words

all: basekernel.iso
.PHONY: build-kernel build-library build-userspace build-iso

run: basekernel.iso disk.img
qemu-system-i386 -cdrom basekernel.iso -hda disk.img
all: build-iso

debug: basekernel.iso disk.img
qemu-system-i386 -cdrom basekernel.iso -hda disk.img -s -S &
build-kernel: kernel/basekernel.img

disk.img:
qemu-img create disk.img 10M
build-library: library/baselib.a

build-userspace: $(USER_PROGRAMS)

build-cdrom-image: basekernel.iso

kernel/basekernel.img: $(KERNEL_SOURCES) $(LIBRARY_HEADERS)
cd kernel && make

library/baselib.a: $(LIBRARY_SOURCES) $(LIBRARY_HEADERS)
cd library && make

$(USER_PROGRAMS): $(USER_SOURCES) library/baselib.a $(LIBRARY_HEADERS)
cd user && make

kernel/basekernel.img: $(KERNEL_SOURCES) $(LIBRARY_HEADERS)
cd kernel && make

image: kernel/basekernel.img $(USER_PROGRAMS)
rm -rf image
mkdir image image/boot image/bin image/data
Expand All @@ -37,6 +38,15 @@ image: kernel/basekernel.img $(USER_PROGRAMS)
basekernel.iso: image
${ISOGEN} -input-charset utf-8 -iso-level 2 -J -R -o $@ -b boot/basekernel.img image

disk.img:
qemu-img create disk.img 10M

run: basekernel.iso disk.img
qemu-system-i386 -cdrom basekernel.iso -hda disk.img

debug: basekernel.iso disk.img
qemu-system-i386 -cdrom basekernel.iso -hda disk.img -s -S &

clean:
rm -rf basekernel.iso image
cd kernel && make clean
Expand Down

0 comments on commit dfaaa1e

Please sign in to comment.