2020-06-27 07:55:10 +10:00
|
|
|
TARGETS = forth stage
|
2020-06-27 05:50:13 +10:00
|
|
|
OBJS = vm.o
|
|
|
|
BLKPACK = ../tools/blkpack
|
|
|
|
BLKUNPACK = ../tools/blkunpack
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: $(TARGETS)
|
|
|
|
|
|
|
|
$(BLKPACK):
|
|
|
|
$(MAKE) -C ../tools
|
|
|
|
|
|
|
|
.PHONY: $(BLKUNPACK)
|
|
|
|
$(BLKUNPACK): $(BLKPACK)
|
|
|
|
|
|
|
|
stage: stage.c $(OBJS) blkfs
|
2020-11-15 06:50:14 +11:00
|
|
|
$(CC) -DFBIN_PATH=\"`pwd`/stage.bin\" -DBLKFS_PATH=\"`pwd`/blkfs\" stage.c $(OBJS) -o $@
|
2020-06-27 05:50:13 +10:00
|
|
|
|
|
|
|
blkfs: $(BLKPACK)
|
2020-11-15 10:00:31 +11:00
|
|
|
$(BLKPACK) < ../blk.fs > $@
|
2020-06-27 05:50:13 +10:00
|
|
|
|
2020-11-15 06:50:14 +11:00
|
|
|
forth.bin: stage common.fs forth.fs blkfs
|
|
|
|
cat common.fs forth.fs | ./stage > $@
|
|
|
|
|
|
|
|
forth: forth.c $(OBJS) forth.bin
|
|
|
|
$(CC) -DFBIN_PATH=\"`pwd`/forth.bin\" -DBLKFS_PATH=\"`pwd`/blkfs\" forth.c $(OBJS) -lcurses -o $@
|
2020-06-27 05:50:13 +10:00
|
|
|
|
2020-06-27 07:55:10 +10:00
|
|
|
vm.o: vm.c blkfs
|
2020-11-15 06:50:14 +11:00
|
|
|
$(CC) -c -o vm.o vm.c
|
2020-06-27 05:50:13 +10:00
|
|
|
|
|
|
|
|
|
|
|
.PHONY: updatebootstrap
|
2020-11-15 06:50:14 +11:00
|
|
|
updatebootstrap: stage common.fs stage.fs pack
|
|
|
|
cat common.fs stage.fs | ./stage > new.bin
|
|
|
|
mv new.bin stage.bin
|
2020-06-27 05:50:13 +10:00
|
|
|
|
|
|
|
.PHONY: pack
|
|
|
|
pack:
|
|
|
|
rm blkfs && $(MAKE) blkfs
|
|
|
|
|
|
|
|
.PHONY: unpack
|
|
|
|
unpack:
|
2020-11-15 10:00:31 +11:00
|
|
|
$(BLKUNPACK) < blkfs > ../blk.fs
|
2020-06-27 05:50:13 +10:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2020-11-15 06:50:14 +11:00
|
|
|
rm -f $(TARGETS) *.o forth.bin blkfs
|