diff options
| author | Xavier Ducrohet <xav@google.com> | 2014-03-06 12:15:25 -0800 |
|---|---|---|
| committer | Xavier Ducrohet <xav@google.com> | 2014-05-15 10:24:03 -0700 |
| commit | 0a55da438e6076a93e2bd7d69384a1d4565a251f (patch) | |
| tree | 2a20987f06651e2b8ad6aa66e2395c9f894492eb /emulator/mksdcard | |
| parent | 13ed8257042b3d5229518aa5f686eb9eff3755e0 (diff) | |
| download | sdk-0a55da438e6076a93e2bd7d69384a1d4565a251f.zip sdk-0a55da438e6076a93e2bd7d69384a1d4565a251f.tar.gz sdk-0a55da438e6076a93e2bd7d69384a1d4565a251f.tar.bz2 | |
Build mksdcard for mac/linux with Gradle.
Change-Id: Ie7db983ab953ee3820189e9eb0f4cf47fe40d1e5
Diffstat (limited to 'emulator/mksdcard')
| -rw-r--r-- | emulator/mksdcard/.gitignore | 3 | ||||
| -rw-r--r-- | emulator/mksdcard/Android.mk | 2 | ||||
| -rw-r--r-- | emulator/mksdcard/build.gradle | 62 | ||||
| -rw-r--r-- | emulator/mksdcard/src/source/mksdcard.c (renamed from emulator/mksdcard/mksdcard.c) | 0 |
4 files changed, 66 insertions, 1 deletions
diff --git a/emulator/mksdcard/.gitignore b/emulator/mksdcard/.gitignore new file mode 100644 index 0000000..4a78fc8 --- /dev/null +++ b/emulator/mksdcard/.gitignore @@ -0,0 +1,3 @@ +build +.gradle + diff --git a/emulator/mksdcard/Android.mk b/emulator/mksdcard/Android.mk index a5641b4..0547f00 100644 --- a/emulator/mksdcard/Android.mk +++ b/emulator/mksdcard/Android.mk @@ -5,7 +5,7 @@ LOCAL_PATH:= $(call my-dir) # host executable # include $(CLEAR_VARS) -LOCAL_SRC_FILES:= mksdcard.c +LOCAL_SRC_FILES:= src/source/mksdcard.c LOCAL_MODULE = mksdcard include $(BUILD_HOST_EXECUTABLE) diff --git a/emulator/mksdcard/build.gradle b/emulator/mksdcard/build.gradle new file mode 100644 index 0000000..6dd0aa0 --- /dev/null +++ b/emulator/mksdcard/build.gradle @@ -0,0 +1,62 @@ +apply plugin: 'c' +apply plugin: 'sdk-files' + +executables { + mksdcard {} +} + +sources { + mksdcard { + c { + source { + srcDir "src/source" + include "**/*.c" + } + } + } +} + +model { + platforms { + linux { + architecture "i386" + operatingSystem "linux" + } + darwin { + architecture "i386" + operatingSystem "osx" + } + } +} + +binaries.all { + // Define toolchain-specific compiler and linker options + + if (toolChain in Gcc) { + cCompiler.args "-O2" + linker.args "-S" + } +} + +sdk { + mac { + item( { getExeName("darwin") } ) { + executable true + builtBy 'darwinMksdcardExecutable' + } + } + linux { + item( { getExeName("linux") } ) { + executable true + builtBy 'linuxMksdcardExecutable' + } + } +} + +def getExeName(String platform) { + // binaries will return a set of binaries + def binaries = executables.mksdcard.binaries.matching { it.name == "${platform}MksdcardExecutable" } + // calling .exeFile on the set returns an array with the result from each item in the set... + return binaries.executableFile.get(0) +} + diff --git a/emulator/mksdcard/mksdcard.c b/emulator/mksdcard/src/source/mksdcard.c index c9a3eeb..c9a3eeb 100644 --- a/emulator/mksdcard/mksdcard.c +++ b/emulator/mksdcard/src/source/mksdcard.c |
