summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--example/Makefile2
-rw-r--r--example/src1/Makefile2
-rw-r--r--example/src2/Makefile2
-rw-r--r--example/test/Makefile2
-rw-r--r--example/test2/Makefile2
-rw-r--r--makefiles/Makefile.tools10
6 files changed, 13 insertions, 7 deletions
diff --git a/example/Makefile b/example/Makefile
index 492c255..582fb69 100644
--- a/example/Makefile
+++ b/example/Makefile
@@ -9,7 +9,7 @@ COMPONENT_VERSION := 0.0.1
include build/makefiles/Makefile.tools
# Grab the core makefile
-include build/makefiles/Makefile.top
+include $(NSBUILD)/Makefile.top
# Add extra install rules for our pkg-config control file and the library itself
INSTALL_ITEMS := $(INSTALL_ITEMS) /lib/pkgconfig:lib$(COMPONENT).pc.in
diff --git a/example/src1/Makefile b/example/src1/Makefile
index f986d31..7787e4b 100644
--- a/example/src1/Makefile
+++ b/example/src1/Makefile
@@ -4,4 +4,4 @@ DIR_SOURCES := foo.c
DIR_INSTALL_ITEMS := /include:foo.h
# Grab the core makefile
-include build/makefiles/Makefile.subdir
+include $(NSBUILD)/Makefile.subdir
diff --git a/example/src2/Makefile b/example/src2/Makefile
index 2fc4c9e..e25d124 100644
--- a/example/src2/Makefile
+++ b/example/src2/Makefile
@@ -1,4 +1,4 @@
# Sources in this directory
DIR_SOURCES := bar.c
-include build/makefiles/Makefile.subdir
+include $(NSBUILD)/Makefile.subdir
diff --git a/example/test/Makefile b/example/test/Makefile
index a91e328..cb84c94 100644
--- a/example/test/Makefile
+++ b/example/test/Makefile
@@ -1,4 +1,4 @@
# Test sources in this directory
DIR_TEST_SOURCES := foo.c
-include build/makefiles/Makefile.subdir
+include $(NSBUILD)/Makefile.subdir
diff --git a/example/test2/Makefile b/example/test2/Makefile
index a91e328..cb84c94 100644
--- a/example/test2/Makefile
+++ b/example/test2/Makefile
@@ -1,4 +1,4 @@
# Test sources in this directory
DIR_TEST_SOURCES := foo.c
-include build/makefiles/Makefile.subdir
+include $(NSBUILD)/Makefile.subdir
diff --git a/makefiles/Makefile.tools b/makefiles/Makefile.tools
index 7a5cc63..922e690 100644
--- a/makefiles/Makefile.tools
+++ b/makefiles/Makefile.tools
@@ -35,6 +35,12 @@ ifeq ($(BUILD),)
endif
###############################################################################
+# Determine path used to load us, so we can locate other makefiles
+###############################################################################
+
+NSBUILD := $(dir $(lastword $(MAKEFILE_LIST)))
+
+###############################################################################
# Host/target platform detection
###############################################################################
@@ -415,7 +421,7 @@ ifeq ($(toolchain),)
endif
# TODO: It would be nice to avoid this hard-coded path
-include build/makefiles/Makefile.$(toolchain)
+include $(NSBUILD)/Makefile.$(toolchain)
###############################################################################
# Default assembler/compiler/linker/archiver flags
@@ -468,4 +474,4 @@ endif
# Package config macros
################################################################################
-include build/makefiles/Makefile.pkgconfig
+include $(NSBUILD)/Makefile.pkgconfig