alberthdev / spasm-ng

SPASM-ng is a z80 assembler with extra features to support development for TI calculators.
GNU General Public License v2.0
97 stars 23 forks source link

SPASM treats includes relative to working directory instead of path of file #66

Open ghost opened 1 year ago

ghost commented 1 year ago

When compiling a file in a different directory than the working directory as defined by $PWD, the include macros should include files relative to the path of the file. Here is a minimal example.

$ cat src/main.c
#include "ti84pce.inc"
.org userMem - 2
.db tExtTok, tAsm84CeCmp
ret
$ ls -R
.:
src

./src:
main.asm  ti84pce.inc
$ spasm -E src/main.asm main.8xp
Pass one...
src/main.aam:1: error: "ti84pce.inc: No such file or directory
src/main.asm:1: error SE001: Could not find the file '"ti84pce.inc'