-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
90 lines (77 loc) · 4.25 KB
/
Makefile.in
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
# ICON
#
# ------------------------------------------
# Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
# See AUTHORS.TXT for a list of authors
# See LICENSES/ for license information
# SPDX-License-Identifier: BSD-3-Clause
# ------------------------------------------
# This makefile sets up the building environment and calls icon.mk.
SHELL= @SHELL@
BUILD_ENV= @BUILD_ENV_MAKE@
DELEGATEE_FILE= icon.mk
.SUFFIXES:
.NOTPARALLEL:
.PHONY: all distclean env help dist snapshot force-delegate
# Default target:
all:
@$(BUILD_ENV) $(MAKE) -f $(DELEGATEE_FILE) $@
# A rule for targets that are unknown to this makefile. The dependency on a
# phony target 'force-delegate' enforces running make with $(DELEGATEE_FILE)
# even if the requested target already exists. The fact that the rule is
# terminal (i.e. declared with double colon) allows for building targets that
# are normally not matched by "match-anything" pattern rules (e.g. generated
# source files like version.c):
%:: force-delegate
@$(BUILD_ENV) $(MAKE) -f $(DELEGATEE_FILE) $@
# Disable attempts to build this makefile with the previous
# "match-anything" pattern rule:
Makefile:;
distclean:
@$(BUILD_ENV) $(MAKE) -f $(DELEGATEE_FILE) $@
rm -f Makefile
env:
@echo '@''BUILD_ENV@' | ./config.status -q --file=-
help:
@echo "Usage:"; \
echo " make -j <jobs> <target>"; \
echo "where <jobs> is the number of simultaneous building jobs and <target> is one of"; \
echo "the following:"; \
echo " 'all' (default) build ICON"; \
echo " 'preprocess' run source file preprocessing"; \
echo " 'depend' generate dependency files"; \
echo " 'srclist' generate file './srclist' containing a list of ICON source"; \
echo " files to be compiled in the current configuration"; \
echo " 'check' build ICON and check whether the bundled packages are built"; \
echo " correctly"; \
echo " 'install' install ICON"; \
echo " 'mostlyclean' delete files generated by the compilers"; \
echo " 'clean' delete files generated by 'make'"; \
echo " 'distclean' delete files generated by 'make' and 'configure'"; \
echo " 'config-bundled' configure the bundled packages"; \
echo " 'check-bundled' skip building ICON and check whether the bundled packages are"; \
echo " built correctly"; \
echo " 'dist' create a tarball containing files from the current HEAD of"; \
echo " the ICON git repository and its submodules"; \
echo " 'snapshot' create a tarball containing all files in the source directory"; \
echo " that are not ignored by git in their current state"; \
echo " 'env' print the build invironment initialization script"
GIT= git
TAR= tar
# Includes only committed versions of the files:
dist:
@if test ! -d @top_srcdir@/.git; then echo "'@top_srcdir@' is not a git repository" >&2; exit 1; fi
$(GIT) -C @top_srcdir@ archive --prefix=@PACKAGE_TARNAME@/ --format tar -o @abs_top_builddir@/@[email protected] HEAD
$(GIT) -C @top_srcdir@ submodule foreach '$(GIT) archive --prefix=@PACKAGE_TARNAME@/$$path/ --format tar -o @abs_top_builddir@/$$sha1.tar HEAD && $(TAR) -Af @abs_top_builddir@/@[email protected] @abs_top_builddir@/$$sha1.tar && rm @abs_top_builddir@/$$sha1.tar'
rm -f @[email protected] && BZIP2=$${BZIP2--9} bzip2 @[email protected]
# Includes all non-ignored files with uncommitted changes:
snapshot:
@if test ! -d @top_srcdir@/.git; then echo "'@top_srcdir@' is not a git repository" >&2; exit 1; fi; \
GIT_DIR=; unset GIT_DIR; if $(GIT) -C @top_srcdir@ ls-files --recurse-submodules >/dev/null 2>&1; then :; \
else echo "'$(GIT)' is not found or too old (at least version 2.11 is required)" >&2; exit 1; fi; \
if test '@LN_S@' != 'ln -s'; then echo "'ln -s' is not supported" >&2; exit 1; fi
snapshot=@PACKAGE_TARNAME@-snapshot-$(shell date -uI); \
rm -f "$$snapshot" && @LN_S@ @top_srcdir@ "$$snapshot"; \
GIT_DIR=; unset GIT_DIR; ($(GIT) -C @top_srcdir@ ls-files --recurse-submodules && $(GIT) -C @top_srcdir@ ls-files -o --exclude-standard -x "/$$snapshot") | sed "s%^%$$snapshot/%" | $(TAR) chf - -T - | BZIP2=$${BZIP2--9} bzip2 -c > "$$snapshot.tar.bz2"; \
rm -f "$$snapshot"