Guys, how do I create a relative label? See below my effort:
EXAMPLEPATH = examples/
obj-y += EXAMPLEPATH/rtos/fior_am/hal/interrupt_gateway.o
You going to have to say what language & tools you're talking about.
Isn't he simply talking about Makefiles then?
Shit! Sorry guys, I should have said this pertains to make files.
A path is relative as long as its not anchored to the root of a drive/filesystem (x: in Windows, / in Linux)
Hi clawson, my problem is I've hit the 8K limit on compilers object list. So I want to take address for example, "
obj-y += examples/rtos/fior_am/hal/context.o
and change it to the following using a relative address.
EXAMPLEPATH = examples/rtos/
obj-y += EXAMPLEPATH/hal/context.o
I was told to use relative paths in the make file to get around the 8k object list make.exe. If I use the below it simple replaces the label which is not what I want to do.
RTOS := examples/rtos
obj-y += $(RTOS)/fior_am/hal/context.o
As I understand OP's motivation,
an attempt to run make resulted in an error
message that a list object was more than 8K.
OP is trying to reduce the size of the object file list by using relative paths.
Is this correct?
More information would be nice.
The actual file and the error message would be especially good.
My crystal ball does not tell me whether the
offending list object is actually a list of object files.
Where is make being run? A source directory? a sub-directory? somewhere else?
How does it know where source file are and the object files belong?
Usually either source files or object files are easy enough to refer to with relative paths.
All OPs examples use relative paths.
If obj-y really is the offending list object,
OP will need a shorter way to say things like examples/rtos/fior_am/hal/context.o .
If OP has an OS that supports them,
a soft link to examples/rtog/fior_am/hal might be in order.
Moderation in all things. -- ancient proverb
I can't remember the details but doesn't Makefile have the concept of "VPATH" or something like that? so you can set that (a bit like "cd...") and then the paths to local objects can be shorter being relative to that anchor point.
(personally I'd put the effort into learning CMake not Makefiles and let CMake handle all the Makefile generation problems that might occur!)
EDIT : see https://www.cmcrossroads.com/article/basics-vpath-and-vpath
GNU make has the --directory option that
affects its notion of the working directory.
That in turn affects how relative file paths
(source and object) are interpreted.
If object and source directories are not related,
either source files or object files are likely to have long prefixes.
Of course, /tmp/foo is a short prefix.
I do not remember exactly what vpath and VPATH do,
just that I didn't like it.
Their interpretations depend on the contents of directories.
© 2022 Microchip Technology Inc.