blob: df5cf16a3283c885d14edc53ae7a98e625e0581d [file] [log] [blame]
Kristian H. Kristensen932f51d2020-07-28 15:25:49 -07001#!/bin/sh
2
3set -eu
4
5if [ ! -e .git ]; then
6 echo must run from top-level directory;
7 exit 1
8fi
9
10if [ ! -d platform-hardware-libhardware ]; then
11 git clone --depth 1 https://android.googlesource.com/platform/hardware/libhardware platform-hardware-libhardware
12 git clone --depth 1 https://android.googlesource.com/platform/system/core platform-system-core
13 git clone --depth 1 https://android.googlesource.com/platform/frameworks/native platform-frameworks-native
14fi
15
16dest=include/android_stub
17
18rm -rf ${dest}
19mkdir ${dest}
20
21
22# These directories contains mostly only the files we need, so copy wholesale
23
24cp -av platform-frameworks-native/libs/nativewindow/include/vndk \
25 platform-system-core/libsync/include/sync \
26 platform-system-core/libsync/include/ndk \
27 platform-system-core/libbacktrace/include/backtrace \
28 platform-system-core/libsystem/include/system \
29 platform-system-core/liblog/include/log \
30 platform-frameworks-native/libs/nativewindow/include/system \
31 platform-frameworks-native/libs/nativebase/include/nativebase \
32 ${dest}
33
34
35# We only need a few files from these big directories so just copy those
36
37mkdir ${dest}/hardware
38cp -av platform-hardware-libhardware/include/hardware/{hardware,gralloc,fb}.h ${dest}/hardware
39cp -av platform-frameworks-native/vulkan/include/hardware/hwvulkan.h ${dest}/hardware
40
41mkdir ${dest}/cutils
42cp -av platform-system-core/libcutils/include/cutils/{log,native_handle,properties}.h ${dest}/cutils
43
44
45# include/android has files from a few different projects
46
47mkdir ${dest}/android
48cp -av platform-frameworks-native/libs/nativewindow/include/android/* \
49 platform-frameworks-native/libs/arect/include/android/* \
50 platform-system-core/liblog/include/android/* \
51 platform-system-core/libsync/include/android/* \
52 ${dest}/android
53