-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
200 lines (170 loc) · 9.04 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#
# Makefile gnucobol
#
# Copyright (C) 2003-2012, 2014-2020, 2023 Free Software Foundation, Inc.
# Written by Keisuke Nishida, Roger While, Simon Sobisch
#
# This file is part of GnuCOBOL.
#
# The GnuCOBOL compiler is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# GnuCOBOL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GnuCOBOL. If not, see <https://www.gnu.org/licenses/>.
include_HEADERS = libcob.h
SUBDIRS = . lib libcob bin cobc config copy po extras doc tests
BUILT_SOURCES = tarstamp.h
ACLOCAL_AMFLAGS = -I m4 --install
# CLEANFILES = $(bin_SCRIPTS)
dist_noinst_SCRIPTS = autogen.sh build_aux/bootstrap po/update_linguas.sh \
build_aux/create_win_dist.sh build_aux/create_mingw_bindist.sh
# wrapper for the build environment
noinst_SCRIPTS = pre-inst-env
EXTRA_DIST = gnucobol.spec DEPENDENCIES DEPENDENCIES.md README.md HACKING
# add rules for code-coverage testing, as defined by AX_CODE_COVERAGE
include $(top_srcdir)/aminclude_static.am
clean-local: code-coverage-clean
dist-clean-local: code-coverage-dist-clean
CODE_COVERAGE_BRANCH_COVERAGE=1
CODE_COVERAGE_IGNORE_PATTERN= \
"*/cobc/pplex.c" "*/cobc/ppparse.c" "*/cobc/scanner.c" "*/cobc/parser.c" \
"*/cobc/config.def" "*/cobc/warning.def" \
"*/libcob/statement.def"
# files shipped with the package that should be 755'ed:
FILES_TO_BE_EXECUTABLE = $(dist_noinst_SCRIPTS) \
configure tests/testsuite tests/testsuite_manual \
build_aux/config.guess build_aux/config.sub build_aux/config.rpath \
build_aux/depcomp build_aux/install-sh build_aux/ltmain.sh build_aux/mdate-sh \
build_aux/missing build_aux/mkinstalldirs build_aux/ylwrap
tarstamps = $(top_distdir)/tarstamp.h tarstamp.h
releasedir = $(abs_builddir)/gnuCobol4${PLATFORM}
# all parts but tarstamp.h should not be necessary...
dist-hook:
rm -f $(top_distdir)/tarstamp.h
$(MAKE) $(AM_MAKEFLAGS) $(top_distdir)/tarstamp.h
# fix access to cater for bad version control use / copy / read-only file system
find $(top_distdir) -type d -print | xargs chmod 755 # otherwise directories have 777
find $(top_distdir) -type f -print | xargs chmod 644 # otherwise files are unchanged but with u+r
# because of the global file change, adjust here again
cd $(top_distdir) && chmod 755 $(FILES_TO_BE_EXECUTABLE)
# fix timestamps to cater for bad version control use / copy
touch $(top_distdir)/m4/*.m4
touch $(top_distdir)/aclocal.m4
touch $(top_distdir)/Makefile.in
touch $(top_distdir)/*/Makefile.in
touch $(top_distdir)/*/*/Makefile.in
touch $(top_distdir)/configure
touch $(top_distdir)/config.h.in
touch $(top_distdir)/doc/stamp-vti
# touch $(top_distdir)/cobc/ppparse.c
# touch $(top_distdir)/cobc/parser.c
# touch $(top_distdir)/cobc/pplex.c
# touch $(top_distdir)/cobc/scanner.c
# $(top_distdir)/doc/cobcinfo.sh "fixtimestamps"
# touch $(top_distdir)/libcob/libcob.3
# touch $(top_distdir)/bin/cobcrun.1
# touch $(top_distdir)/cobc/cobc.1
# Create dist_win manually (dist-zip would have the same content as dist-gzip)
distwindir = $(distdir)_win
distwindir: distdir $(top_srcdir)/build_windows $(top_srcdir)/build_aux/create_win_dist.sh
EXTSRCDIR=$(abs_srcdir) EXTDISTDIR=$(distdir) EXTWINDISTDIR=$(distwindir) $(top_srcdir)/build_aux/create_win_dist.sh
distwin-zip: distwindir
rm -f "$(distwindir).zip"
zip -rq "$(distwindir).zip" "$(distwindir)"
distmingwdir = GnuCOBOL_mingw
distmingwdir: all $(top_srcdir)/build_aux/create_mingw_bindist.sh
EXTSRCDIR=$(abs_srcdir) EXTDISTDIR=$(distmingwdir) EXTBUILDDIR=$(abs_builddir) $(top_srcdir)/build_aux/create_mingw_bindist.sh
distwin: distwindir
distmingw: distmingwdir
distbindir = $(distdir)_bin
distbindir: all distdir
$(MAKE) $(AM_MAKEFLAGS) DESTDIR=$(abs_builddir)/$(distbindir) install
$(MKDIR_P) "$(distbindir)/${datarootdir}/licenses/$(PACKAGE)"
install -p -m644 $(distdir)/COPYING* "$(distbindir)/${datarootdir}/licenses/$(PACKAGE)"
$(MKDIR_P) "$(distbindir)/${datarootdir}/doc/$(PACKAGE)"
install -p -m644 $(distdir)/README* "$(distbindir)/${datarootdir}/doc/$(PACKAGE)"
install -p -m644 $(distdir)/NEWS* "$(distbindir)/${datarootdir}/doc/$(PACKAGE)"
install -p -m644 $(distdir)/ChangeLog "$(distbindir)/${datarootdir}/doc/$(PACKAGE)"
install -p -m644 $(distdir)/bin/ChangeLog "$(distbindir)/${datarootdir}/doc/$(PACKAGE)/ChangeLog_bin"
install -p -m644 $(distdir)/cobc/ChangeLog "$(distbindir)/${datarootdir}/doc/$(PACKAGE)/ChangeLog_cobc"
install -p -m644 $(distdir)/libcob/ChangeLog "$(distbindir)/${datarootdir}/doc/$(PACKAGE)/ChangeLog_libcob"
install -p -m644 $(distdir)/doc/gnucobol*.pdf "$(distbindir)/${datarootdir}/doc/$(PACKAGE)"
DISTBIN_TARGETS = distbin-gzip
gc__remove_bindistdir = rm -rf $(distbindir)
gc__post_remove_bindistdir = $(gc__remove_bindistdir)
distbin-gzip: distbindir
tardir=$(distbindir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distbindir).tar.gz
$(gc__post_remove_bindistdir)
$(am__post_remove_distdir)
distbin-bzip2: distbindir
tardir=$(distbindir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distbindir).tar.bz2
$(gc__post_remove_bindistdir)
$(am__post_remove_distdir)
distbin-lzip: distbindir
tardir=$(distbindir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distbindir).tar.lz
$(gc__post_remove_bindistdir)
$(am__post_remove_distdir)
distbin-xz: distbindir
tardir=$(distbindir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distbindir).tar.xz
$(gc__post_remove_bindistdir)
$(am__post_remove_distdir)
distbin:
$(MAKE) $(AM_MAKEFLAGS) $(DISTBIN_TARGETS) gc__post_remove_bindistdir='@:' am__post_remove_distdir='@:'
$(gc__post_remove_bindistdir)
$(am__post_remove_distdir)
release:
rm -rf ${releasedir} gnuCobol4${PLATFORM}.tar.Z $(distbindir)
$(MAKE) $(AM_MAKEFLAGS) DESTDIR=$(releasedir) install
if test -f /usr/local/bin/vcheck ; then \
cp /usr/local/bin/vcheck ${releasedir}/$(prefix)/bin ; fi
if test -f /usr/local/bin/vrecover ; then \
cp /usr/local/bin/vrecover ${releasedir}/$(prefix)/bin ; fi
if test -f /usr/local/lib/libvisam.a ; then \
cp /usr/local/lib/libvisam.a ${releasedir}/$(libdir) ; fi
$(MKDIR_P) "$(releasedir)/${datarootdir}/licenses/$(PACKAGE)"
$(INSTALL_DATA) $(abs_builddir)/COPYING* "$(releasedir)/${datarootdir}/licenses/$(PACKAGE)"
$(MKDIR_P) "$(releasedir)/${datarootdir}/doc/$(PACKAGE)"
$(INSTALL_DATA) $(abs_builddir)/README* "$(releasedir)/${datarootdir}/doc/$(PACKAGE)"
$(INSTALL_DATA) $(abs_builddir)/NEWS* "$(releasedir)/${datarootdir}/doc/$(PACKAGE)"
$(INSTALL_DATA) $(abs_builddir)/ChangeLog "$(releasedir)/${datarootdir}/doc/$(PACKAGE)"
$(INSTALL_DATA) $(abs_builddir)/bin/ChangeLog "$(releasedir)/${datarootdir}/doc/$(PACKAGE)/ChangeLog_bin"
$(INSTALL_DATA) $(abs_builddir)/cobc/ChangeLog "$(releasedir)/${datarootdir}/doc/$(PACKAGE)/ChangeLog_cobc"
$(INSTALL_DATA) $(abs_builddir)/libcob/ChangeLog "$(releasedir)/${datarootdir}/doc/$(PACKAGE)/ChangeLog_libcob"
cd ${abs_builddir}/doc; make gnucobol.pdf
$(INSTALL_DATA) $(abs_builddir)/doc/gnucobol*.pdf "$(releasedir)/${datarootdir}/doc/$(PACKAGE)"
cd ${releasedir}/$(prefix); tar cf $(abs_builddir)/gnuCobol4${PLATFORM}.tar *; compress $(abs_builddir)/gnuCobol4${PLATFORM}.tar
@echo gnuCobol4${PLATFORM}.tar.Z created
cd ${abs_builddir}; rm -rf ${releasedir}
# date from last svn timestamp according to local checkout
VCSDATE = LC_ALL=C svn info --show-item last-changed-date $(srcdir) 2>/dev/null
# if find -printf is not supported: pass as FILEDATE=false
FILEDATE_LOOKUP = -name 'NEWS' -o -name 'configure.ac' -o -name 'ChangeLog' -o -name '*.c' -o -name '*.h' -o -name '*.am' -o -name '*.at'
FILEDATE = (find $(srcdir) -type f \( $(FILEDATE_LOOKUP) \) -printf '%T@ %p\0' | sort -rz | sed -Ezn '1s/[^ ]* //p' | xargs stat -c %y) 2>/dev/null
# to override, most common as "gdate", if it doesn't support --date, then current date is used
DATE = date
TARSTAMP_CONTENT = '\#define COB_TAR_DATE "%b %d %Y %T UTC"%n\#define COB_NUM_TAR_DATE %Y%m%d%n\#define COB_NUM_TAR_TIME %H%M%S'
$(tarstamps): NEWS configure.ac Makefile.am libcob/version.h
@echo "Creating $@..."
@($(DATE) --date=241225 -u 2>/dev/null 1>&2 && \
LC_ALL=C stamp=$$( $(VCSDATE) || $(FILEDATE) || $(DATE) -u '+%F %T' ) && \
LC_ALL=C $(DATE) --date="$$stamp" -u +$(TARSTAMP_CONTENT) > $@) \
|| LC_ALL=C $(DATE) -u +$(TARSTAMP_CONTENT) > $@
# TODO: possibly disable / adjust depending on what
# configure.ac founds (currently not checked there)
vcs-update:
svn update $(srcdir)
# targets that are only logical targets and should always be executed
.PHONY: test checkall checkmanual vcs-update distwin distmingw \
distbin distbin-gzip distbin-bzip2 distbin-lzip distbin-xz
test: all
cd tests && $(MAKE) $(AM_MAKEFLAGS) test
checkmanual: all
cd tests && $(MAKE) $(AM_MAKEFLAGS) checkmanual
checkall: check test