Error: File not found – The proper way to fix dynamic paths.

A while back I wrote an article about the problem with using static paths in compiling, which I concluded with this statement:

“Long story short, fix your dynamic paths if they have an error. If you use an absolute path, be sure you don’t ever rename or move anything. Ever. Or at least take good notes so you know what to change.”

However, I now realize that I didn’t ever present the proper way to fix those paths! So, if you run into an error like this:

[CODE]
firmware/audience-es325-fw-eur.bin.gen.S: Assembler messages:
firmware/audience-es325-fw-eur.bin.gen.S:5: Error: file not found: /home/alaskalinuxuser/Documents/projects/phones/compile/cm13/kernel/samsung/jf/firmware/audience-es325-fw-eur.bin
make[3]: *** [firmware/audience-es325-fw-eur.bin.gen.o] Error 1
make[2]: *** [firmware] Error 2
make[2]: *** Waiting for unfinished jobs….
[/CODE]

Then you need to find a way to fix the path dynamically. The usual way to do that is to go to the Android.mk file for that module or part that you are compiling. In that file, you typically see something like this in the file:

[CODE]
LOCAL_SRC_FILES += \
place/folder/stuff/file1.h
place/folder/stuff/file2.h
place/folder/stuff/file3.c
[/CODE]

To which we would add this line:

[CODE]
LOCAL_SRC_FILES += \
place/folder/stuff/file1.h
place/folder/stuff/file2.h
place/folder/stuff/file3.c
kernel/samsung/jf/firmware/audience-es325-fw-eur.bin
[/CODE]

The key part to remember is that the starting point should be from the root directory where the compiling will take place. Note in my above example, I am in the CM13 folder, and I do not include that portion in the LOCAL_SRC_FILES argument, but everything after it. I hope that now makes a little more sense, then my previous writeup.

Linux – keep it simple.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s