Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 158 lines (127 sloc) 6.851 kb
9155727 @dinhviethoa import from CVS
dinhviethoa authored
1 # libEtPan! -- a mail stuff library
2 #
3 # Copyright (C) 2007 g10 Code GmbH
4 # All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
14 # 3. Neither the name of the libEtPan! project nor the names of its
15 # contributors may be used to endorse or promote products derived
16 # from this software without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
19 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
22 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 # SUCH DAMAGE.
29
30
31
32 # Description of the build system
33 # ===============================
34
35 # The build system uses automake and autoconf mostly in the usual way.
36 # A typical work flow for working with the SVN version would be:
37
38 # $ autoreconf
39 # $ ./configure --enable-maintainer-mode
40 # $ make
41
42 # All Makefile.am files must contain:
43
44 # include $(top_srcdir)/rules.mk
45
46 # If BUILT_SOURCES are desired, they need to be defined *after* the
47 # above include by a += directive, for example:
48
49 # BUILT_SOURCES += foo.h
50
51 # This is because rules.mk defines BUILT_SOURCES for its own purposes.
52
53
54 # Header Link Farm
55 # ================
56
57 # The public header files of libetpan are scattered throughout the
58 # source tree and defined by libetpaninclude_HEADERS automake variables.
59 # (The corresponding libetpanincludedir is defined in rules.mk). Before
60 # building anything else in the project, we prepare a header link farm
61 # in include/libetpan (this directory will be created). The header link
62 # farm is generated automatically when any Makefile (or other
63 # configure-generated file) is modified, for example by editing
64 # Makefile.am in maintainer mode. This ensures that all modifications
65 # to libetpaninclude_HEADERS variables are picked up properly.
66
67 # The header link farm is built using the BUILT_SOURCES mechanism of
68 # automake, which means that it will only be built by "make all", "make
69 # check" and "make install". This means that eithr of these commands
70 # needs to be used before targeting individual project files works. If
71 # the header link farm should be generated or updated manually, the
72 # following command can be used in the *top-level build directory*:
73
74 # $ rm stamp-prepare; make stamp-prepare
75
76
77
78 # Public header files are defined by libetpaninclude_HEADERS variables.
79 etpanincludedir = $(includedir)/libetpan
80
81 # We add a recursive target "prepare" which creates the desired links
82 # in include/libetpan from libetpan include files scattered throughout
83 # the source. See also README.rules.
84
85 # We hook into the BUILT_SOURCES mechanism of automake, see Section
86 # "Built sources" in the automake manual for details.
87 BUILT_SOURCES = $(top_builddir)/stamp-prepare
88
89 # The stamp file depends on all files generated by configure. This
90 # naturally includes all Makefiles which define
91 # libetpaninclude_HEADERS variables for public header files, which are
92 # the files we want. There are some more files in this list, but we
93 # don't mind regenerating the header link farm a bit more often than
94 # necessary. Usually you won't notice a difference as
95 # configure-generated files are updated very rarely.
96 $(top_builddir)/stamp-prepare: $(cfg_files)
97 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) stamp-prepare-target
98 touch $(top_builddir)/stamp-prepare
99
100 # This target should only be invoked in the top level directory (ie
101 # indirectly through $(top_builddir)/stamp-prepare). It is
102 # responsible for updating the header link farm. First, the header
103 # link farm is deleted by invoking the clean target in the include
104 # directory. Then the header link farm is (re-)generated by
105 # exploiting the recursive targets mechanism provided by automake.
106 # Note that this is exploiting automake internals (automake currently
107 # provides no official hooks for recursive targets).
108 stamp-prepare-target: $(cfg_files)
109 cd include && $(MAKE) $(AM_MAKEFLAGS) clean
110 $(MAKE) $(AM_MAKEFLAGS) RECURSIVE_TARGETS=prepare-recursive prepare
111 touch stamp-prepare
112
113 # Leaf directories (without SUBDIRS) do not have a target
114 # $(RECURSIVE_TARGETS), so we need to terminate prepare-recursive for
115 # them here.
116 prepare-recursive:
117
118 # The standard prepare target first recurses, and then calls the
119 # individual rules.
120 prepare: prepare-recursive prepare-am
121
122 # The local prepare rules are first rules internal to this file
123 # rules.mk, and second rules local to a single Makefile.am file. The
124 # internal rules here create symbolic links for each installed public
125 # header file of libetpan under $(top_builddir)/include/libetpan/.
126 prepare-am: prepare-local
127 @if test "$(etpaninclude_HEADERS)" != ""; then \
128 echo "$(mkinstalldirs) $(top_builddir)/include/libetpan/"; \
129 $(mkinstalldirs) $(top_builddir)/include/libetpan/;\
130 echo "cd $(top_builddir)/include/libetpan/"; \
131 cd $(top_builddir)/include/libetpan/ \
132 && for hdr in $(etpaninclude_HEADERS) list_end; do \
133 if test $${hdr} != list_end; then \
134 if test -e ../../$(subdir)/$${hdr}; then \
135 echo "$(LN_S) -f ../../$(subdir)/$${hdr} ."; \
136 $(LN_S) -f ../../$(subdir)/$${hdr} .; \
137 else \
138 echo "$(LN_S) -f ../../$(subdir)/$(srcdir)/$${hdr} ."; \
139 $(LN_S) -f ../../$(subdir)/$(srcdir)/$${hdr} .; \
140 fi; \
141 fi; \
142 done; \
143 fi
144
145 # Use this target to extend the prepare rules in a single Makefile.am.
146 prepare-local:
147
148
149 # Copyright 2007 g10 Code GmbH
150
151 # This file is free software; as a special exception the author gives
152 # unlimited permission to copy and/or distribute it, with or without
153 # modifications, as long as this notice is preserved.
154
155 # This file is distributed in the hope that it will be useful, but
156 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
157 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Something went wrong with that request. Please try again.