bootstrap
[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 sbin_PROGRAMS=
50 noinst_HEADERS=
51 # Prevent: noinst_DATA was already defined in condition TRUE, which implies condition MAINTAINER_MODE_TRUE
52 # You should only unconditionally do: noinst_DATA+=...
53 noinst_DATA=$(noinst_DATA__include_test_all_stamp)
54
55 # Custom variables
56 captive_library=$(top_builddir)/src/libcaptive/libcaptive.la
57 localedir=$(datadir)/locale
58
59 # Standard settings
60 INCLUDES+=-DLOCALEDIR=\"$(localedir)\"
61 INCLUDES+=-I$(top_srcdir)/src/libcaptive/include
62 INCLUDES+=-I$(top_srcdir)/intl
63
64
65 # This target is used during ./autogen.pl POTFILES.in generation
66 distfiles: $(DISTFILES)
67         @if test -n "$(DISTFILES_PRINT)";then \
68                 echo -n ":DISTFILES:"; \
69                 for distfile in . $(DISTFILES);do \
70                         if test -n 1 \
71                                         -a "$$distfile" '!=' . \
72                                         -a "$$distfile" '!=' Makefile.am \
73                                         -a "$$distfile" '!=' Makefile.in \
74                                         ;then \
75                                 if echo " $(BUILT_SOURCES) "|grep -q " $$distfile ";then :;else \
76                                         echo -n " $(subdir)/$$distfile"; \
77                                         fi; \
78                                 fi; \
79                         done; \
80                 echo; \
81                 fi;
82         @for subdir in . $(SUBDIRS);do \
83                 if test "$$subdir" = . -o "$$subdir" = intl -o "$$subdir" = po -o "$$subdir" = m4;then :;else \
84                         (cd "$$subdir" && $(MAKE) $(AM_MAKEFLAGS) distfiles) || exit 1; \
85                         fi; \
86                 done
87
88 # check for macros/Makefile-gtk-doc.am inclusion
89 # FIXME: GNU make dependent!
90 # use <space><keyword> to bypass automake but apply to GNU make
91  ifdef WANT_GTK_DOC
92 dist-hook-local:
93  else
94 dist-hook:
95  endif
96         for i in _built_sources_pad $(BUILT_SOURCES);do \
97                 $(RM) $(distdir)/$$i; \
98         done
99
100
101 # Test compilability of all local separate include files
102 CLEANFILES+=.include_test.o .include_test_all.stamp
103 if MAINTAINER_MODE
104 noinst_DATA__include_test_all_stamp=.include_test_all.stamp
105 else
106 noinst_DATA__include_test_all_stamp=
107 endif
108
109 # FIXME: Use separate .stamp file for each of $(noinst_HEADERS)
110 # we would need some pattern substituion which means GNU make dependency
111 .include_test_all.stamp: $(HEADERS) $(top_srcdir)/include_test.c
112         @set -e;for header in . $(HEADERS);do \
113                 if test "$$header" '!=' .;then \
114                         $(COMPILE) -include "$$header" -o .include_test.o -c $(top_srcdir)/include_test.c; \
115                         fi; \
116                 done
117         @rm -f include_test.o
118         @touch $@
119
120
121 # Unfortunately we need to use this never-invocated target
122 # to get $(COMPILE) variable definition.
123 MAINTAINERCLEANFILES+=.include_test_false.c
124 BUILT_SOURCES+=.include_test_false.c
125 if IS_FALSE
126 noinst_PROGRAMS=.include_test_false
127 endif
128 .include_test_false.c:
129         @touch $@
130