]> git.saurik.com Git - apt.git/blobdiff - buildlib/defaults.mak
Compile of apt-cache
[apt.git] / buildlib / defaults.mak
index b268c4b9b998e44e6f56551a3443573ed69d6e7e..e5a63fc1b5f1f718e6caddc1b00da3dc29722bfc 100644 (file)
 # 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:= $(patsubst %/,%,$(firstword $(dir $(BUILD))))
+
+ifeq ($(words $(BUILD)),0)
+error-all:
+       echo Can't find the build directory in $(BUILD_POSSIBLE) -- use BUILD=
 endif
 
 # Base definitions
@@ -37,9 +49,13 @@ BIN := $(BUILD)/bin
 LIB := $(BIN)
 OBJ := $(BUILD)/obj
 DEP := $(OBJ)
+DOC := $(BUILD)/doc
 
 # Module types
-LIBRARY_H=$(BASE)/buildlib/library.mak
+LIBRARY_H = $(BASE)/buildlib/library.mak
+DEBIANDOC_H = $(BASE)/buildlib/debiandoc.mak
+MANPAGE_H = $(BASE)/buildlib/manpage.mak
+PROGRAM_H = $(BASE)/buildlib/program.mak
 
 # Source location control
 # SUBDIRS specifies sub components of the module that
@@ -54,19 +70,16 @@ SUBDIRS+=
 HEADER_TARGETDIRS+=
 
 # Options
-CXX = c++
-CC = cc
+include $(BUILD)/environment.mak
 CPPFLAGS+= -I$(INCLUDE)
-CXXFLAGS+= -Wall -g -fno-implicit-templates  -fno-exceptions
-PICFLAGS+= -fPIC -DPIC
-LFLAGS+= 
-INLINEDEPFLAG = -MD
+LDFLAGS+= -L$(LIB)
 
 # Phony rules. Other things hook these by appending to the dependency
 # list
-.PHONY: headers library clean veryclean all binary program
-all: binary
+.PHONY: headers library clean veryclean all binary program doc
+all: binary doc
 binary: library program
+maintainer-clean dist-clean: veryclean
 headers library clean veryclean program:
 
 # Header file control. We want all published interface headers to go