From 7bc56df125dc3d20e90dcdf2b9d4a86791a97e43 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 17 Jun 2003 18:13:22 +0000 Subject: [PATCH] CP = copyattr --data, under BeOS. Added general installation rules OBOSInstall, OBOSInstall{Abs,Rel}SymLink. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3556 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- Jamrules | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/Jamrules b/Jamrules index 1080c2be82..ce99edbce0 100644 --- a/Jamrules +++ b/Jamrules @@ -144,6 +144,12 @@ KEEPOBJS = true ; AR = ar r ; +# under BeOS use copyattr instead of cp +if $(OS) = BEOS +{ + CP = copyattr --data ; +} + # If no OBOS_OBJECT_TARGET is not defined yet, use our default directory and # include our "OBOS_TARGET" as subdirectory in there (to prevent different # builds mixing objects from different targets). @@ -1166,7 +1172,7 @@ rule RelSymLink rule AbsSymLink { - # RelSymLink : : + # AbsSymLink : : # Creates an absolute symbolic link from to . # and must be usual targets. If is # given, then it is set as LOCATE directory on . @@ -1190,6 +1196,78 @@ actions AbsSymLink $(RM) "$(1)" && $(LN) -s "$target" "$(1)" } +rule OBOSInstall +{ + # Usage: OBOSInstall <[ install [ and uninstall ] pseudotarget ]> + # : : + # : [ ] : [ ] ; + local install = $(1[1]) ; + install ?= install ; + local uninstall = $(1[2]) ; + uninstall ?= un$(install) ; + local dir = $(2) ; + local sources = $(3) ; + local installgrist = $(4) ; + installgrist ?= $(INSTALLGRIST) ; + local installRule = $(5) ; + installRule ?= Install ; + local targets = $(sources:G=$(installgrist)) ; + + Depends $(install) : $(targets) ; + Clean $(uninstall) : $(targets) ; + + SEARCH on $(sources) += $(SEARCH_SOURCE) ; + MakeLocate $(targets) : $(dir) ; + + local source ; + for source in $(sources) { + local target = $(source:G=$(installgrist)) ; + + Depends $(target) : $(source) ; + $(installRule) $(target) : $(source) ; + + if [ on $(target) return $(MODE) ] { + Chmod $(target) ; + } + + if $(OWNER) && $(CHOWN) { + Chown $(target) ; + OWNER on $(target) = $(OWNER) ; + } + + if $(GROUP) && $(CHGRP) { + Chgrp $(target) ; + GROUP on $(target) = $(GROUP) ; + } + } +} + +rule OBOSInstallAbsSymLink +{ + # Usage: OBOSInstallAbsSymLink <[ install [ and uninstall ] pseudotarget ]> + # : : + # : [ ] ; + OBOSInstall $(1) : $(2) : $(3) : $(4) : AbsSymLink ; +} + +rule InstallRelSymLinkAdapter +{ + # InstallRelSymLinkAdapter : + if ! [ on $(2) return $(TARGET) ] { + TARGET on $(2) = [ on $(2) return $(SEARCH) ] ; + } + RelSymLink $(1) : $(2) ; +} + +rule OBOSInstallRelSymLink +{ + # Usage: OBOSInstallRelSymLink <[ install [ and uninstall ] pseudotarget ]> + # : : + # : [ ] ; + OBOSInstall $(1) : $(2) : $(3) : $(4) : InstallRelSymLinkAdapter ; +} + + #------------------------------------------------------------------------------- # Low-level OBOS utility rules #-------------------------------------------------------------------------------