~ubuntu-security/ubuntu-cve-tracker/master

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
# To test this Makefile, just run "export TARGET=/path/to/output" before
# running "make" and output will be generated there. To test flavors output,
# also run "export SUPPORT_DB=/pat/to/json/support/db" and run "make".
#
# If you set the UCT and UCT_REVIEWED environment variables, then only the
# scripts from the UCT_REVIEWED directory will be used (using the data from the
# UCT directory).

SCRIPTS_RELDIR=/scripts
UCT_SCRIPTS=$(shell pwd)$(SCRIPTS_RELDIR)
ifneq ($(UCT_REVIEWED)$(SCRIPTS_RELDIR),$(SCRIPTS_RELDIR))
	UCT_SCRIPTS=$(UCT_REVIEWED)$(SCRIPTS_RELDIR)
endif
export SCRIPTS=$(UCT_SCRIPTS)
export ACTIVE=$(shell pwd)/active

all: cves pkgs tables

prep:
	rsync -a $(SCRIPTS)/html-top/. $(TARGET)/

cves: prep
	$(MAKE) -C active
	$(MAKE) -C retired
	$(MAKE) -C ignored

pkgs: prep
	# Always regenerate the pkgs makefile, the next call will sort out
	# what has or has not changed.
	$(SCRIPTS)/generate-pkgs-makefile.py > $(TARGET)/.pkgs-makefile
	$(MAKE) -f $(TARGET)/.pkgs-makefile

tables: prep
	if [ -e "$(SUPPORT_DB)" ]; then \
		$(SCRIPTS)/html-report -d $(TARGET) -D $(SUPPORT_DB) ; \
		$(SCRIPTS)/html-report -d $(TARGET) -S -D $(SUPPORT_DB) ; \
	else \
		$(SCRIPTS)/html-report -d $(TARGET) ; \
		$(SCRIPTS)/html-report -d $(TARGET) -S ; \
	fi \

.PHONY: prep cves pkgs tables