Skip to content

Commit

Permalink
Removes bad files and formats make files
Browse files Browse the repository at this point in the history
  • Loading branch information
HAKarlsson committed Nov 2, 2023
1 parent 8719c3d commit e785e97
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
4 changes: 3 additions & 1 deletion projects/hello/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.POSIX:

export PLATFORM ?=qemu_virt
export ROOT :=${abspath ../..}
export BUILD :=${abspath build/${PLATFORM}}
Expand All @@ -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
Expand Down
10 changes: 0 additions & 10 deletions projects/hello/README.md

This file was deleted.

32 changes: 18 additions & 14 deletions projects/hello/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -54,6 +55,9 @@ ${BUILD}/${PROGRAM}/%.o: ${PROGRAM}/%.c
%.hex: %.elf
${OBJCOPY} -O ihex $< $@

%.da: %.elf
${OBJDUMP} -D $< $@

.PHONY: all clean

-include ${DEPS}

0 comments on commit e785e97

Please sign in to comment.