blob: e62d7309902a3954e3aa3e2165ca4d1c571ec898 [file] [log] [blame]
micky38718f07ac2019-06-10 00:40:50 +02001#!/bin/bash
2#
3# Copyright (C) 2016 The CyanogenMod Project
4# (C) 2017 The LineageOS Project
5# (C) 2018 The Omnirom Project
6#
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18#
19
20set -e
21
22# Required!
23DEVICE=zenfone6
24VENDOR=asus
25
26INITIAL_COPYRIGHT_YEAR=2019
27
28# Load extractutils and do some sanity checks
29MY_DIR="${BASH_SOURCE%/*}"
30if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
31
32CM_ROOT="$MY_DIR"/../../..
33
34HELPER="$CM_ROOT"/vendor/omni/build/tools/extract_utils.sh
35if [ ! -f "$HELPER" ]; then
36 echo "Unable to find helper script at $HELPER"
37 exit 1
38fi
39. "$HELPER"
40
41# Initialize the helper
42setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT"
43
44# Copyright headers and guards
45write_headers "zenfone6"
46
47# The standard blobs
48write_makefiles "$MY_DIR"/proprietary-files.txt
49
50# Qualcomm BSP blobs - we put a conditional around here
51# in case the BSP is actually being built
52printf '\n%s\n' "ifeq (\$(QCPATH),)" >> "$PRODUCTMK"
53printf '\n%s\n' "ifeq (\$(QCPATH),)" >> "$ANDROIDMK"
54
55write_makefiles "$MY_DIR"/proprietary-files-qc.txt
56
57# Qualcomm performance blobs - conditional as well
58# in order to support Cyanogen OS builds
59cat << EOF >> "$PRODUCTMK"
60endif
61
62-include vendor/extra/devices.mk
63ifneq (\$(call is-qc-perf-target),true)
64EOF
65
66cat << EOF >> "$ANDROIDMK"
67endif
68
69ifneq (\$(TARGET_HAVE_QC_PERF),true)
70EOF
71
72write_makefiles "$MY_DIR"/proprietary-files-qc-perf.txt
73
74echo "endif" >> "$PRODUCTMK"
75
76cat << EOF >> "$ANDROIDMK"
77
78endif
79
80EOF
81
82# We are done!
83write_footers
84