From 2e68fae2ece88367b22175c45e36a0bc15e5a053 Mon Sep 17 00:00:00 2001
From: Stefan Kalkowski <stefan.kalkowski@genode-labs.com>
Date: Fri, 3 May 2019 23:35:45 +0200
Subject: [PATCH] os: name ahci_drv unambigously (ref #2190)

---
 repos/os/lib/mk/spec/exynos5/ahci_platform.mk    | 6 ------
 repos/os/lib/mk/spec/x86/ahci_platform.mk        | 6 ------
 repos/os/recipes/src/ahci_drv/content.mk         | 9 ---------
 repos/os/run/ahci_bench.run                      | 1 +
 repos/os/run/ahci_block.run                      | 1 +
 repos/os/run/block_tester.run                    | 2 ++
 repos/os/src/drivers/ahci/spec/exynos5/target.mk | 5 +++++
 repos/os/src/drivers/ahci/spec/x86/target.mk     | 5 +++++
 repos/os/src/drivers/ahci/target.inc             | 6 ++++++
 repos/os/src/drivers/ahci/target.mk              | 4 ----
 repos/ports/run/noux_fs.run                      | 2 ++
 11 files changed, 22 insertions(+), 25 deletions(-)
 delete mode 100644 repos/os/lib/mk/spec/exynos5/ahci_platform.mk
 delete mode 100644 repos/os/lib/mk/spec/x86/ahci_platform.mk
 create mode 100644 repos/os/src/drivers/ahci/spec/exynos5/target.mk
 create mode 100644 repos/os/src/drivers/ahci/spec/x86/target.mk
 create mode 100644 repos/os/src/drivers/ahci/target.inc
 delete mode 100644 repos/os/src/drivers/ahci/target.mk

diff --git a/repos/os/lib/mk/spec/exynos5/ahci_platform.mk b/repos/os/lib/mk/spec/exynos5/ahci_platform.mk
deleted file mode 100644
index bee43ed6da..0000000000
--- a/repos/os/lib/mk/spec/exynos5/ahci_platform.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-SRC_CC = platform.cc
-
-INC_DIR += $(REP_DIR)/src/drivers/ahci
-
-vpath platform.cc $(REP_DIR)/src/drivers/ahci/spec/exynos5
-
diff --git a/repos/os/lib/mk/spec/x86/ahci_platform.mk b/repos/os/lib/mk/spec/x86/ahci_platform.mk
deleted file mode 100644
index 9771ea1dd3..0000000000
--- a/repos/os/lib/mk/spec/x86/ahci_platform.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-SRC_CC = platform.cc
-
-INC_DIR += $(REP_DIR)/src/drivers/ahci
-
-vpath platform.cc $(REP_DIR)/src/drivers/ahci/spec/x86
-
diff --git a/repos/os/recipes/src/ahci_drv/content.mk b/repos/os/recipes/src/ahci_drv/content.mk
index 701ac3c7d0..4ef6184230 100644
--- a/repos/os/recipes/src/ahci_drv/content.mk
+++ b/repos/os/recipes/src/ahci_drv/content.mk
@@ -1,11 +1,2 @@
 SRC_DIR = src/drivers/ahci
 include $(GENODE_DIR)/repos/base/recipes/src/content.inc
-
-MIRROR_FROM_REP_DIR := lib/mk/spec/x86/ahci_platform.mk \
-                       lib/mk/spec/exynos5/ahci_platform.mk
-
-content: $(MIRROR_FROM_REP_DIR)
-
-$(MIRROR_FROM_REP_DIR):
-	$(mirror_from_rep_dir)
-
diff --git a/repos/os/run/ahci_bench.run b/repos/os/run/ahci_bench.run
index 98d551bef1..4b46c63c07 100644
--- a/repos/os/run/ahci_bench.run
+++ b/repos/os/run/ahci_bench.run
@@ -1,3 +1,4 @@
+assert_spec x86
 
 set mke2fs [installed_command mke2fs]
 set dd     [installed_command dd]
diff --git a/repos/os/run/ahci_block.run b/repos/os/run/ahci_block.run
index 10933e05bf..a92393e38a 100644
--- a/repos/os/run/ahci_block.run
+++ b/repos/os/run/ahci_block.run
@@ -1,3 +1,4 @@
+assert_spec x86
 
 set mke2fs [installed_command mke2fs]
 set dd     [installed_command dd]
diff --git a/repos/os/run/block_tester.run b/repos/os/run/block_tester.run
index fcabd63d4c..705653d1d5 100644
--- a/repos/os/run/block_tester.run
+++ b/repos/os/run/block_tester.run
@@ -1,3 +1,5 @@
+assert_spec x86
+
 set use_linux [have_spec linux]
 
 #
diff --git a/repos/os/src/drivers/ahci/spec/exynos5/target.mk b/repos/os/src/drivers/ahci/spec/exynos5/target.mk
new file mode 100644
index 0000000000..78df145643
--- /dev/null
+++ b/repos/os/src/drivers/ahci/spec/exynos5/target.mk
@@ -0,0 +1,5 @@
+TARGET   = exynos5_ahci_drv
+REQUIRES = arm_v7
+INC_DIR  = $(call select_from_repositories,include/spec/exynos5)
+
+include $(REP_DIR)/src/drivers/ahci/target.inc
diff --git a/repos/os/src/drivers/ahci/spec/x86/target.mk b/repos/os/src/drivers/ahci/spec/x86/target.mk
new file mode 100644
index 0000000000..6cf2512e5f
--- /dev/null
+++ b/repos/os/src/drivers/ahci/spec/x86/target.mk
@@ -0,0 +1,5 @@
+TARGET   = ahci_drv
+REQUIRES = x86
+
+include $(REP_DIR)/src/drivers/ahci/target.inc
+
diff --git a/repos/os/src/drivers/ahci/target.inc b/repos/os/src/drivers/ahci/target.inc
new file mode 100644
index 0000000000..295ae130b6
--- /dev/null
+++ b/repos/os/src/drivers/ahci/target.inc
@@ -0,0 +1,6 @@
+SRC_CC  += main.cc ahci.cc platform.cc
+INC_DIR += $(REP_DIR)/src/drivers/ahci
+LIBS    += base
+
+vpath platform.cc $(PRG_DIR)
+vpath %.cc        $(REP_DIR)/src/drivers/ahci
diff --git a/repos/os/src/drivers/ahci/target.mk b/repos/os/src/drivers/ahci/target.mk
deleted file mode 100644
index 940b5cc2de..0000000000
--- a/repos/os/src/drivers/ahci/target.mk
+++ /dev/null
@@ -1,4 +0,0 @@
-TARGET   = ahci_drv
-SRC_CC   = main.cc ahci.cc
-INC_DIR += $(PRG_DIR)
-LIBS    += base ahci_platform
diff --git a/repos/ports/run/noux_fs.run b/repos/ports/run/noux_fs.run
index 6807fc7c96..e43d5cd26d 100644
--- a/repos/ports/run/noux_fs.run
+++ b/repos/ports/run/noux_fs.run
@@ -1,3 +1,5 @@
+assert_spec x86
+
 set genext2fs [installed_command genext2fs]
 set e2fsck [installed_command e2fsck]