| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
AVAILABLE_DOCUMENTS := aarm arm |
| 25 |
AVAILABLE_YEARS := 2005 2012 2020 |
| 26 |
AVAILABLE_FORMATS := html info texinfo txt pdf |
| 27 |
|
| 28 |
|
| 29 |
DOCUMENTS := $(AVAILABLE_DOCUMENTS) |
| 30 |
YEARS := $(AVAILABLE_YEARS) |
| 31 |
FORMATS := $(filter-out pdf texinfo, $(AVAILABLE_FORMATS)) |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
BUILDER_OPTIONS := -k |
| 41 |
ADAFLAGS := |
| 42 |
LDFLAGS := |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
PYTHON ?= python3 |
| 48 |
EMACS_EXE ?= emacs |
| 49 |
|
| 50 |
.PHONY: all clean publish |
| 51 |
|
| 52 |
all: $(foreach d,$(DOCUMENTS),\ |
| 53 |
$(foreach y,$(YEARS),\ |
| 54 |
$(foreach f,$(FORMATS),\ |
| 55 |
$(d)$(y).$(f)))) |
| 56 |
|
| 57 |
|
| 58 |
create-dir : force |
| 59 |
for file in *.info; do install-info $$file dir; done |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
TEXI_INFO_OPTS := --no-split --no-number-sections --no-validate |
| 64 |
TEXI_PDF_OPTS := --quiet |
| 65 |
|
| 66 |
SOURCE_DIR_2005 := ../source_2005 |
| 67 |
SOURCE_DIR_2012 := ../source_2012 |
| 68 |
SOURCE_DIR_2020 := ../source_2020 |
| 69 |
|
| 70 |
|
| 71 |
CHANGES := New-Only |
| 72 |
|
| 73 |
VERSION_2005 := 2 |
| 74 |
VERSION_2012 := 4 |
| 75 |
VERSION_2020 := 5 |
| 76 |
|
| 77 |
|
| 78 |
MASTER_arm := rm.msm |
| 79 |
MASTER_aarm := aarm.msm |
| 80 |
|
| 81 |
|
| 82 |
SOURCES_2005 := $(wildcard $(SOURCE_DIR_2005)/*.ms[ms]) |
| 83 |
SOURCES_2012 := $(wildcard $(SOURCE_DIR_2012)/*.ms[ms]) |
| 84 |
SOURCES_2020 := $(wildcard $(SOURCE_DIR_2020)/*.ms[ms]) |
| 85 |
define doc_year_build |
| 86 |
|
| 87 |
# Non-unique intermediate paths would create a race condition, so we |
| 88 |
# store the temporary result into the versioned source directory. |
| 89 |
$(d)$(y).texinfo: arm_form.exe $(SOURCES_$(y)) |
| 90 |
cd $(SOURCE_DIR_$(y)); \ |
| 91 |
$(CURDIR)/$$< $(MASTER_$(d)) info $(CHANGES) $(VERSION_$(y)) $(VERSION_$(y)) ./; \ |
| 92 |
mv `sed -ne '/^@FilePrefix{\(.*\)}/{s//\L\1/p;q}' $(MASTER_$(d))`.texinfo $(CURDIR)/$$@ |
| •93 |
$(EMACS_EXE) -Q -batch -L ../progs -l arm-texi-index.el --eval '(progn(do-index "$$@")(kill-emacs))' |
| 94 |
clean:: |
| 95 |
rm -f $(d)$(y).texinfo |
| 96 |
|
| 97 |
$(d)$(y).html: arm_form.exe $(SOURCES_$(y)) |
| 98 |
rm -f -r $$@ |
| 99 |
mkdir --parents $$@ |
| 100 |
cd $(SOURCE_DIR_$(y)); \ |
| 101 |
$(CURDIR)/$$< $(MASTER_$(d)) HTML $(CHANGES) $(VERSION_$(y)) $(VERSION_$(y)) $(CURDIR)/$$@/ |
| 102 |
clean:: |
| 103 |
rm -f -r $(d)$(y).html |
| 104 |
|
| 105 |
$(d)$(y).txt: arm_form.exe $(SOURCES_$(y)) |
| 106 |
rm -f -r $$@ |
| 107 |
mkdir --parents $$@ |
| 108 |
cd $(SOURCE_DIR_$(y)); \ |
| 109 |
$(CURDIR)/$$< $(MASTER_$(d)) Text $(CHANGES) $(VERSION_$(y)) $(VERSION_$(y)) $(CURDIR)/$$@/ |
| 110 |
for i in $$@/*; do \ |
| 111 |
iconv --from-code=iso8859-1 --to-code=utf-8 > $$@/tmp $$$$i && mv $$@/tmp $$$$i; \ |
| 112 |
done |
| 113 |
clean:: |
| 114 |
rm -f -r $(d)$(y).txt |
| 115 |
|
| 116 |
# texi2any is from texinfo 5 |
| •117 |
$(d)$(y).info: $(d)$(y).texinfo |
| 118 |
texi2any --info $(TEXI_INFO_OPTS) $$< -o $$@ |
| 119 |
clean:: |
| 120 |
rm -f $(d)$(y).info |
| 121 |
|
| 122 |
$(d)$(y).pdf: $(d)$(y).texinfo |
| 123 |
texi2any --pdf $(TEXI_PDF_OPTS) $$< -o $$@ |
| 124 |
clean:: |
| 125 |
rm -f $(d)$(y).aux $(d)$(y).cp $(d)$(y).cps $(d)$(y).log $(d)$(y).pdf $(d)$(y).toc |
| 126 |
|
| 127 |
endef |
| 128 |
$(foreach d,$(AVAILABLE_DOCUMENTS),\ |
| 129 |
$(foreach y,$(AVAILABLE_YEARS),\ |
| 130 |
$(eval $(doc_year_build)))) |
| 131 |
|
| 132 |
arm_form.exe : force |
| 133 |
gnatmake -p $(BUILDER_OPTIONS) -P arm_info.gpr $(foreach var,ADAFLAGS LDFLAGS,"-X$(var)=$($(var))") |
| 134 |
clean:: |
| 135 |
rm -f arm_form.exe |
| 136 |
rm -f -r objects __pycache__ |
| 137 |
|
| 138 |
trace : |
| 139 |
addr2line -e arm_form.exe 0x52f218 0x54d4de 0x402123 0x405c6e 0x401393 0x4014f9 0x7ffd98271410 0x7ffd990454f2 |
| 140 |
|
| 141 |
|
| 142 |
ZIP_VERSION := $(lastword $(AVAILABLE_YEARS)).1 |
| 143 |
|
| 144 |
INFO_ARCHIVE := arm_info-$(ZIP_VERSION).tar.gz |
| 145 |
SOURCE_ARCHIVE := arm_info-$(ZIP_VERSION)-src.tar.gz |
| 146 |
publish: $(INFO_ARCHIVE) $(SOURCE_ARCHIVE) |
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
GZIP := --no-name --best |
| 151 |
|
| 152 |
$(INFO_ARCHIVE): $(foreach d,$(DOCUMENTS),\ |
| 153 |
$(foreach y,$(YEARS),\ |
| 154 |
$(d)$(y).info)) |
| 155 |
tar cf - $^ | gzip $(GZIP) -c > $@ |
| 156 |
clean:: |
| 157 |
rm -f $(INFO_ARCHIVE) |
| 158 |
|
| 159 |
$(SOURCE_ARCHIVE): force |
| 160 |
(cd .. && git archive --prefix=arm_info-$(ZIP_VERSION)-src/ org.adaic.arm_form *) | gzip $(GZIP) -c > $@ |
| 161 |
|
| 162 |
clean:: |
| 163 |
rm -f $(SOURCE_ARCHIVE) |
| 164 |
|
| 165 |
update_upstream : source_ada.clean source_ada.stamp |
| 166 |
update_upstream : source_scribe_2005.clean source_scribe_2005.stamp |
| 167 |
update_upstream : source_scribe_2012.clean source_scribe_2012.stamp |
| 168 |
update_upstream : source_scribe_2020.clean source_scribe_2020.stamp |
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
source_ada.stamp : |
| 175 |
rm -rf ../../org.adaic.arm_form.upstream/progs |
| 176 |
cd ../../org.adaic.arm_form.upstream; $(PYTHON) ../org.adaic.arm_form/build/download.py progs |
| 177 |
touch source_ada.stamp |
| 178 |
|
| 179 |
source_ada.clean : |
| 180 |
rm -f source_ada.stamp |
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
source_scribe_%_downloaded.stamp : |
| 192 |
rm -rf ../../org.adaic.arm_form.upstream/source_$* |
| 193 |
cd ../../org.adaic.arm_form.upstream; $(PYTHON) ../org.adaic.arm_form/build/download.py $* |
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
mark_%_downloaded : |
| 198 |
touch source_scribe_$*_downloaded.stamp |
| 199 |
|
| 200 |
source_scribe_%.stamp : source_scribe_%_downloaded.stamp |
| 201 |
mv ../../org.adaic.arm_form.upstream/source ../../org.adaic.arm_form.upstream/source_$* |
| 202 |
touch source_scribe_$*.stamp |
| 203 |
|
| 204 |
source_scribe_%.clean : |
| 205 |
rm -f source_scribe_$*.stamp |
| 206 |
|
| 207 |
|
| 208 |
ARM_SRC.ZIP ARM_FORM.ZIP ARM_FSRC.ZIP 2005-SRC.zip 2012-SRC.zip : |
| 209 |
wget http://www.ada-auth.org/arm-files/$@ |
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
clean :: |
| 216 |
rm -f *.stamp *.zip |
| 217 |
|
| 218 |
info-clean : |
| 219 |
rm -f *.info* |
| 220 |
|
| 221 |
.PHONY : force |
| 222 |
|
| 223 |
VPATH = ../source_2005 ../source_2012 ../source_2020 ../progs |
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
|