1*dbb5c420SAndroid Build Coastguard Worker#!/usr/bin/env bash 2*dbb5c420SAndroid Build Coastguard Worker 3*dbb5c420SAndroid Build Coastguard Worker# Copyright 2014 The Android Open Source Project 4*dbb5c420SAndroid Build Coastguard Worker# 5*dbb5c420SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 6*dbb5c420SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 7*dbb5c420SAndroid Build Coastguard Worker# You may obtain a copy of the License at 8*dbb5c420SAndroid Build Coastguard Worker# 9*dbb5c420SAndroid Build Coastguard Worker# http://www.apache.org/licenses/LICENSE-2.0 10*dbb5c420SAndroid Build Coastguard Worker# 11*dbb5c420SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 12*dbb5c420SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 13*dbb5c420SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14*dbb5c420SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 15*dbb5c420SAndroid Build Coastguard Worker# limitations under the License. 16*dbb5c420SAndroid Build Coastguard Worker 17*dbb5c420SAndroid Build Coastguard Workerif test "$1" = "" -o "$2" = "" 18*dbb5c420SAndroid Build Coastguard Workerthen 19*dbb5c420SAndroid Build Coastguard Worker echo "Need a manufacturer name and a device name" 20*dbb5c420SAndroid Build Coastguard Worker exit 1 21*dbb5c420SAndroid Build Coastguard Workerfi 22*dbb5c420SAndroid Build Coastguard Worker 23*dbb5c420SAndroid Build Coastguard Workermkdir -p device/$1/$2 24*dbb5c420SAndroid Build Coastguard Workermkdir -p device/$1/$2-kernel 25*dbb5c420SAndroid Build Coastguard Workermkdir -p vendor/$1/$2 26*dbb5c420SAndroid Build Coastguard Worker 27*dbb5c420SAndroid Build Coastguard Workercat > device/$1/$2/AndroidProducts.mk << EOF 28*dbb5c420SAndroid Build Coastguard Worker# 29*dbb5c420SAndroid Build Coastguard Worker# Copyright 2014 The Android Open-Source Project 30*dbb5c420SAndroid Build Coastguard Worker# 31*dbb5c420SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 32*dbb5c420SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 33*dbb5c420SAndroid Build Coastguard Worker# You may obtain a copy of the License at 34*dbb5c420SAndroid Build Coastguard Worker# 35*dbb5c420SAndroid Build Coastguard Worker# http://www.apache.org/licenses/LICENSE-2.0 36*dbb5c420SAndroid Build Coastguard Worker# 37*dbb5c420SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 38*dbb5c420SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 39*dbb5c420SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 40*dbb5c420SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 41*dbb5c420SAndroid Build Coastguard Worker# limitations under the License. 42*dbb5c420SAndroid Build Coastguard Worker# 43*dbb5c420SAndroid Build Coastguard Worker 44*dbb5c420SAndroid Build Coastguard WorkerPRODUCT_MAKEFILES := \$(LOCAL_DIR)/full_$2.mk 45*dbb5c420SAndroid Build Coastguard Worker 46*dbb5c420SAndroid Build Coastguard WorkerCOMMON_LUNCH_CHOICES := full_$2-trunk_staging-userdebug 47*dbb5c420SAndroid Build Coastguard WorkerEOF 48*dbb5c420SAndroid Build Coastguard Worker 49*dbb5c420SAndroid Build Coastguard Workercat > device/$1/$2/full_$2.mk << EOF 50*dbb5c420SAndroid Build Coastguard Worker# 51*dbb5c420SAndroid Build Coastguard Worker# Copyright 2014 The Android Open-Source Project 52*dbb5c420SAndroid Build Coastguard Worker# 53*dbb5c420SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 54*dbb5c420SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 55*dbb5c420SAndroid Build Coastguard Worker# You may obtain a copy of the License at 56*dbb5c420SAndroid Build Coastguard Worker# 57*dbb5c420SAndroid Build Coastguard Worker# http://www.apache.org/licenses/LICENSE-2.0 58*dbb5c420SAndroid Build Coastguard Worker# 59*dbb5c420SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 60*dbb5c420SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 61*dbb5c420SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 62*dbb5c420SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 63*dbb5c420SAndroid Build Coastguard Worker# limitations under the License. 64*dbb5c420SAndroid Build Coastguard Worker# 65*dbb5c420SAndroid Build Coastguard Worker\$(call inherit-product, \$(SRC_TARGET_DIR)/product/full_base.mk) 66*dbb5c420SAndroid Build Coastguard Worker\$(call inherit-product, device/$1/$2/device.mk) 67*dbb5c420SAndroid Build Coastguard Worker 68*dbb5c420SAndroid Build Coastguard WorkerPRODUCT_NAME := full_$2 69*dbb5c420SAndroid Build Coastguard WorkerPRODUCT_DEVICE := $2 70*dbb5c420SAndroid Build Coastguard WorkerPRODUCT_BRAND := Android 71*dbb5c420SAndroid Build Coastguard WorkerPRODUCT_MODEL := $2 72*dbb5c420SAndroid Build Coastguard WorkerPRODUCT_MANUFACTURER := $1 73*dbb5c420SAndroid Build Coastguard WorkerEOF 74*dbb5c420SAndroid Build Coastguard Worker 75*dbb5c420SAndroid Build Coastguard Workercat > device/$1/$2/device.mk << EOF 76*dbb5c420SAndroid Build Coastguard Worker# 77*dbb5c420SAndroid Build Coastguard Worker# Copyright 2014 The Android Open-Source Project 78*dbb5c420SAndroid Build Coastguard Worker# 79*dbb5c420SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 80*dbb5c420SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 81*dbb5c420SAndroid Build Coastguard Worker# You may obtain a copy of the License at 82*dbb5c420SAndroid Build Coastguard Worker# 83*dbb5c420SAndroid Build Coastguard Worker# http://www.apache.org/licenses/LICENSE-2.0 84*dbb5c420SAndroid Build Coastguard Worker# 85*dbb5c420SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 86*dbb5c420SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 87*dbb5c420SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 88*dbb5c420SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 89*dbb5c420SAndroid Build Coastguard Worker# limitations under the License. 90*dbb5c420SAndroid Build Coastguard Worker# 91*dbb5c420SAndroid Build Coastguard Worker 92*dbb5c420SAndroid Build Coastguard Workerifeq (\$(TARGET_PREBUILT_KERNEL),) 93*dbb5c420SAndroid Build Coastguard WorkerLOCAL_KERNEL := device/$1/$2-kernel/kernel 94*dbb5c420SAndroid Build Coastguard Workerelse 95*dbb5c420SAndroid Build Coastguard WorkerLOCAL_KERNEL := \$(TARGET_PREBUILT_KERNEL) 96*dbb5c420SAndroid Build Coastguard Workerendif 97*dbb5c420SAndroid Build Coastguard Worker 98*dbb5c420SAndroid Build Coastguard WorkerPRODUCT_COPY_FILES := \\ 99*dbb5c420SAndroid Build Coastguard Worker \$(LOCAL_KERNEL):kernel 100*dbb5c420SAndroid Build Coastguard Worker 101*dbb5c420SAndroid Build Coastguard Worker\$(call inherit-product-if-exists, vendor/$1/$2/device-vendor.mk) 102*dbb5c420SAndroid Build Coastguard WorkerEOF 103*dbb5c420SAndroid Build Coastguard Worker 104*dbb5c420SAndroid Build Coastguard Workercat > device/$1/$2/BoardConfig.mk << EOF 105*dbb5c420SAndroid Build Coastguard Worker# 106*dbb5c420SAndroid Build Coastguard Worker# Copyright 2014 The Android Open-Source Project 107*dbb5c420SAndroid Build Coastguard Worker# 108*dbb5c420SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 109*dbb5c420SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 110*dbb5c420SAndroid Build Coastguard Worker# You may obtain a copy of the License at 111*dbb5c420SAndroid Build Coastguard Worker# 112*dbb5c420SAndroid Build Coastguard Worker# http://www.apache.org/licenses/LICENSE-2.0 113*dbb5c420SAndroid Build Coastguard Worker# 114*dbb5c420SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 115*dbb5c420SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 116*dbb5c420SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 117*dbb5c420SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 118*dbb5c420SAndroid Build Coastguard Worker# limitations under the License. 119*dbb5c420SAndroid Build Coastguard Worker# 120*dbb5c420SAndroid Build Coastguard Worker 121*dbb5c420SAndroid Build Coastguard Worker# Use the non-open-source parts, if they're present 122*dbb5c420SAndroid Build Coastguard Worker-include vendor/$1/$2/BoardConfigVendor.mk 123*dbb5c420SAndroid Build Coastguard Worker 124*dbb5c420SAndroid Build Coastguard WorkerTARGET_ARCH := arm 125*dbb5c420SAndroid Build Coastguard WorkerTARGET_ARCH_VARIANT := armv7-a-neon 126*dbb5c420SAndroid Build Coastguard WorkerTARGET_CPU_ABI := armeabi-v7a 127*dbb5c420SAndroid Build Coastguard WorkerTARGET_CPU_ABI2 := armeabi 128*dbb5c420SAndroid Build Coastguard WorkerEOF 129*dbb5c420SAndroid Build Coastguard Worker 130*dbb5c420SAndroid Build Coastguard Workertouch device/$1/$2-kernel/kernel 131*dbb5c420SAndroid Build Coastguard Workertouch device/$1/$2-kernel/MODULE_LICENSE_GPL 132*dbb5c420SAndroid Build Coastguard Worker 133*dbb5c420SAndroid Build Coastguard Workercat > vendor/$1/$2/device-vendor.mk << EOF 134*dbb5c420SAndroid Build Coastguard Worker# 135*dbb5c420SAndroid Build Coastguard Worker# Copyright 2014 The Android Open-Source Project 136*dbb5c420SAndroid Build Coastguard Worker# 137*dbb5c420SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 138*dbb5c420SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 139*dbb5c420SAndroid Build Coastguard Worker# You may obtain a copy of the License at 140*dbb5c420SAndroid Build Coastguard Worker# 141*dbb5c420SAndroid Build Coastguard Worker# http://www.apache.org/licenses/LICENSE-2.0 142*dbb5c420SAndroid Build Coastguard Worker# 143*dbb5c420SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 144*dbb5c420SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 145*dbb5c420SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 146*dbb5c420SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 147*dbb5c420SAndroid Build Coastguard Worker# limitations under the License. 148*dbb5c420SAndroid Build Coastguard Worker# 149*dbb5c420SAndroid Build Coastguard WorkerEOF 150*dbb5c420SAndroid Build Coastguard Worker 151*dbb5c420SAndroid Build Coastguard Workercat > vendor/$1/$2/BoardConfigVendor.mk << EOF 152*dbb5c420SAndroid Build Coastguard Worker# 153*dbb5c420SAndroid Build Coastguard Worker# Copyright 2014 The Android Open-Source Project 154*dbb5c420SAndroid Build Coastguard Worker# 155*dbb5c420SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 156*dbb5c420SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 157*dbb5c420SAndroid Build Coastguard Worker# You may obtain a copy of the License at 158*dbb5c420SAndroid Build Coastguard Worker# 159*dbb5c420SAndroid Build Coastguard Worker# http://www.apache.org/licenses/LICENSE-2.0 160*dbb5c420SAndroid Build Coastguard Worker# 161*dbb5c420SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 162*dbb5c420SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 163*dbb5c420SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 164*dbb5c420SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 165*dbb5c420SAndroid Build Coastguard Worker# limitations under the License. 166*dbb5c420SAndroid Build Coastguard Worker# 167*dbb5c420SAndroid Build Coastguard WorkerEOF 168*dbb5c420SAndroid Build Coastguard Worker 169