Skip to content

Commit

Permalink
Ensuse that searching in proto dirs has predictable order:
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Igor Pashev committed Jan 30, 2013
1 parent c09ff05 commit 03f4feb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cibs-inst-root := /usr/share/cibs

include $(cibs-root)/rules/$(package).mk

version := 0.2.0
version := 0.3.0

install-stamp: rules-mogrify-stamp

Expand Down
1 change: 0 additions & 1 deletion rules/archive.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ ifeq (,$(__archive_mk))

.SECONDEXPANSION:

protodirs += $(sourcedir)
build-depends += archiver/gnu-tar

archive-validator := $(cibs-root)/scripts/validate-archive
Expand Down
4 changes: 2 additions & 2 deletions rules/autotools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)" \
Expand Down Expand Up @@ -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 $@
Expand Down
8 changes: 3 additions & 5 deletions rules/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down
2 changes: 0 additions & 2 deletions rules/git.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
# include guard
ifeq (,$(__git_mk))

protodirs += $(sourcedir)

build-depends += developer/versioning/git

download-stamp: check-build-dep-stamp
Expand Down
12 changes: 7 additions & 5 deletions rules/ips-manifest.mk
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,18 @@ pkg-define += \
-D build64="$(build64)" \

# Add $(protodir.<variant>) 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 \
Expand Down

0 comments on commit 03f4feb

Please sign in to comment.