From 03f4febe81472ba2829443e9cb8ef418d9e6cc49 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Wed, 30 Jan 2013 13:52:21 +0400 Subject: Ensuse that searching in proto dirs has predictable order: 1. Top directory first 2. Variants' proto dirs in order variants are defined Remove source dir from proto dirs, but add $(sourcedir) to IPS defines, so one can write: file $(sourcedir)/README path=/usr/share/doc/foo/README --- rules/archive.mk | 1 - rules/autotools.mk | 4 ++-- rules/common.mk | 8 +++----- rules/git.mk | 2 -- rules/ips-manifest.mk | 12 +++++++----- 5 files changed, 12 insertions(+), 15 deletions(-) (limited to 'rules') diff --git a/rules/archive.mk b/rules/archive.mk index 04f5a13..6811e9a 100644 --- a/rules/archive.mk +++ b/rules/archive.mk @@ -26,7 +26,6 @@ ifeq (,$(__archive_mk)) .SECONDEXPANSION: -protodirs += $(sourcedir) build-depends += archiver/gnu-tar archive-validator := $(cibs-root)/scripts/validate-archive diff --git a/rules/autotools.mk b/rules/autotools.mk index 0e51401..d9b76b6 100644 --- a/rules/autotools.mk +++ b/rules/autotools.mk @@ -27,7 +27,7 @@ ifeq (,$(__autotools_mk)) include $(cibs-root)/rules/common.mk -configure := $(sourcedir)/configure +configure := $(topdir)/$(sourcedir)/configure configure-env = \ CC="$(CC)" \ CXX="$(CXX)" \ @@ -62,7 +62,7 @@ build-%-stamp: touch $@ install-%-stamp: target = install -install-%-stamp: make-vars = DESTDIR="$(protodir)" +install-%-stamp: make-vars = DESTDIR="$(topdir)/$(protodir)" install-%-stamp: cd "$(builddir)" && $(MAKE) $(target) $(make-vars) touch $@ diff --git a/rules/common.mk b/rules/common.mk index 3ab7f74..fa30a57 100644 --- a/rules/common.mk +++ b/rules/common.mk @@ -18,7 +18,7 @@ # CDDL HEADER END # # -# Copyright (C) 2012, Nexenta Systems, Inc. All rights reserved. +# Copyright (C) 2012, 2013. Nexenta Systems, Inc. All rights reserved. # # include guard: @@ -42,13 +42,11 @@ mach64 := amd64 variants := -workdir-base := work -workdir := $(CURDIR)/$(workdir-base) +topdir := $(CURDIR) +workdir := work sourcedir := $(workdir)/source define add-variant -protodir-base.$1 = $(workdir-base)/proto/$1 -builddir-base.$1 = $(workdir-base)/build/$1 protodir.$1 = $(workdir)/proto/$1 builddir.$1 = $(workdir)/build/$1 diff --git a/rules/git.mk b/rules/git.mk index 23a96c7..b631f1a 100644 --- a/rules/git.mk +++ b/rules/git.mk @@ -24,8 +24,6 @@ # include guard ifeq (,$(__git_mk)) -protodirs += $(sourcedir) - build-depends += developer/versioning/git download-stamp: check-build-dep-stamp diff --git a/rules/ips-manifest.mk b/rules/ips-manifest.mk index d2b2907..3bea4be 100644 --- a/rules/ips-manifest.mk +++ b/rules/ips-manifest.mk @@ -49,16 +49,18 @@ pkg-define += \ -D build64="$(build64)" \ # Add $(protodir.) to use in manifest: -# file $(protodir.64) path=usr/include/header.64.h -pkg-define += $(foreach _,$(variants),-D protodir.$(_)="$(protodir-base.$(_))") +# file $(protodir.64)/usr/include/header.h path=usr/include/header.64.h +pkg-define += $(foreach _,$(variants),-D protodir.$(_)="$(protodir.$(_))") # Same for $(builddir.xxx): -pkg-define += $(foreach _,$(variants),-D builddir.$(_)="$(builddir-base.$(_))") +pkg-define += $(foreach _,$(variants),-D builddir.$(_)="$(builddir.$(_))") + +pkg-define += -D sourcedir="$(sourcedir)" # Where to find files: -pkg-protos = $(protodirs:%=-d "%") +pkg-protos = -d . +pkg-protos += $(protodirs:%=-d "%") pkg-protos += $(foreach _,$(variants),-d "$(protodir.$(_))") -pkg-protos += -d . transformations := \ $(transdir)/defaults \ -- cgit v1.2.3