summaryrefslogtreecommitdiff
path: root/userspace/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'userspace/Makefile')
-rw-r--r--userspace/Makefile42
1 files changed, 21 insertions, 21 deletions
diff --git a/userspace/Makefile b/userspace/Makefile
index 29f6c7b..df79065 100644
--- a/userspace/Makefile
+++ b/userspace/Makefile
@@ -1,12 +1,9 @@
-#i686-elf-gcc test.c -L/home/miguel/temp/fool-os-stuff/newlib-build-clean/i686-elf/newlib/ -I/home/miguel/temp/fool-os-stuff/newlib-2.1.0/newlib/libc/include/ -L/home/miguel/temp/fool-os-stuff/newlib-build-clean/i686-elf/libgloss/libnosys/
-
CC=i686-foolos-gcc
-LD=i686-foolos-ld
PROGS=shell simple brainfuck add
-ext2.img: shell simple brainfuck add
- dd if=/dev/zero of=ext2.img bs=512 count=3500
+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
@@ -14,33 +11,36 @@ ext2.img: shell simple brainfuck add
mkdir mnt/miguel
echo "hello one" > mnt/miguel/test1.txt
echo "hello two" > mnt/test2.txt
- cp shell mnt
- cp simple mnt
- cp brainfuck mnt
- cp add mnt
- cp ~/temp/fool-os-stuff/binutils-fool-build/binutils/ar.bin mnt
+ cp $< mnt
+# cp shell.bin mnt
+ cp ~/temp/fool-os-stuff/binutils-fool-build/binutils/elfedit mnt
sync
sudo umount mnt
rm mnt -rf
-brainfuck: brainfuck.o crt0.o
- ${CC} -T linker.ld ${LDFLAGS} $< -o $@
-
-shell: foolshell.o crt0.o
- ${CC} -T linker.ld ${LDFLAGS} $< -o $@
+#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
-simple: simple.o crt0.o
- ${CC} -T linker.ld ${LDFLAGS} $< -o $@
-
-add: add.o crt0.o
- ${CC} -T linker.ld ${LDFLAGS} $< -o $@
clean:
- -rm *.o *.out shell simple ext2.img brainfuck add
+ -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
+