aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: b1c7467e5de6f37ca66644870369c99191b45ea7 (plain) (blame)
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
# Top-level build of packages for Novena PVT-1.
#
# Building source and binary packages separately isn't strictly
# necessary, but simplifies fault isolation.
#
# We generate the changes file on the fly to keep all the version
# information in one place.  Nothing actually uses the changes file
# once we've generated the source package, so this is harmless.  If
# somebody really wants to be the human maintainer for a changes
# file, be my guest.
#
# We don't sign anything yet.  This will need fixing.

# Version of the software in human terms (major.minor)

export CRYPTECH_VERSION := 1.0

# Version suffix to add to package names.  The extra fields come from
# HEAD of the git superrepository.  The date field is primarily to
# make sure that versions sort into the correct order when fed to
# reprepro; the commit hash uniquely identifies the (base) version of
# the superrepository that generated the packages.  This won't help if
# somebody publishes packages generated with a modified version of the
# superrepository, so don't do that (add check for uncommitted # changes?)

ifdef NOTYET

HEAD_TIME := $(shell git show -s --format=%ct HEAD)
HEAD_HASH := $(shell git rev-parse HEAD)

CRYPTECH_PACKAGE_VERSION := ${CRYPTECH_VERSION}~${HEAD_TIME}~${HEAD_HASH}

else

CRYPTECH_PACKAGE_VERSION := ${CRYPTECH_VERSION}~something

endif

# Make sure git can find certificatess.  We might want to change this
# to use GIT_SSL_CAINFO so we can specify a particular file, perhaps
# even a file in this repository, but skip that for the moment.

export GIT_SSL_CAPATH=/etc/ssl/certs

# Command to generate a new changelog containing one entry.
# Does nothing if the changelog already exists.

DCH =	test -f debian/changelog || \
	EDITOR=true VISUAL=true TZ=UTC DEBEMAIL='APT Builder Robot <aptbot@cryptech.is>' \
	dch --create --package cryptech-novena-$(1) --newversion '${CRYPTECH_PACKAGE_VERSION}' \
	'Version ${CRYPTECH_VERSION} of Cryptech $(2) for the Novena PVT-1 development board.'


all: init sw rtl

init:
	git submodule update --init --recursive

sw:
	cd sw; $(call DCH,sw,software tools)
	cd sw; debuild -S -uc -us
	cd sw; debuild -b -uc -us -aarmhf

rtl:
	cd rtl; $(call DCH,rtl,RTL bitstream)
	cd rtl; debuild -S -uc -us
	cd rtl; debuild -b -uc -us


.PHONY: sw rtl