Makefile.am: Add built-sources target.
[pspp] / Makefile.am
1 ## PSPP - a program for statistical analysis.
2 ## Copyright (C) 2019, 2020 Free Software Foundation, Inc.
3 ##
4 ## This program is free software: you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation, either version 3 of the License, or
7 ## (at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
16
17 ## Process this file with automake to produce Makefile.in  -*- makefile -*-
18
19 AUTOMAKE_OPTIONS = std-options check-news 1.10.1 subdir-objects
20
21 SUBDIRS = gl po
22 DISTCLEANFILES = ./po/stamp-po xconfigure
23 BUILT_SOURCES =
24 built-sources: $(BUILT_SOURCES)
25
26 AM_CPPFLAGS = \
27         -I$(top_srcdir)/gl \
28         -I$(top_builddir)/gl \
29         -DINSTALLDIR=\"$(bindir)\"
30
31 AM_V_P ?= :
32
33 AM_CFLAGS=
34
35 if cc_is_gcc
36 AM_CFLAGS+=-Wall -Wextra -Wwrite-strings -Wstrict-prototypes \
37 -Wpointer-arith -Wno-sign-compare -Wmissing-prototypes
38 endif
39
40 .q.c:
41         @$(MKDIR_P) `dirname $@`
42         $(AM_V_GEN)./src/language/lexer/q2c$(EXEEXT_FOR_BUILD) $< $@
43
44 $(all_q_sources:.q=.c): src/language/lexer/q2c$(EXEEXT_FOR_BUILD)
45 all_q_sources =
46
47 pkgsysconfdir = $(sysconfdir)/$(PACKAGE)
48
49
50 EXTRA_DIST = ONEWS
51
52 CLEANFILES =
53 CLEAN_LOCAL =
54 ALL_LOCAL =
55 CHECK_LOCAL =
56 ACLOCAL_AMFLAGS = -I m4 -I gl/m4
57 noinst_LIBRARIES=
58 noinst_LTLIBRARIES=
59 noinst_PROGRAMS=
60 check_PROGRAMS=
61 bin_PROGRAMS=
62 dist_man_MANS =
63 DIST_HOOKS =
64 INSTALL_DATA_HOOKS =
65 UNINSTALL_DATA_HOOKS =
66 PHONY =
67 SUFFIXES = .q
68 LDADD = gl/libgl.la
69
70 gl/libgl.la: config.h
71         $(MAKE) -C gl
72
73 dist: gl/libgl.la
74
75 # This ensures that files added to EXTRA_DIST are always distributed,
76 # even if they are inside an Automake if...endif conditional block that is
77 # disabled by some particular "configure" run.  For more information, see:
78 # http://article.gmane.org/gmane.comp.sysutils.automake.general/10891
79 noinst_HEADERS = $(EXTRA_DIST)
80
81 generate-changelog:
82         if test -d $(top_srcdir)/.git; then                     \
83           $(top_srcdir)/build-aux/gitlog-to-changelog --since=2008-07-27  --srcdir=$(top_srcdir) \
84             > $(distdir)/cl-t || exit 1;                                        \
85           rm -f $(distdir)/ChangeLog;                           \
86           mv $(distdir)/cl-t $(distdir)/ChangeLog;              \
87         fi
88
89 DIST_HOOKS += generate-changelog
90
91
92 include $(top_srcdir)/build-aux/automake.mk
93 include $(top_srcdir)/po/automake.mk
94 include $(top_srcdir)/lib/automake.mk
95 include $(top_srcdir)/examples/automake.mk
96 include $(top_srcdir)/src/automake.mk
97 include $(top_srcdir)/utilities/automake.mk
98 include $(top_srcdir)/tests/automake.mk
99 include $(top_srcdir)/doc/automake.mk
100
101 if WITH_PERL_MODULE
102 include $(top_srcdir)/perl-module/automake.mk
103 endif
104
105 PHONY += $(DIST_HOOKS) $(INSTALL_DATA_HOOKS) $(UNINSTALL_DATA_HOOKS)
106
107 .PHONY: $(PHONY)
108
109 dist-hook: $(DIST_HOOKS)
110
111 install-data-hook: $(INSTALL_DATA_HOOKS)
112
113 uninstall-hook: $(UNINSTALL_DATA_HOOKS)
114
115 clean-local: $(CLEAN_LOCAL)
116 all-local: $(ALL_LOCAL)
117 check-local: $(CHECK_LOCAL)
118
119 # A convenience target to build all the binaries
120 programs: $(PROGRAMS)
121
122 # The following rules are from Open vSwitch.  The original copyright notice
123 # and license are:
124 #
125 # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
126 #
127 # Copying and distribution of this file, with or without modification,
128 # are permitted in any medium without royalty provided the copyright
129 # notice and this notice are preserved.  This file is offered as-is,
130 # without warranty of any kind.
131
132 # If we're checked out from a Git repository, make sure that every
133 # file that is in Git is distributed.
134 # The debian package is now also maintained in git and that contains
135 # the distribution files. Do not run this check if we are
136 # in a debian package git repository, because the check fails there
137 ALL_LOCAL += dist-hook-git
138 dist-hook-git: distfiles
139         @if test -e $(srcdir)/.git &&                                       \
140             test ! -d $(srcdir)/debian &&                                   \
141             (git --version) >/dev/null 2>&1; then                           \
142           (cd $(srcdir) && git ls-files)                                    \
143             | grep -vE '\.gitignore|README.Git|Smake|Bug-administration'    \
144             | grep -vE '\.gitattributes'                                    \
145             | LC_ALL=C sort -u > gitfiles;                                  \
146           LC_ALL=C comm -1 -3 distfiles gitfiles > missing-distfiles;       \
147           if test -s missing-distfiles; then                                \
148             echo "The distribution is missing the following files:";        \
149             cat missing-distfiles;                                          \
150             exit 1;                                                         \
151           fi;                                                               \
152         fi
153 # The following is based on commands for the Automake "distdir" target.
154 distfiles: Makefile
155         @srcdirstrip=`echo "$(srcdir)" | $(SED) 's/[].[^$$\\*]/\\\\&/g'`; \
156         topsrcdirstrip=`echo "$(top_srcdir)" | $(SED) 's/[].[^$$\\*]/\\\\&/g'`; \
157         list='$(DISTFILES)'; \
158         for file in $$list; do echo $$file; done | \
159           $(SED) -e "s|^$$srcdirstrip/||;t" \
160               -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" \
161           | LC_ALL=C sort -u > $@
162 CLEANFILES += distfiles gitfiles missing-distfiles
163 PHONY += dist-hook-git