1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-26 06:48:06 +11:00
collapseos/cvm/Makefile
Virgil Dupras 95ab1ad588 Transform "blk/" folders into "blk.fs" text files
Working in "blk/" folder from a modern system is harder than it
should be. Moving blocks around is a bit awkward, grepping is a
bit less convenient than it could be, git blame has troubles
following, etc.

In this commit, we modify blkpack and blkunpack to work with single
text files with blocks being separated by a special markup.

I think this will make the code significantly more convenient to
work into.
2020-11-14 18:34:15 -05:00

47 lines
930 B
Makefile

TARGETS = forth stage
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
$(CC) -DFBIN_PATH=\"`pwd`/stage.bin\" -DBLKFS_PATH=\"`pwd`/blkfs\" stage.c $(OBJS) -o $@
blkfs: $(BLKPACK)
$(BLKPACK) < ../blk.fs > $@
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 $@
vm.o: vm.c blkfs
$(CC) -c -o vm.o vm.c
.PHONY: updatebootstrap
updatebootstrap: stage common.fs stage.fs pack
cat common.fs stage.fs | ./stage > new.bin
mv new.bin stage.bin
.PHONY: pack
pack:
rm blkfs && $(MAKE) blkfs
.PHONY: unpack
unpack:
$(BLKUNPACK) < blkfs > ../blk.fs
.PHONY: clean
clean:
rm -f $(TARGETS) *.o forth.bin blkfs