summaryrefslogtreecommitdiff
path: root/userspace/Makefile
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-08-17 17:51:51 +0200
committerMiguel <m.i@gmx.at>2018-08-17 17:51:51 +0200
commit51d4dd040a291b62c648ff6cc0d7e0058cf4056f (patch)
tree142b7db302ba038dba526f99e5854cfc87b5f92e /userspace/Makefile
parent006214f8c63189500b6ca55e0ef8f97eb35d47f5 (diff)
starting implicit function calls cleanup
Diffstat (limited to 'userspace/Makefile')
-rw-r--r--userspace/Makefile47
1 files changed, 18 insertions, 29 deletions
diff --git a/userspace/Makefile b/userspace/Makefile
index 2812edd..e1e5484 100644
--- a/userspace/Makefile
+++ b/userspace/Makefile
@@ -1,35 +1,42 @@
+IMAGESIZE=30000 #ext2.img size in Kb (30Megs)
+
+#######################
+
CC=i686-foolos-gcc
CC=i686-elf-gcc
CFLAGS=
+CFLAGS=-w
CFLAGS+=-I..
CFLAGS+=-I/home/miguel/foolos/usr/i686-foolos/include
-CFLAGS+=-w
-CFLAGS+=-std=gnu11
CFLAGS+=-O0
CFLAGS+=-g
-#CFLAGS+=-fstack-protector-all
-#LDFLAGS=-nostdlib
LDFLAGS=-L/home/miguel/foolos/usr/i686-foolos/lib/
LDLIBS=-lc -lm -lg -lnosys
-PROGS=foolshell ls simple brainfuck test-math checker clear task1 task2 init cat snake
+PROGS_C=$(wildcard *.c)
+PROGS=$(patsubst %.c,%,$(PROGS_C))
+
include ../Makefile.common
+all: ext2.img
+
ext2.img: crt0.o $(PROGS) ../mp/mp.bin
- dd if=/dev/zero of=ext2.img bs=512 count=50000
+
+ dd if=/dev/zero of=ext2.img bs=1024 count=$(IMAGESIZE)
sudo mkfs.ext2 -O none ext2.img -F
mkdir mnt
sudo mount ext2.img mnt
sudo chown miguel mnt
mkdir -p mnt/home/miguel
mkdir -p mnt/boot
- echo "hello one" > mnt/home/miguel/test1.txt
+ echo "Welcome to FoolOs\nWe hope you will enjoy your stay." > mnt/home/miguel/hello.txt
mkdir -p mnt/bin
- cp $^ mnt/bin
+ cp $(PROGS) mnt/bin
echo "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++." > mnt/home/miguel/hello.brain
+
# cp ~/temp/fool-os-stuff/binutils-build-host-foolos/binutils/readelf mnt/bin
# cp ../font/binfont.bin mnt/
# cp ~/temp/fool-os-stuff/ncurses/ncurses-5.9-build/progs/* mnt/bin/
@@ -39,6 +46,7 @@ ext2.img: crt0.o $(PROGS) ../mp/mp.bin
# cp ~/opt/foolos/usr/bin/view mnt/bin/
# cp ~/opt/foolos/usr/bin/ncurses mnt/bin/
# cp ~/opt/foolos/usr/bin/bs mnt/bin/
+#
cp ../mp/mp.bin mnt/boot/
mkdir -p mnt/etc
echo "127.0.0.1 localhost" > mnt/etc/hosts
@@ -46,27 +54,8 @@ ext2.img: crt0.o $(PROGS) ../mp/mp.bin
sudo umount mnt
rm mnt -rf
-brainfuck: brainfuck.o
-snake: snake.o
-foolshell: foolshell.o
-simple: simple.o
-test-math: test-math.o
-checker: checker.o
-task1: task1.o
-task2: task2.o
-init: init.o
-cat: cat.o
-
clean:
- -rm *.o $(PROGS) ext2.img *.d
+ -rm -f *.o $(PROGS) ext2.img *.d
-mount:
- mkdir mnt
- sudo mount ext2.img mnt
- sudo chown miguel mnt
-
-umount:
- sudo umount mnt
- rm mnt -rf
+new: clean all
-new: clean ext2.img