targets: moved boot and partition-table into board

Boot and partition-table targets need to be board specific.

Change-Id: I082a42a082a156b315099229e0758ffc9afd5668
diff --git a/Makefile b/Makefile
index 1028233..dadc731 100644
--- a/Makefile
+++ b/Makefile
@@ -37,14 +37,16 @@
 	@echo "Targets available for building in this Makefile:"
 	@echo
 
-include $(ROOTDIR)/build/boot.mk
+include $(ROOTDIR)/board/boot.mk
+include $(ROOTDIR)/board/partition-table.mk
+
 include $(ROOTDIR)/build/img2simg.mk
-include $(ROOTDIR)/build/partition-table.mk
 include $(ROOTDIR)/build/prereqs.mk
 include $(ROOTDIR)/build/rootfs.mk
 include $(ROOTDIR)/build/docker.mk
 include $(ROOTDIR)/build/packages.mk
 
+ 
 include $(ROOTDIR)/board/bootloader.mk
 -include $(ROOTDIR)/board/sdcard.mk
 -include $(ROOTDIR)/board/recovery.mk
diff --git a/boot.mk b/boot.mk
deleted file mode 100644
index e49f85d..0000000
--- a/boot.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2018 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-ifeq ($(ROOTDIR),)
-$(error $$ROOTDIR IS NOT DEFINED -- don\'t forget to source setup.sh)
-endif
-
-include $(ROOTDIR)/build/preamble.mk
-
-boot: $(PRODUCT_OUT)/boot_$(USERSPACE_ARCH).img
-
-$(PRODUCT_OUT)/boot_$(USERSPACE_ARCH).img: | out-dirs
-	$(LOG) boot fallocate
-	fallocate -l $(BOOT_SIZE_MB)M $@
-	mkfs.ext2 -F $@
-	$(LOG) boot finished
-
-targets::
-	@echo "boot - builds the kernel and boot partition"
-
-clean::
-	rm -f $(PRODUCT_OUT)/boot_*.img
-
-.PHONY:: boot
diff --git a/partition-table.mk b/partition-table.mk
deleted file mode 100644
index 40f2047..0000000
--- a/partition-table.mk
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright 2018 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-ifeq ($(ROOTDIR),)
-$(error $$ROOTDIR IS NOT DEFINED -- don\'t forget to source setup.sh)
-endif
-
-include $(ROOTDIR)/build/preamble.mk
-
-BPTTOOL := $(ROOTDIR)/tools/bpt/bpttool
-MMC_8GB  := 7818182656
-MMC_16GB := 15634268160
-MMC_64GB := 62537072640
-
-SOURCE_JSON := $(ROOTDIR)/board/partition-table.json
-TARGET_8GB_JSON  := $(PRODUCT_OUT)/partition-table-8gb.json
-TARGET_8GB_IMG   := $(PRODUCT_OUT)/partition-table-8gb.img
-TARGET_16GB_JSON := $(PRODUCT_OUT)/partition-table-16gb.json
-TARGET_16GB_IMG  := $(PRODUCT_OUT)/partition-table-16gb.img
-TARGET_64GB_JSON := $(PRODUCT_OUT)/partition-table-64gb.json
-TARGET_64GB_IMG  := $(PRODUCT_OUT)/partition-table-64gb.img
-
-partition-table: \
-  $(TARGET_8GB_JSON) $(TARGET_8GB_IMG) \
-  $(TARGET_16GB_JSON) $(TARGET_16GB_IMG) \
-  $(TARGET_64GB_JSON) $(TARGET_64GB_IMG)
-
-# 8GB
-$(TARGET_8GB_JSON): $(SOURCE_JSON)
-$(TARGET_8GB_JSON): MMC_SIZE = $(MMC_8GB)
-$(TARGET_8GB_IMG): $(SOURCE_JSON)
-$(TARGET_8GB_IMG): MMC_SIZE = $(MMC_8GB)
-
-# 16GB
-$(TARGET_16GB_JSON): $(SOURCE_JSON)
-$(TARGET_16GB_JSON): MMC_SIZE = $(MMC_16GB)
-$(TARGET_16GB_IMG): $(SOURCE_JSON)
-$(TARGET_16GB_IMG): MMC_SIZE = $(MMC_16GB)
-
-# 64GB
-$(TARGET_64GB_JSON): $(SOURCE_JSON)
-$(TARGET_64GB_JSON): MMC_SIZE = $(MMC_64GB)
-$(TARGET_64GB_IMG): $(SOURCE_JSON)
-$(TARGET_64GB_IMG): MMC_SIZE = $(MMC_64GB)
-
-$(PRODUCT_OUT)/partition-table-%.json: $(SOURCE_JSON)
-	mkdir -p $(@D)
-	$(BPTTOOL) make_table --disk_size $(MMC_SIZE) --input $< --output_json $@
-
-$(PRODUCT_OUT)/partition-table-%.img: $(SOURCE_JSON)
-	mkdir -p $(@D)
-	$(BPTTOOL) make_table --disk_size $(MMC_SIZE) --input $< --output_gpt $@
-
-targets::
-	@echo "partition-table - builds partition table images for all eMMC sizes"
-
-clean::
-	rm -f $(PRODUCT_OUT)/partition-table-*.json
-	rm -f $(PRODUCT_OUT)/partition-table-*.img
-
-.PHONY:: partition-table
diff --git a/rootfs.mk b/rootfs.mk
index 845afad..09235d3 100644
--- a/rootfs.mk
+++ b/rootfs.mk
@@ -127,7 +127,7 @@
 
 ROOTFS_PATCHED_DEPS := $(ROOTFS_RAW_IMG) \
                        $(ROOTDIR)/board/fstab.emmc \
-                       $(ROOTDIR)/build/boot.mk
+                       $(ROOTDIR)/board/boot.mk
 
 ifeq ($(FETCH_PACKAGES),false)
     ROOTFS_PATCHED_DEPS += $(ROOTDIR)/cache/packages.tgz