blob: 43473d8a2894ef9b255d84221cbd797d334317a5 [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 \
Eric Anholte92f4ac2020-09-22 10:55:53 -070030 platform-frameworks-native/libs/nativewindow/include/apex \
Kristian H. Kristensen932f51d2020-07-28 15:25:49 -070031 platform-frameworks-native/libs/nativewindow/include/system \
32 platform-frameworks-native/libs/nativebase/include/nativebase \
33 ${dest}
34
35
36# We only need a few files from these big directories so just copy those
37
38mkdir ${dest}/hardware
Eric Anholte92f4ac2020-09-22 10:55:53 -070039cp -av platform-hardware-libhardware/include/hardware/{hardware,gralloc,gralloc1,fb}.h ${dest}/hardware
Kristian H. Kristensen932f51d2020-07-28 15:25:49 -070040cp -av platform-frameworks-native/vulkan/include/hardware/hwvulkan.h ${dest}/hardware
41
42mkdir ${dest}/cutils
43cp -av platform-system-core/libcutils/include/cutils/{log,native_handle,properties}.h ${dest}/cutils
44
45
46# include/android has files from a few different projects
47
48mkdir ${dest}/android
49cp -av platform-frameworks-native/libs/nativewindow/include/android/* \
50 platform-frameworks-native/libs/arect/include/android/* \
51 platform-system-core/liblog/include/android/* \
52 platform-system-core/libsync/include/android/* \
53 ${dest}/android
54