aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/Makefile28
1 files changed, 19 insertions, 9 deletions
diff --git a/build/Makefile b/build/Makefile
index b5257fe..53f8c98 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -15,6 +15,7 @@ ARM_OBJCOPY ?= $(ARM_BASE)-objcopy
ARM_ELFFLAGS ?= -nostdlib -lgcc
+
KERNEL_STAGE2_OBJECTS := setup.o interrupt_vector.o interrupts.o \
uart.o demo_functionality.o paging.o ramfs_embeddable.o \
ramfs.o strings.o io.o atags.o scheduler.o
@@ -25,6 +26,7 @@ LOADER_STAGE2_OBJECTS := uart.o strings.o io.o loader_stage2.o
RAMFS_FILES := PL0_test.img
+
empty:=
space:= $(empty) $(empty)
@@ -34,8 +36,10 @@ vpath %.S $(dirs_colon)
vpath %.c $(dirs_colon)
vpath %.ld $(dirs_colon)
+
all : kernel.img
+
%.o : %.c
$(if $(findstring /arm/,$<),\
$(ARM_CC) $(ARM_CFLAGS),$(HOST_CC) $(HOST_CFLAGS)) -c $< -o $@
@@ -52,6 +56,7 @@ all : kernel.img
%.elf : %.ld
$(ARM_CC) -T $< -o $@ $(ARM_ELFFLAGS) $(filter %.o,$^)
+
PL0_test.elf : $(PL_0_TEST_OBJECTS)
kernel.elf : kernel_stage1.o
@@ -62,10 +67,23 @@ loader_stage2.elf : $(LOADER_STAGE2_OBJECTS)
loader.elf : loader_stage1.o
+
kernel_stage1.o : kernel_stage2.img
loader_stage1.o : loader_stage2.img
+
+ramfs.img : makefs $(RAMFS_FILES)
+ ./makefs $(RAMFS_FILES) > $@
+
+
+pipe_image : pipe_image.o rs232.o
+ $(HOST_CC) $^ -o $@
+
+makefs : makefs.o
+ $(HOST_CC) $^ -o $@
+
+
qemu-elf : kernel.elf
qemu-system-arm -m 256 -M raspi2 -serial stdio -kernel $^
@@ -81,16 +99,8 @@ run-on-rpi : kernel.img pipe_image
sudo socat FILE:/dev/ttyUSB0,b115200,raw -
sudo screen /dev/ttyUSB0 115200,cs8,-parenb,-cstopb,-hupcl
-pipe_image : pipe_image.o rs232.o
- $(HOST_CC) $^ -o $@
-
-makefs : makefs.o
- $(HOST_CC) $^ -o $@
-
-ramfs.img : makefs $(RAMFS_FILES)
- ./makefs $(RAMFS_FILES) > $@
clean :
-rm -f *.img *.elf *.o pipe_image makefs
-.PHONY: all qemu-elf qemu-bin clean
+.PHONY: all qemu-elf qemu-bin qemu-loader run-on-rpi clean