Please help with a makefile that puts src in its own dir
xlar54 opened this issue · comments
Hi, I am using your code as a base for mine, but the problem is that I cant seem to put .s and .c in a src folder. Id like to have:
project
---src
---obj
---target
Here's the makefile. It builds, but complains about not being able to find _start
`TOOL = arm-none-eabi
CFLAGS = -nostdlib -nodefaultlibs -nostartfiles -ffreestanding -fno-asynchronous-unwind-tables -fomit-frame-pointer -Wall -O3 -march=armv8-a -mfpu=neon-vfpv4 -mfloat-abi=hard -mtune=cortex-a53 -mno-unaligned-access -fno-tree-loop-vectorize -fno-tree-slp-vectorize -Wno-nonnull-compare -lc -lm -lgcc
LINKER_FLAGS = --no-wchar-size-warning --no-undefined -gc-sections --build-id=none -Bdynamic
BUILD_DIR = obj
SOURCE_DIR = src
TARGET_DIR = target
CSOURCE :=
ASOURCE := $(wildcard $(SOURCE_DIR)/.s)
_COBJECT :=
_AOBJECT :=
AOBJECT =
COBJECT =
all: kernel
Create the final binary
kernel: theelf
Link all of the objects
theelf:
#build c files
#build s files (Assembly)
clean:
rm $(BUILD_DIR)/.o
rm $(BUILD_DIR)/.map
rm $(BUILD_DIR)/.elf
rm $(TARGET_DIR)/.img
`
Is this what you are trying to do it will just echo the filenames to screen