How to define a path to a data directory in gnu assembler?

60 Views Asked by At

To start, I had all my data in the same directory as my source code:

.image_01: .incbin "image_01.bin"
.image_02: .incbin "image_02.bin"

This is of course a mess and a bad practice. So I moved my data up a dir and into a data dir:

.image_01: .incbin "../data/image_01.bin"
.image_02: .incbin "../data/image_02.bin"

Now my src dir is nice and clean, but there is a problem here, which is violation of DRY.

Is there any way I can define some sort of variable, ie, DATADIR="../data/" and string concatenate that to the names of my data files? ie, .image_01: .incbin DATADIR + "image_01.bin"?

0

There are 0 best solutions below