HoneyGol-Microsystems / vesp-alpha

RISC-V based student processor for embedded applications.
GNU General Public License v3.0
3 stars 0 forks source link

Fix Makefile #94

Closed medexs closed 10 months ago

medexs commented 10 months ago

There is problem with build/ directory if it does not exist. There is also room for other improvements.

medexs commented 10 months ago

Added generic targets for source files compilation - object files have to be in the same path as their source files. So the build/ directory is no longer necessary, because we know all locations of object files.

Next, I added option for linker that deletes unused sections.

I also added more comments.

medexs commented 10 months ago

I had to delete the --gc-sections option for linker, because it also deletes sections that are used. This is due to the mem.ld linker script, where both .text and .data sections start at address 0 and thus the linker doesn't correctly detect unused sections. This option works well only for unused functions.