Hi, Wonder if this is possible? We have a client that wants to keep his two domains separate and in different tenants and then sync on prem - 281479. This document explains the Application.mk build file used by ndk-build. We recommend that you read the Concepts page before this one. The Application.mk specifies project-wide settings for ndk-build. By default, it is located at jni/Application.mk, in your application's project directory. Note: Many of these parameters also have a per-module equivalent.
If you want to create a directory containing several subdirectories, or a directory tree, using the command line in Linux, generally you have to use the
mkdir
command several times. However, there is a faster way to do this.Let’s say we’ve created a directory called htg, and want to create four subdirectories within it. In a normal situation, we’d use the
mkdir
command to create the htg directory. Then, we’d need the cd
command to change to the new htg directory and, finally, we we’d use the mkdir
command again four times to create the four subdirectories.This can all be combined into one command, and we’ll show you how.
To create a new directory with multiple subdirectories you only need to type the following command at the prompt and press Enter (obviously, change the directory names to what you want).
The
-p
flag tells the mkdir
command to create the main directory first if it doesn’t already exist (htg, in our case). The words in the brackets are part of the “brace expansion list”. Each of the items in the brace expansion list is appended separately to the preceding path (htg/).For example, the above command is expanded into htg/articles, htg/images, htg/note, htg/done, all four of the subdirectories being created under the htg directory. As you can see in the screenshot below, it worked.
You can also use a brace expansion list in the
mkdir
command if you’re creating subdirectories in a directory that already exists, as shown below. In this example, the htg directory already exists so the subdirectories are simply added under that directory.You can also nest brace expansion lists in the
mkdir
command. For example, in the articles subdirectory under the htg directory, we want to create two subdirectories called new and rewritten. So, we type the following command at the prompt and press Enter.You can also use the full path if you want, as I’ve done in the example below:
The four subdirectories are created under the htg directory and then the two subdirectories, new and rewrites, are created under the articles subdirectory.
RELATED:How to Make a New Directory and Change to It with a Single Command in Linux
It’s that easy. You can also combine the
READ NEXTmkdir
command with the cd
command to make a directory and change to it with one command.- › How to Change the Language of an App on Your iPhone or iPad
- › How to Run and Control Background Processes on Linux
- › Why iPhone and iPad Apps Are Asking to Use Bluetooth
- › Protect Your Home Minecraft Server From DDOS Attacks with AWS
- › How to Copy and Paste Text at Linux’s Bash Shell
Active9 months ago
I understand that CFLAGS (or CXXFLAGS for C++) are for the compiler, whereas CPPFLAGS is used by the preprocessor.
But I still don't understand the difference.
I need to specify an include path for a header file that is included with #include -- because #include is a preprocessor directive, is the preprocessor (CPPFLAGS) the only thing I care about?
Under what circumstances do I need to give the compiler an extra include path?
In general, if the preprocessor finds and includes needed header files, why does it ever need to be told about extra include directories? What use is CFLAGS at all?
(In my case, I actually found that BOTH of these allow me to compile my program, which adds to the confusion... I can use CFLAGS OR CPPFLAGS to accomplish my goal (in autoconf context at least). What gives?)
Mateusz Piotrowski4,43166 gold badges3535 silver badges5757 bronze badges
EBMEBM65844 gold badges1010 silver badges1313 bronze badges
3 Answers
The implicit make rule for compiling a C program is
where the
$()
syntax expands the variables. As both CPPFLAGS
and CFLAGS
are used in the compiler call, which you use to define include paths is a matter of personal taste. For instance if foo.c
is a file in the current directorywill both call your compiler in exactly the same way, namely
The difference between the two comes into play when you have multiple languages which need the same include path, for instance if you have
bar.cpp
then trythen the compilations will be
as the C++ implicit rule also uses the
CPPFLAGS
variable.This difference gives you a good guide for which to use - if you want the flag to be used for all languages put it in
CPPFLAGS
, if it's for a specific language put it in CFLAGS
, CXXFLAGS
etc. Examples of the latter type include standard compliance or warning flags - you wouldn't want to pass -std=c99
to your C++ compiler!You might then end up with something like this in your makefile
Scott WalesScott Wales9,19244 gold badges2929 silver badges2929 bronze badges
The
CPPFLAGS
macro is the one to use to specify #include
directories.Both
CPPFLAGS
and CFLAGS
work in your case because the make
(1) rule combines both preprocessing and compiling in one command (so both macros are used in the command).You don't need to specify
Karl Richter.
as an include-directory if you use the form #include '...'
. You also don't need to specify the standard compiler include directory. You do need to specify all other include-directories.2,6811212 gold badges3333 silver badges8383 bronze badges
Steve EmmersonSteve Emmerson6,12044 gold badges2727 silver badges5353 bronze badges
Nikolai FetissovNikolai Fetissov72.8k1111 gold badges9595 silver badges153153 bronze badges