aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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)