-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
119 lines (96 loc) · 3.42 KB
/
Makefile
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
NAME=keystoreada
VERSION=1.4.1
DIST_DIR=ada-keystore-$(VERSION)
DIST_FILE=ada-keystore-$(VERSION).tar.gz
MAKE_ARGS += -XKEYSTORE_BUILD=$(BUILD)
-include Makefile.conf
HAVE_FUSE?=yes
HAVE_AKT?=yes
STATIC_MAKE_ARGS = $(MAKE_ARGS) -XKEYSTORE_LIBRARY_TYPE=static
SHARED_MAKE_ARGS = $(MAKE_ARGS) -XKEYSTORE_LIBRARY_TYPE=relocatable
SHARED_MAKE_ARGS += -XUTILADA_BASE_BUILD=relocatable -XUTIL_LIBRARY_TYPE=relocatable
SHARED_MAKE_ARGS += -XXMLADA_BUILD=relocatable
SHARED_MAKE_ARGS += -XLIBRARY_TYPE=relocatable
include Makefile.defaults
setup::
echo "HAVE_FUSE=$(HAVE_FUSE)" >> Makefile.conf
echo "HAVE_AKT=$(HAVE_AKT)" >> Makefile.conf
# Build executables for all mains defined by the project.
build-test:: lib-setup
cd regtests && $(BUILD_COMMAND) $(GPRFLAGS) $(MAKE_ARGS)
build:: tools
ifeq ($(HAVE_AKT),yes)
tools: akt/src/akt-configs.ads
ifeq ($(HAVE_ALIRE),yes)
cd akt && $(BUILD_COMMAND) $(GPRFLAGS) $(MAKE_ARGS)
else
ifeq ($(HAVE_FUSE),yes)
cd akt && $(BUILD_COMMAND) $(GPRFLAGS) $(MAKE_ARGS) -Pakt_fuse.gpr
else
cd akt && $(BUILD_COMMAND) $(GPRFLAGS) $(MAKE_ARGS) -Pakt_nofuse.gpr
endif
endif
else
tools:
endif
akt/src/akt-configs.ads: akt/src/akt-configs.gpb
$(GNATPREP) -DPREFIX='"${prefix}"' -DVERSION='"$(VERSION)"' \
akt/src/akt-configs.gpb akt/src/akt-configs.ads
ifeq ($(HAVE_AKT),yes)
install:: install-akt
install-akt::
mkdir -p $(DESTDIR)$(prefix)/bin
$(INSTALL) bin/akt $(DESTDIR)$(prefix)/bin/akt
mkdir -p $(DESTDIR)$(prefix)/share/man/man1
$(INSTALL) man/man1/akt.1 $(DESTDIR)$(prefix)/share/man/man1/akt.1
(cd share && tar --exclude='*~' -cf - .) \
| (cd $(DESTDIR)$(prefix)/share/ && tar xf -)
mkdir -p $(DESTDIR)$(prefix)/share/locale/fr/LC_MESSAGES
$(INSTALL) po/fr.mo $(DESTDIR)$(prefix)/share/locale/fr/LC_MESSAGES/akt.mo
endif
# Build and run the unit tests
test: build stamp-test-setup
bin/keystore_harness -v -l $(NAME): -t 120 -xml keystore-aunit.xml -config tests.properties
stamp-test-setup:
# Apply access constraints to the test key and directory.
chmod 600 regtests/files/file.key
chmod 700 regtests/files
sh regtests/files/setup-tests.sh > test-setup.log 2>&1
touch stamp-test-setup
clean::
rm -f stamp-test-setup tests.log
install-samples:
$(MKDIR) -p $(samplesdir)/samples
cp -rp $(srcdir)/samples/*.ad[sb] $(samplesdir)/samples/
cp -p $(srcdir)/samples.gpr $(samplesdir)
cp -p $(srcdir)/config.gpr $(samplesdir)
KEYSTORE_DOC= \
title.md \
pagebreak.tex \
index.md \
pagebreak.tex \
Installation.md \
pagebreak.tex \
Using.md \
pagebreak.tex \
Keystore_Programming.md \
pagebreak.tex \
Keystore_Tool.md \
pagebreak.tex \
Keystore_Design.md
DOC_OPTIONS=-f markdown -o keystoreada-book.pdf --listings --number-sections --toc
HTML_OPTIONS=-f markdown -o keystoreada-book.html --listings --number-sections --toc --css pandoc.css
$(eval $(call pandoc_build,keystoreada-book,$(KEYSTORE_DOC),\
cat docs/Programming.md docs/Keystore.md > docs/Keystore_Programming.md; \
cat docs/Tool.md docs/akt.md > docs/Keystore_Tool.md; \
cat docs/Design.md \
docs/Keystore_IO_Headers.md \
docs/Keystore_Passwords_GPG.md \
docs/Keystore_Keys.md \
docs/Keystore_Repository_Entries.md \
docs/Keystore_Repository_Data.md \
docs/Design_Implementation.md > docs/Keystore_Design.md))
$(eval $(call ada_library,$(NAME),.))
$(eval $(call alire_publish,.,ke/keystoreada,keystoreada-$(VERSION).toml))
$(eval $(call alire_publish,akt,ak/akt,akt-$(VERSION).toml))
.PHONY: tools gtk