~vdupras/collapseos

ref: 6b895d07456e5776c1b3506e1ba46b9595cb5ffb collapseos/cvm/Makefile -rw-r--r-- 763 bytes
6b895d07Virgil Dupras sms: explicitly set ourselves in IM 1 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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) -DBLKFS_PATH=\"`pwd`/blkfs\" stage.c $(OBJS) -o $@

blkfs: $(BLKPACK)
	$(BLKPACK) ../blk > $@

forth: forth.c $(OBJS)
	$(CC) -DBLKFS_PATH=\"`pwd`/blkfs\" forth.c $(OBJS) -lncurses -o $@

vm.o: vm.c blkfs
	$(CC) -DFBIN_PATH=\"`pwd`/forth.bin\" -c -o vm.o vm.c


.PHONY: updatebootstrap
updatebootstrap: stage xcomp.fs pack
	./stage < xcomp.fs > new.bin
	mv new.bin forth.bin

.PHONY: pack
pack:
	rm blkfs && $(MAKE) blkfs

.PHONY: unpack
unpack:
	$(BLKUNPACK) ../blk < blkfs

.PHONY: clean
clean:
	rm -f $(TARGETS) *.o blkfs