summaryrefslogtreecommitdiff
path: root/userspace/Makefile
blob: df790658a0190838e226191e696492dceefaa5c6 (plain)
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
44
45
46
CC=i686-foolos-gcc

PROGS=shell simple brainfuck add

ext2.img: $(PROGS) shell.bin
	dd if=/dev/zero of=ext2.img bs=512 count=2000
	sudo mkfs.ext2 -O none ext2.img  -F
	mkdir mnt
	sudo mount ext2.img mnt
	sudo chown miguel mnt
	mkdir mnt/miguel
	echo "hello one" > mnt/miguel/test1.txt
	echo "hello two" > mnt/test2.txt
	cp $< mnt
#	cp shell.bin mnt
	cp ~/temp/fool-os-stuff/binutils-fool-build/binutils/elfedit mnt
	sync
	sudo umount mnt
	rm mnt -rf

#shell.bin: shell.c
#	${CC}  -T sys/oldlinker.ld -shell.c o shell.bin
#	objcopy -O binary shell shell.bin
	
brainfuck: brainfuck.o
shell: shell.o
simple: simple.o
add: add.o


clean:
	-rm *.o $(PROGS) ext2.img

mount:
	mkdir mnt
	sudo mount ext2.img mnt
	sudo chown miguel mnt

umount:
	sudo umount mnt
	rm mnt -rf

new: clean ext2.img