Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get environment variable value in Android.mk?

Any possibility to get environment variable value inside Android.mk?

For example

#export MYBASEDIR=/home/whoami/base

And, inside Android.mk How to get MYBASEDIR value ?

Bear with me for very basic question.

like image 506
Whoami Avatar asked Mar 15 '12 15:03

Whoami


People also ask

How do I read an environment variable in Makefile?

you can simply refer to it by name in the makefile ( make imports all the environment variables you have set): DEMOPATH = ${demoPath} # Or $(demoPath) if you prefer.

What is Android environment variable?

Android Studio configuration environment variables. The Android Studio configuration variables contain settings that customize the location of configuration files and the JDK. On start-up, Android Studio checks these variables for settings. For more information, see Configure Android Studio.

What is Android MK file in Android?

The Android.mk file resides in a subdirectory of your project's jni/ directory, and describes your sources and shared libraries to the build system. It is really a tiny GNU makefile fragment that the build system parses once or more.


1 Answers

All environment variables are imported by make as make macros automatically.

So, just use $(MYBASEDIR) in the makefile.

like image 187
MadScientist Avatar answered Nov 06 '22 16:11

MadScientist