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