-
Notifications
You must be signed in to change notification settings - Fork 64
/
makefile
56 lines (42 loc) · 1.28 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
SHELL=/bin/bash
# i.e. fedora28.yaml
ALL_META_TEMPLATES=$(wildcard templates/*.yaml)
ALL_PRESETS=$(wildcard presets/*.yaml)
METASOURCES=$(ALL_META_TEMPLATES) $(ALL_PRESETS)
# target architecture
TARGET_ARCH?=x86_64
# Make sure the version is defined
export VERSION=$(shell ./version.sh)
export REVISION=$(shell ./revision.sh)
dist/templates/%.yaml: generate
dist/common-templates.yaml: generate
( \
echo -n "# Version " ; \
git describe --always --tags HEAD ; \
for F in $(ALL_PRESETS) dist/templates/*.yaml; \
do \
echo "---" ; \
echo "# Source: $$F" ; \
cat $$F ; \
done ; \
) >$@
release: dist/common-templates.yaml
cp dist/common-templates.yaml dist/common-templates-$(VERSION).yaml
e2e-tests:
./automation/test.sh
go-tests:
go test -v ./tests/
unit-tests: generate
./automation/unit-tests.sh
validate-no-offensive-lang:
./automation/validate-no-offensive-lang.sh
generate: generate-templates.yaml $(METASOURCES)
# Just build the XML files, no need to export to tarball
make -C osinfo-db/ OSINFO_DB_EXPORT=echo
ansible-playbook generate-templates.yaml -e "target_arch=$(TARGET_ARCH)"
update-osinfo-db:
git submodule init
git submodule update --remote osinfo-db
clean:
rm -rf dist/templates
.PHONY: all generate release e2e-tests unit-tests go-tests