-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
136 lines (106 loc) · 3.89 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
NAME=keystoreada
-include Makefile.conf
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
ifeq ($(HAVE_FUSE),yes)
FUSE_LIBS := $(shell pkg-config --libs fuse)
export FUSE_LIBS
ifeq ($(USE_GIT_FUSE),yes)
ADA_FUSE_SYSTEM := $(shell uname -sm | sed "s- -_-g")
export ADA_FUSE_SYSTEM
endif
endif
include Makefile.defaults
# Build executables for all mains defined by the project.
build-test:: setup
$(GNATMAKE) $(GPRFLAGS) -p -P$(NAME)_tests $(MAKE_ARGS)
build:: tools
tools: tools/akt-configs.ads setup
$(GNATMAKE) $(GPRFLAGS) -p -P$(NAME)_tools $(MAKE_ARGS)
tools/akt-configs.ads: Makefile.conf tools/akt-configs.gpb
gnatprep -DPREFIX='"${prefix}"' -DVERSION='"$(VERSION)"' \
tools/akt-configs.gpb tools/akt-configs.ads
install::
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
ifeq ($(HAVE_GTK),yes)
build:: gtk
gtk:
$(GNATMAKE) $(GPRFLAGS) -p -P$(NAME)_gtk $(MAKE_ARGS)
install::
$(INSTALL) bin/gakt $(DESTDIR)$(prefix)/bin/gakt
$(INSTALL) man/man1/akt.1 $(DESTDIR)$(prefix)/share/man/man1/gakt.1
mkdir -p $(DESTDIR)$(prefix)/share/gakt
$(INSTALL) gakt.glade $(DESTDIR)$(prefix)/share/gakt/gakt.glade
endif
ifeq ($(HAVE_FUSE),yes)
ifeq ($(USE_GIT_FUSE),yes)
setup:: ada-fuse/ada_fuse.gpr
cd ada-fuse && ./setup.py
endif
endif
# Build and run the unit tests
test: build stamp-test-setup
bin/keystore_harness -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,alire.toml,ke/keystoreada,keystoreada-$(VERSION).toml))
$(eval $(call alire_publish,alire-akt.toml,ak/akt,akt-$(VERSION).toml))
DIST_DIRS=ada-util ada-fuse
dist::
rm -f $(DIST_FILE)
git archive -o $(DIST_DIR).tar --prefix=$(DIST_DIR)/ HEAD
for i in $(DIST_DIRS); do \
cd $$i && git archive -o ../$$i.tar --prefix=$(DIST_DIR)/$$i/ HEAD ; \
cd .. && tar --concatenate --file=$(DIST_DIR).tar $$i.tar ; \
rm -f $$i.tar; \
done
gzip $(DIST_DIR).tar
.PHONY: tools gtk