-
Notifications
You must be signed in to change notification settings - Fork 38
/
Makefile.in
192 lines (160 loc) · 5.77 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
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
TOP := $(shell pwd)
PREFIX := @prefix@
SRC := @srcdir@
GUILE := @GUILE@
GUILD := @GUILD@
VERSION := @PACKAGE_VERSION@
SHELL := /bin/bash
RELEASE_TYPE := stable
PREV_VER := 0.2.4
GPG_KEY := F53B4C5695B5E4D56093432484696772846A0058
BOOT_TOOLS := autoconf,guile
URL_DIR := "http://ftp.gnu.org/gnu/artanis/"
INCLUDES := -I$(TOP)
OBJ := obj
MOD := $(SRC)/artanis
MOD_OBJ := $(OBJ)/artanis
BIN := bin
TEMP_LIB_PATH := $(OBJ)
MOD_COMPILED_PATH := $(shell $(GUILE) -c "(display (%site-ccache-dir))")
ifdef DESTDIR
INFO_DIR := $(DESTDIR)/$(PREFIX)/share/info/
MOD_PATH := $(DESTDIR)/$(shell $(GUILE) -c "(display (%site-dir))")
MOD_TARGET_PATH := $(DESTDIR)/$(MOD_COMPILED_PATH)
else
INFO_DIR := $(PREFIX)/share/info/
MOD_PATH := $(shell $(GUILE) -c "(display (%site-dir))")
MOD_TARGET_PATH := $(MOD_COMPILED_PATH)
endif
GUILE_CFLAGS := -Wunsupported-warning -Wunbound-variable -Warity-mismatch -Wduplicate-case-datum -Wbad-case-datum -Wformat
GUILEC := GUILE_LOAD_COMPILED_PATH=$(TEMP_LIB_PATH) @GUILD@ compile $(GUILE_CFLAGS)
ARTANIS_ETC := $(SRC)/etc/artanis
ARTANIS_PAGES := $(SRC)/pages
INSTALL := install -c
HEADER := $(SRC)/.HEAD
DOCS := $(SRC)/docs
DOCS_OBJ := $(OBJ)/docs/
MANUALS := $(DOCS_OBJ)/manuals/
TEXI_SRC := $(DOCS)/artanis.texi
BUILD_AUX := $(SRC)/build-aux
GENDOCS :=$(BUILD_AUX)/gendocs.sh
CHK_TEXINFO := $(BUILD_AUX)/check_texinfo.scm
CP := cp -frd -P
TARBALL_NAME := artanis-$(VERSION)
TMP_DIR := $(shell mktemp -d)
ANN_GEN := $(BUILD_AUX)/announce-gen
DIRE_GEN := $(BUILD_AUX)/gen-directive.scm
GNUPLOAD := $(BUILD_AUX)/gnupload
TEST_SUITE := $(SRC)/test-suite
TESTS := $(TEST_SUITE)/tests
CMDCOMP := $(BUILD_AUX)/show-artanis-cmds.sh
ifndef VERBOSE
V := @ # "V = " for verbose, "V = @" for non-verbose
else
V :=
endif
mod-sfile := $(sort $(shell find $(MOD) -name '*.scm'))
mod-ofile := $(mod-sfile:.scm=.go)
mod-ofile := $(subst $(MOD)/,$(MOD_OBJ)/,$(mod-ofile))
test-cases := $(shell find $(TESTS) -name '*.test')
ALL_TARGETS := version \
modules \
scripts
all: Makefile $(ALL_TARGETS)
$(MOD_OBJ)/%.go: $(MOD)/%.scm
$(V)$(eval AELOG=build.err.$(shell basename $@))
$(V)-rm -f $(AELOG)
$(V)echo -ne "+ compiling $<\n\r"
$(V)mkdir -p $(@D)
$(V)script -e -c "$(GUILEC) -L $(SRC) $< -o $@" -f $(AELOG) > /dev/null || (cat $(AELOG) && exit 15)
$(V)if [ -e $(AELOG) ]; then cat $(AELOG) | grep warning; rm $(AELOG); :; fi
Makefile: $(SRC)/Makefile.in $(SRC)/configure
sh configure
$(MOD)/version.scm:
$(V)echo -ne "Regenerating artanis/version.scm\n\r"
$(V)-rm -f $@
$(V)cat $(HEADER) > $@
$(V)$(GUILE) -c '(let ((port (open-file "$@" "a")))(format port "(define-module (artanis version) #:export (artanis-version)) (define artanis-version \"GNU Artanis-~a\")~%" "$(VERSION)"))'
.PHONY: upload upload.gz upload.bz2 announce release.gz release.bz2 prepare clean modules install distclean distclean-mk bin version test docs scripts clean-obj
announce: release.gz release.bz2
$(V) $(ANN_GEN) --release-type=$(RELEASE_TYPE) --package-name=artanis --previous-version=$(PREV_VER) --current-version=$(VERSION) --gpg-key-id=$(GPG_KEY) --url-directory=$(URL_DIR) --news=NEWS --bootstrap-tools=$(BOOT_TOOLS)
release.gz: $(TARBALL_NAME).tar.gz
release.bz2: $(TARBALL_NAME).tar.bz2
upload: release.gz release.bz2
$(V) $(GUILE) -c '(exit (if (string=? "yes I am crazy" (getpass "Are you sure? ")) 0 233))' && \
$(GNUPLOAD) --to ftp.gnu.org:artanis \
--symlink-regex \
artanis-$(VERSION).tar.gz artanis-$(VERSION).tar.bz2
prepare:
$(V) rm -fr $(TARBALL_NAME)
$(V) cp -fr $(TOP)/. $(TMP_DIR)
$(V) $(MAKE) -C $(TMP_DIR) distclean
$(V) git --git-dir=$(TMP_DIR)/.git --work-tree=$(TMP_DIR) clean -fdqX
$(V) rm -fr $(TMP_DIR)/.git
$(V) mv $(TMP_DIR) $(TOP)/$(TARBALL_NAME)
$(TARBALL_NAME).tar.bz2:
$(V) $(MAKE) prepare
$(V) tar cjf $@ $(TARBALL_NAME)
$(V) rm -fr $(TMP_DIR) $(TOP)/$(TARBALL_NAME)
$(TARBALL_NAME).tar.gz:
$(V) $(MAKE) prepare
$(V) tar czf $@ $(TARBALL_NAME)
$(V) rm -fr $(TMP_DIR) $(TOP)/$(TARBALL_NAME)
clean:
-rm -fr $(OBJ) autom4te.cache
-rm -f *.log build.err.* *.info
-rm -f $(MOD)/version.scm
-rm -f artanis-$(VERSION)*
find . -name "*~" -exec rm {} \;
clean-tarball:
-rm -f *.bz2 *.gz *.sig *.directive *.asc
clean-config:
-rm -f config.{h,log}
install: $(ALL_TARGETS)
mkdir -p $(MOD_PATH)
$(CP) $(MOD) $(MOD_PATH)/
mkdir -p $(MOD_TARGET_PATH)/
$(CP) $(MOD_OBJ) $(MOD_TARGET_PATH)/
ifdef DESTDIR
mkdir -p $(DESTDIR)/etc
$(CP) $(ARTANIS_ETC) $(DESTDIR)/etc/
$(CP) $(ARTANIS_PAGES) $(DESTDIR)/etc/artanis/
mkdir -p $(DESTDIR)/bin/
$(CP) $(BIN)/art $(DESTDIR)/bin/
if [ -e /etc/bash_completion ]; then \
mkdir -p $(DESTDIR)/etc/bash_completion.d/; \
$(CP) $(CMDCOMP) $(DESTDIR)/etc/bash_completion.d/; \
source $(DESTDIR)/etc/bash_completion; \
fi
else
$(CP) $(ARTANIS_ETC) /etc/
$(CP) $(ARTANIS_PAGES) /etc/artanis/
mkdir -p $(PREFIX)/bin/
$(CP) $(BIN)/art $(PREFIX)/bin/
if [ -e /etc/bash_completion ]; then \
mkdir -p /etc/bash_completion.d/; \
$(CP) $(CMDCOMP) /etc/bash_completion.d/; \
source /etc/bash_completion; \
fi
endif
if [ -e /etc/bash.bashrc ]; then source /etc/bash.bashrc; fi
if [ -e artanis.info ]; then mkdir -p $(INFO_DIR); $(CP) artanis.info $(INFO_DIR)/; fi
distclean: distclean-mk clean clean-config clean-tarball
-rm -f $(BIN)/art
clean-obj:
-rm -fr $(MOD_TARGET_PATH)/{artanis,art.go}
distclean-mk:
-rm -f Makefile
version: $(SRC)/.ARTANIS-VERSION $(SRC)/configure
$(V)-rm -fr $(MOD)/version.scm
$(V)$(MAKE) $(MOD)/version.scm
modules: $(MOD_OBJ)/version.go $(mod-ofile)
test: modules
$(V)for t in $(test-cases); do $(GUILE) -L $(SRC) -L $(TEST_SUITE) -C $(OBJ) $$t; done
docs: $(TEXI_SRC)
$(CHK_TEXINFO)
GENDOCS_TEMPLATE_DIR=$(BUILD_AUX) $(GENDOCS) --email [email protected] -s $< -o $(MANUALS) "GNU Artanis Manual" --html --no-headers
-rm -f ./*.{cp,ky,tp,aux,fn,log,pg,toc,vr}
scripts:
$(V)echo -ne "Generating bin/art\n\r"
$(V)chmod +x $(BIN)/art