~ubuntu-branches/ubuntu/quantal/enigmail/quantal-security

« back to all changes in this revision

Viewing changes to config/makefiles/autotargets.mk

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2013-09-13 16:02:15 UTC
  • mfrom: (0.12.16)
  • Revision ID: package-import@ubuntu.com-20130913160215-u3g8nmwa0pdwagwc
Tags: 2:1.5.2-0ubuntu0.12.10.1
* New upstream release v1.5.2 for Thunderbird 24

* Build enigmail using a stripped down Thunderbird 17 build system, as it's
  now quite difficult to build the way we were doing previously, with the
  latest Firefox build system
* Add debian/patches/no_libxpcom.patch - Don't link against libxpcom, as it
  doesn't exist anymore (but exists in the build system)
* Add debian/patches/use_sdk.patch - Use the SDK version of xpt.py and
  friends
* Drop debian/patches/ipc-pipe_rename.diff (not needed anymore)
* Drop debian/patches/makefile_depth.diff (not needed anymore)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- makefile -*-
2
 
# vim:set ts=8 sw=8 sts=8 noet:
3
 
#
4
 
# This Source Code Form is subject to the terms of the Mozilla Public
5
 
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
6
 
# You can obtain one at http://mozilla.org/MPL/2.0/.
7
 
#
8
 
 
9
 
ifndef INCLUDED_AUTOTARGETS_MK #{
10
 
 
11
 
# Conditional does not wrap the entire file so multiple
12
 
# includes will be able to accumulate dependencies.
13
 
 
14
 
###########################################################################
15
 
#      AUTO_DEPS - A list of deps/targets drived from other macros.
16
 
###########################################################################
17
 
 
18
 
MKDIR ?= mkdir -p
19
 
TOUCH ?= touch
20
 
 
21
 
# declare for local use, rules.mk may not have been loaded
22
 
space = $(NULL) $(NULL)
23
 
 
24
 
# Deps will be considered intermediate when used as a pre-requisite for
25
 
# wildcard targets.  Inhibit their removal, mkdir -p is a standalone op.
26
 
.PRECIOUS: %/.mkdir.done
27
 
 
28
 
#########################
29
 
##---]  FUNCTIONS  [---##
30
 
#########################
31
 
 
32
 
# Squeeze can be overzealous, restore root for abspath
33
 
getPathPrefix =$(if $(filter /%,$(1)),/)
34
 
 
35
 
# Squeeze '//' from the path, easily created by string functions
36
 
_slashSqueeze =$(foreach val,$(getargv),$(call getPathPrefix,$(val))$(subst $(space),/,$(strip $(subst /,$(space),$(val)))))
37
 
 
38
 
# Squeeze extraneous directory slashes from the path
39
 
#  o protect embedded spaces within the path
40
 
#  o replace //+ sequences with /
41
 
slash_strip =\
42
 
  $(strip \
43
 
    $(subst <--[**]-->,$(space),\
44
 
        $(call _slashSqueeze,\
45
 
    $(subst $(space),<--[**]-->,$(1))\
46
 
  )))
47
 
 
48
 
# Extract directory path from a dependency file.
49
 
mkdir_stem =$(foreach val,$(getargv),$(subst /.mkdir.done,$(NULL),$(val)))
50
 
 
51
 
## Generate timestamp file for threadsafe directory creation
52
 
mkdir_deps =$(foreach dir,$(getargv),$(call slash_strip,$(dir)/.mkdir.done))
53
 
 
54
 
#######################
55
 
##---]  TARGETS  [---##
56
 
#######################
57
 
 
58
 
%/.mkdir.done: # mkdir -p -p => mkdir -p
59
 
        $(subst $(space)-p,$(null),$(MKDIR)) -p $(dir $@)
60
 
# Make the timestamp old enough for not being a problem with symbolic links
61
 
# targets depending on it. Use Jan 3, 1970 to accomodate any timezone where
62
 
# 197001010000 would translate to something older than epoch.
63
 
        @touch -t 197001030000 $@
64
 
 
65
 
# A handful of makefiles are attempting "mkdir dot".  Likely not intended
66
 
# or stale logic so add a stub target to handle the request and warn for now.
67
 
.mkdir.done:
68
 
ifndef NOWARN_AUTOTARGETS # {
69
 
        @echo "WARNING: $(MKDIR) -dot- requested by $(MAKE) -C $(CURDIR) $(MAKECMDGOALS)"
70
 
        @touch -t 197001030000 $@
71
 
endif #}
72
 
 
73
 
INCLUDED_AUTOTARGETS_MK = 1
74
 
endif #}
75
 
 
76
 
 
77
 
## Accumulate deps and cleanup
78
 
ifneq (,$(GENERATED_DIRS))
79
 
  tmpauto :=$(call mkdir_deps,GENERATED_DIRS)
80
 
  GENERATED_DIRS_DEPS +=$(tmpauto)
81
 
  GARBAGE_DIRS        +=$(GENERATED_DIRS)
82
 
endif
83
 
 
84
 
#################################################################
85
 
# One ring/dep to rule them all:
86
 
#   config/rules.mk::all target is available by default
87
 
#   Add $(AUTO_DEPS) as an explicit target dependency when needed.
88
 
#################################################################
89
 
 
90
 
AUTO_DEPS +=$(GENERATED_DIRS_DEPS)
91
 
 
92
 
# Complain loudly if deps have not loaded so getargv != $(NULL)
93
 
$(call requiredfunction,getargv)