diff mbox

[RFC,v2] tests: Do not use platform directory

Message ID 1399378478-19814-1-git-send-email-taras.kondratiuk@linaro.org
State Accepted
Headers show

Commit Message

Taras Kondratiuk May 6, 2014, 12:14 p.m. UTC
Test applications should not differ from any other ODP application in a way
they use ODP library and headers. They shall use them from DESTDIR. The fact
that they are placed in ODP repo do not allow them to abuse it. By using
directly library and includes from platform directly we break modularity.
Tests' Makefile must have information about platform's include directory
structure. So tests' Makefile should be updated every time structure changes.
Things get even worse if platform include directory structure differs
between implementations (which is a valid case).

Removing direct access to platform directory also makes hard to build
and install library from tests' Makefile. Only unconditional install is
possible, but this adds unnecessary overhead on each test build.
So this patch removes this ability.

Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
---

v1..v2: Remove an ability to build and install ODP library from tests' Makefile

v1: http://lists.linaro.org/pipermail/lng-odp/2014-May/000616.html

 Makefile          |    3 +--
 Makefile.inc      |    1 +
 test/Makefile.inc |   14 --------------
 3 files changed, 2 insertions(+), 16 deletions(-)
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 2512343..7d10fd5 100644
--- a/Makefile
+++ b/Makefile
@@ -5,9 +5,8 @@ 
 
 .DEFAULT_GOAL := default
 
-ODP_ROOT        = $(PWD)
+ODP_ROOT        = $(CURDIR)
 ODP_TESTS       = $(ODP_ROOT)/test
-export DESTDIR  = $(ODP_ROOT)/build
 
 include $(ODP_ROOT)/Makefile.inc
 
diff --git a/Makefile.inc b/Makefile.inc
index a5aeb8b..d725137 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -7,6 +7,7 @@  PLATFORM ?= linux-generic
 OBJ_DIR   = ./obj
 ODP_DIR   = $(ODP_ROOT)/platform/$(PLATFORM)
 
+export DESTDIR  = $(ODP_ROOT)/build
 
 CC     ?= gcc
 LD     ?= gcc
diff --git a/test/Makefile.inc b/test/Makefile.inc
index f001119..8536402 100644
--- a/test/Makefile.inc
+++ b/test/Makefile.inc
@@ -3,19 +3,5 @@ 
 #
 # SPDX-License-Identifier:	BSD-3-Clause
 
-ifdef DESTDIR
-
 ODP_LIB = $(DESTDIR)/lib/libodp.a
 EXTRA_CFLAGS += -I$(DESTDIR)/include
-EXTRA_CFLAGS += -I$(DESTDIR)/include/api
-
-else
-
-ODP_LIB = $(ODP_DIR)/lib/libodp.a
-EXTRA_CFLAGS += -I$(ODP_ROOT)/include
-EXTRA_CFLAGS += -I$(ODP_DIR)/include/api
-
-$(ODP_LIB):
-	@echo Building $@
-	$(MAKE) -C $(ODP_DIR) libs
-endif