Android.mk vs Application.mk
Asked Answered
S

2

21

I'm a little fuzzy about the use of Android.mk & Application.mk

I've tried reading APPLICATION-MK.HTML & ANDROID-MK.HTML in the documentation that comes with NDK, but still confused about the purpose of two makefiles.

I'll be really grateful to anyone who could help me understand this.

Sweettalk answered 29/4, 2011 at 18:33 Comment(0)
H
11

Each module requires one and only one Android.mk. If all you ever have is one module in your native application, the Application.mk is redundant (however there are a few things that can only be controlled by the Application.mk if you veer from default behavior). However, if you have many modules, ergo many Android.mk files in your project, than the Application.mk can be useful for providing application-wide settings that apply to ALL modules.

Hexone answered 4/4, 2012 at 16:47 Comment(1)
So... Application.mk is a "solution" and "Android.mk" is a project? (To use VIsualStudio terminology)Mismanage
K
3

Quote from docs/OVERVIEW.html

While an Android.mk file describes your modules to the build system, the Application.mk file describes your application itself. See the docs/APPLICATION-MK.html document to understand what this file allows you to do. This includes, among others:

  • The exact list of modules required by your application.

  • The CPU architecture(s) to generate machine code for.

  • Optional information, like whether you want a release or debug build, specific C or C++ compiler flags and others that should apply to all modules being built.

This file is optional: by default the NDK will provide one that simply builds all the modules listed from your Android.mk (and all the makefiles it includes) and target the default CPU ABI (armeabi).

hope it helps

Kruller answered 19/2, 2014 at 20:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.