summaryrefslogtreecommitdiff
path: root/buildlib/defaults.mak
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:50:48 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:50:48 +0000
commit118a5e95e00908ec20759a240416c3775fddbf57 (patch)
treeb1245d80a73581fa3225f14a569a8707fd4be7ec /buildlib/defaults.mak
parentd7bccc73c61de8be73c71c4447b9a007ffb80834 (diff)
New make changes
Author: jgg Date: 1998-07-14 03:31:31 GMT New make changes
Diffstat (limited to 'buildlib/defaults.mak')
-rw-r--r--buildlib/defaults.mak27
1 files changed, 16 insertions, 11 deletions
diff --git a/buildlib/defaults.mak b/buildlib/defaults.mak
index 50f27de5a..adbaf2758 100644
--- a/buildlib/defaults.mak
+++ b/buildlib/defaults.mak
@@ -26,9 +26,21 @@
# but by explicly setting the BUILD variable. Make is invoked from
# within the source itself which is much more compatible with compilation
# environments.
+.SILENT:
-ifndef BUILD
-BUILD=$(BASE)/build
+# Search for the build directory
+ifdef BUILD
+BUILD_POSSIBLE = $(BUILD)
+else
+BUILD_POSSIBLE = $(BASE) $(BASE)/build
+endif
+
+BUILD:= $(foreach i,$(BUILD_POSSIBLE),$(wildcard $(i)/environment.mak))
+BUILD:= $(firstword $(dir $(BUILD)))
+
+ifeq ($(words $(BUILD)),0)
+error-all:
+ echo Can't find the build directory in $(BUILD_POSSIBLE) -- use BUILD=
endif
# Base definitions
@@ -57,15 +69,8 @@ SUBDIRS+=
HEADER_TARGETDIRS+=
# Options
-CXX = c++
-CC = cc
-CPPFLAGS+= -I$(INCLUDE)
-CXXFLAGS+= -Wall -g -fno-implicit-templates -fno-exceptions
-PICFLAGS+= -fPIC -DPIC
-LFLAGS+=
-INLINEDEPFLAG = -MD
-DEBIANDOC_HTML = yes
-DEBIANDOC_TEXT = yes
+include $(BUILD)/environment.mak
+CPPFLAGS+= -I$(BUILD)/include
# Phony rules. Other things hook these by appending to the dependency
# list