From e785e97ec118e896d28bd5dc973da8b11637a7df Mon Sep 17 00:00:00 2001 From: Henrik Akira Karlsson Date: Thu, 2 Nov 2023 13:13:40 +0100 Subject: [PATCH] Removes bad files and formats make files --- projects/hello/Makefile | 4 +++- projects/hello/README.md | 10 ---------- projects/hello/build.mk | 32 ++++++++++++++++++-------------- 3 files changed, 21 insertions(+), 25 deletions(-) delete mode 100644 projects/hello/README.md diff --git a/projects/hello/Makefile b/projects/hello/Makefile index 9f182913..8c0aabe9 100644 --- a/projects/hello/Makefile +++ b/projects/hello/Makefile @@ -1,3 +1,5 @@ +.POSIX: + export PLATFORM ?=qemu_virt export ROOT :=${abspath ../..} export BUILD :=${abspath build/${PLATFORM}} @@ -16,7 +18,7 @@ clean: @${MAKE} -C ${ROOT}/kernel clean @for prog in ${APPS}; do \ ${MAKE} -f build.mk PROGRAM=$$prog clean; \ - done + done common: @${MAKE} -C ${ROOT}/common diff --git a/projects/hello/README.md b/projects/hello/README.md deleted file mode 100644 index fadfefd6..00000000 --- a/projects/hello/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Hello World - -In this application, we have two applications `app0` and `app1` that print -`hello, world from `. - -Application `app0` is the initial process, it first setups access to uart, -enabling it to write message, then initializes `app0` by giving it access to -memory, uart and a slice of time on another core. - -Application `app1` simply prints `hello, world from app1`. diff --git a/projects/hello/build.mk b/projects/hello/build.mk index ed58e57d..4c93cce5 100644 --- a/projects/hello/build.mk +++ b/projects/hello/build.mk @@ -8,30 +8,31 @@ include ${ROOT}/common/plat/${PLATFORM}.mk C_SRCS:=${wildcard ${PROGRAM}/*.c} S_SRCS:=${wildcard ${PROGRAM}/*.S} -OBJS :=${patsubst %.c, ${BUILD}/%.o, ${C_SRCS}} \ - ${patsubst %.S, ${BUILD}/%.o, ${S_SRCS}} \ - ${STARTFILES}/start.o +OBJS :=${patsubst %.c,${BUILD}/%.o,${C_SRCS}} \ + ${patsubst %.S,${BUILD}/%.o,${S_SRCS}} \ + ${STARTFILES}/start.o DEPS :=${OBJS:.o=.d} CFLAGS:=-march=${ARCH} -mabi=${ABI} -mcmodel=${CMODEL} \ - -DPLATFORM_${PLATFORM} \ - -nostdlib \ - -DSTACK_SIZE=1024 \ - -Os -g3 -flto \ - -I${COMMON_INC} -include ${S3K_CONF_H} + -DPLATFORM_${PLATFORM} \ + -nostdlib \ + -DSTACK_SIZE=1024 \ + -Os -g3 -flto \ + -I${COMMON_INC} -include ${S3K_CONF_H} LDFLAGS:=-march=${ARCH} -mabi=${ABI} -mcmodel=${CMODEL} \ - -nostdlib \ - -flto \ - -T${PROGRAM}.ld -Tdefault.ld \ - -Wl,--no-warn-rwx-segments \ - -L${COMMON_LIB} -ls3k -laltc -lplat \ + -nostdlib \ + -flto \ + -T${PROGRAM}.ld -Tdefault.ld \ + -Wl,--no-warn-rwx-segments \ + -L${COMMON_LIB} -ls3k -laltc -lplat \ ELF:=${BUILD}/${PROGRAM}.elf BIN:=${ELF:.elf=.bin} HEX:=${ELF:.elf=.hex} +DA :=${ELF:.elf=.da} -all: ${ELF} ${BIN} ${HEX} +all: ${ELF} ${BIN} ${HEX} ${DA} clean: rm -f ${ELF} ${OBJS} ${DEPS} @@ -54,6 +55,9 @@ ${BUILD}/${PROGRAM}/%.o: ${PROGRAM}/%.c %.hex: %.elf ${OBJCOPY} -O ihex $< $@ +%.da: %.elf + ${OBJDUMP} -D $< $@ + .PHONY: all clean -include ${DEPS}