Fixed new 'alloc_length' resizing code.
[captive.git] / Makefile-head.am
1 # $Id$
2 # automake source include to the begin of all Makefile.am's
3 # Copyright (C) 2002 Jan Kratochvil <project-captive@jankratochvil.net>
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; exactly version 2 of June 1991 is required
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18
19 # defined WANT_GTK_DOC if you plan to include macros/Makefile-gtk-doc.am
20
21
22 # Set all needed variables to their empty values to prevent "variable `...' not defined"
23 # Any further settings should be done exclusively by += operator
24 EXTRA_DIST=
25 BUILT_SOURCES=
26 CLEANFILES=
27 MAINTAINERCLEANFILES=
28 # default DEFAULT_INCLUDES=' -I. -I$(srcdir)'.(dirnames of 'CONFIG_HEADER') ,
29 # we neeed such $(DEFAULT_INCLUDES) but we need to prefer our $(INCLUDES)
30 # thus we postpone them later by moving them to $(AM_CPPFLAGS).
31 # It prevent us the inclusion of own wrappers
32 # when we want direct include during (test) compilations
33 # in $(top_srcdir)/src/libcaptive/include/reactos/
34 # as -I. is always as one of the first '-I's in $(INCLUDES).
35 # It will be utilized in $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am .
36 # It would be also possible to use some #include_next's but it is pretty
37 # hassle to guess the right ordering in such case.
38 # FIXME: $(addprefix ) and $(dir /) are GNU make dependent!
39 AM_CPPFLAGS=-I. -I$(srcdir) $(addprefix -I,$(dir $(CONFIG_HEADER)))
40 # 'DEFAULT_INCLUDES=' will drop its contents.
41 # 'DEFAULT_INCLUDES:=' will cause: automake-X.Y/am/compile.am: DEFAULT_INCLUDES was set with `:=' and is now set with `='
42 # %DEFAULT_INCLUDES% is permitted only in automake system files.
43 # No possibility to keep its state therefore we generate
44 # (I hope) the same contents in 'AM_CPPFLAGS=...' line above
45 DEFAULT_INCLUDES=
46 INCLUDES=
47 lib_LTLIBRARIES=
48 pkginclude_HEADERS=
49 bin_PROGRAMS=
50 sbin_PROGRAMS=
51 noinst_HEADERS=
52 # Prevent: noinst_DATA was already defined in condition TRUE, which implies condition MAINTAINER_MODE_TRUE
53 # You should only unconditionally do: noinst_DATA+=...
54 noinst_DATA=$(noinst_DATA__include_test_all_stamp)
55
56 # Custom variables
57 captive_library=$(top_builddir)/src/libcaptive/libcaptive.la
58 localedir=$(datadir)/locale
59
60 # Standard settings
61 INCLUDES+=-DLOCALEDIR=\"$(localedir)\"
62 INCLUDES+=-I$(top_srcdir)/src/libcaptive/include
63 INCLUDES+=-I$(top_srcdir)/intl
64
65 # Force delete of target file if command fails.
66 # Generally better behaviour but it requires GNU make. Harmless otherwise.
67 .DELETE_ON_ERROR:
68
69
70 # This target is used during ./autogen.pl POTFILES.in generation
71 distfiles: $(DISTFILES)
72         @if test -n "$(DISTFILES_PRINT)";then \
73                 echo -n ":DISTFILES:"; \
74                 for distfile in . $(DISTFILES);do \
75                         if test -n 1 \
76                                         -a "$$distfile" '!=' . \
77                                         -a "$$distfile" '!=' Makefile.am \
78                                         -a "$$distfile" '!=' Makefile.in \
79                                         ;then \
80                                 if echo " $(BUILT_SOURCES) "|grep -q " $$distfile ";then :;else \
81                                         echo -n " $(subdir)/$$distfile"; \
82                                         fi; \
83                                 fi; \
84                         done; \
85                 echo; \
86                 fi;
87         @for subdir in . $(SUBDIRS);do \
88                 if test "$$subdir" = . -o "$$subdir" = intl -o "$$subdir" = po -o "$$subdir" = m4;then :;else \
89                         (cd "$$subdir" && $(MAKE) $(AM_MAKEFLAGS) distfiles) || exit 1; \
90                         fi; \
91                 done
92
93 # check for macros/Makefile-gtk-doc.am inclusion
94 # FIXME: GNU make dependent!
95 # use <space><keyword> to bypass automake but apply to GNU make
96  ifdef WANT_GTK_DOC
97 dist-hook-local:
98  else
99 dist-hook:
100  endif
101         for i in _built_sources_pad $(BUILT_SOURCES);do \
102                 $(RM) $(distdir)/$$i; \
103         done
104
105
106 # Test compilability of all local separate include files
107 CLEANFILES+=.include_test.o .include_test_all.stamp
108 if MAINTAINER_MODE
109 noinst_DATA__include_test_all_stamp=.include_test_all.stamp
110 else
111 noinst_DATA__include_test_all_stamp=
112 endif
113
114 # FIXME: Use separate .stamp file for each of $(noinst_HEADERS)
115 # we would need some pattern substituion which means GNU make dependency
116 .include_test_all.stamp: $(HEADERS) $(top_srcdir)/include_test.c
117         @set -e;for header in . $(HEADERS);do \
118                 if test "$$header" '!=' .;then \
119                         $(COMPILE) -include "$$header" -o .include_test.o -c $(top_srcdir)/include_test.c; \
120                         fi; \
121                 done
122         @rm -f include_test.o
123         @touch $@
124
125
126 # Unfortunately we need to use this never-invocated target
127 # to get $(COMPILE) variable definition.
128 MAINTAINERCLEANFILES+=.include_test_false.c
129 BUILT_SOURCES+=.include_test_false.c
130 if NEVER
131 noinst_PROGRAMS=.include_test_false
132 endif
133 .include_test_false.c:
134         @touch $@
135
136 if HAVE_PERL
137 %.pod: %.pod.pl
138         $(PERL) $< >$@
139
140 endif
141 if HAVE_POD2MAN
142 %.1: %.pod
143         $(POD2MAN) --section=1 $< >$@
144
145 %.7: %.pod
146         $(POD2MAN) --section=7 $< >$@
147
148 %.8: %.pod
149         $(POD2MAN) --section=8 $< >$@
150
151 endif