blob: c2599ad9750c5fdf8be3491d72872f2e096af91d (
plain)
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
|
BUILD_DIR := ./build
LICENSE := $(BUILD_DIR)/LICENSE.txt
DATE := $(BUILD_DIR)/date.txt
VERSION_FILE := $(BUILD_DIR)/version.txt
ARTIFACTS_DIR := $(BUILD_DIR)/artifacts
VERSION := $(shell git describe --dirty --always)
TARGET_NAME := soundbox-$(VERSION)
VERSIONED_DOC := $(ARTIFACTS_DIR)/$(TARGET_NAME)-documentation.pdf
TARGET_DIR := $(ARTIFACTS_DIR)/$(TARGET_NAME)
ARCHIVE := $(ARTIFACTS_DIR)/$(TARGET_NAME).tar.zst
all: $(ARCHIVE) $(VERSIONED_DOC)
$(LICENSE):
cp LICENSE.txt $@
.PHONY: $(DATE)
$(DATE):
git show -s --format=%cs > $@
.PHONY: $(VERSION_FILE)
$(VERSION_FILE):
echo '$(VERSION)' > $@
$(ARCHIVE): $(TARGET_DIR)
tar --zstd -cf $@ -C $(ARTIFACTS_DIR) $(TARGET_NAME)
$(VERSIONED_DOC): doc
install -Dm 644 $(BUILD_DIR)/doc/documentation.pdf $@
$(TARGET_DIR): debug
rm -rf $@
mkdir -p $@
install -Dm 644 $(BUILD_DIR)/doc/documentation.pdf $@
debug: doc pcb
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)
include doc/doc.mk
include pcb/pcb.mk
|