aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorvetch <vetch97@gmail.com>2020-01-13 12:40:38 +0100
committervetch <vetch97@gmail.com>2020-01-13 12:40:38 +0100
commit1af7591e37d09ddcd734ea07d0e999cf61c8bc5e (patch)
treea56c73c9eddeb148baffc3a31bf50edbbeb31074 /Makefile
parent300cf770698142b636da867b7e04bf2d6ae9baa4 (diff)
downloadrpi-MMU-example-1af7591e37d09ddcd734ea07d0e999cf61c8bc5e.tar.gz
rpi-MMU-example-1af7591e37d09ddcd734ea07d0e999cf61c8bc5e.zip
Great Reorganisation, modify structure and makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 12 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index ed090a3..a44eea2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-CFLAGS=-mcpu=cortex-a7 -ffreestanding -std=gnu11 -Wall -Wextra -I.
+CFLAGS=-mcpu=cortex-a7 -ffreestanding -std=gnu11 -Wall -Wextra $(addprefix -I,$(subst :, ,$(VPATH)))
ELFFLAGS=-nostdlib -lgcc
ARM_OBJECTS=kernel.o paging.o demo_functionality.o PL0_test.o uart.o loader_stage1.o loader_stage2.o
@@ -13,7 +13,7 @@ RAMFS_FILES=PL_0_test.img
all : kernel.img
-src = src:$(wildcard src/*)
+src= src:src/arm/common:src/arm/PL1/kernel:src/arm/PL1/PL1_common:src/arm/PL0:src/host:src/arm/PL1/loader:src/lib/rs232
VPATH=$(src)
%.o : %.c
@@ -28,25 +28,25 @@ VPATH=$(src)
%_embeddable.o : %.img
arm-none-eabi-objcopy -I binary -O elf32-littlearm -B arm $^ $@
-PL_0_test.elf : src/PL0/PL0_test.ld $(PL_0_TEST_OBJECTS)
+PL_0_test.elf : PL0_test.ld $(PL_0_TEST_OBJECTS)
arm-none-eabi-gcc -T $< -o $@ $(ELFFLAGS) $(PL_0_TEST_OBJECTS)
-kernel_stage1.o : src/boot/kernel_stage1.S kernel_stage2.img
+kernel_stage1.o : kernel_stage1.S kernel_stage2.img
arm-none-eabi-as -mcpu=cortex-a7 $< -o $@
-kernel.elf : src/boot/kernel_stage1.ld kernel_stage1.o
+kernel.elf : kernel_stage1.ld kernel_stage1.o
arm-none-eabi-gcc -T $< -o $@ $(ELFFLAGS) kernel_stage1.o
-kernel_stage2.elf : src/boot/kernel_stage2.ld $(KERNEL_STAGE2_OBJECTS)
+kernel_stage2.elf : kernel_stage2.ld $(KERNEL_STAGE2_OBJECTS)
arm-none-eabi-gcc -T $< -o $@ $(ELFFLAGS) $(KERNEL_STAGE2_OBJECTS)
-loader_stage2.elf : src/boot/loader_stage2_linker.ld $(LOADER_STAGE2_OBJECTS)
+loader_stage2.elf : loader_stage2_linker.ld $(LOADER_STAGE2_OBJECTS)
arm-none-eabi-gcc -T $< -o $@ $(ELFFLAGS) $(LOADER_STAGE2_OBJECTS)
-loader_stage1.o : src/boot/loader_stage1.S loader_stage2.img
+loader_stage1.o : loader_stage1.S loader_stage2.img
arm-none-eabi-as -mcpu=cortex-a7 $< -o $@
-loader.elf : src/boot/loader_stage1_linker.ld loader_stage1.o
+loader.elf : loader_stage1_linker.ld loader_stage1.o
arm-none-eabi-gcc -T $< -o $@ $(ELFFLAGS) loader_stage1.o
qemu-elf : kernel.elf
@@ -62,10 +62,10 @@ run-on-rpi : kernel.img pipe_image
./pipe_image --stdout | sudo socat FILE:/dev/ttyUSB0,b115200,raw -
screen /dev/ttyUSB0 115200,cs8,-parenb,-cstopb,-hupcl
-pipe_image : src/utils/pipe_image.c lib/rs232/rs232.c
- gcc -Wall -std=gnu99 -O3 $^ -o $@
+pipe_image : pipe_image.c rs232.c
+ gcc -Wall -std=gnu99 -Isrc/lib/rs232 -O3 $^ -o $@
-makefs : src/memory/makefs.c
+makefs : makefs.c
gcc -Wall -std=gnu99 -O3 $^ -o $@
ramfs.img : makefs $(RAMFS_FILES)