forked from blocksds/sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (63 loc) · 1.92 KB
/
Makefile
File metadata and controls
79 lines (63 loc) · 1.92 KB
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
# SPDX-License-Identifier: CC0-1.0
#
# SPDX-FileContributor: Antonio Niño Díaz, 2023-2025
# Tools
# -----
CP := cp
INSTALL := install
MAKE := make
RM := rm -rf
# Version string handling
# -----------------------
# Try to generate a version string if it isn't already provided
ifeq ($(VERSION_STRING),)
# Try an exact match with a tag (e.g. v1.12.1)
VERSION_STRING := $(shell git describe --tags --exact-match --dirty 2>/dev/null)
ifeq ($(VERSION_STRING),)
# Try a non-exact match (e.g. v1.12.1-3-g67a811a)
VERSION_STRING := $(shell git describe --tags --dirty 2>/dev/null)
ifeq ($(VERSION_STRING),)
# If no version is provided by the user or git, fall back to this
VERSION_STRING := DEV
endif
endif
endif
# Targets
# -------
.PHONY: all clean examples install libs sys templates tests tools
all: libs sys tools
examples:
+$(MAKE) -C examples
# libnds depends on grit and bin2c
libs: tools
+$(MAKE) -C libs VERSION_STRING=$(VERSION_STRING)
# The default ARM7 depends on some libraries
sys: libs
+$(MAKE) -C sys
templates:
+$(MAKE) -C templates
tests:
+$(MAKE) -C tests
tools:
+$(MAKE) -C tools VERSION_STRING=$(VERSION_STRING)
# Default installation path of BlocksDS core components
INSTALLDIR ?= /opt/blocksds/core/
INSTALLDIR_ABS := $(abspath $(INSTALLDIR))
install: all
@echo " INSTALL $(INSTALLDIR_ABS)"
@test $(INSTALLDIR_ABS)
$(RM) $(INSTALLDIR_ABS)
$(INSTALL) -d $(INSTALLDIR_ABS)
+$(MAKE) -C libs install INSTALLDIR=$(INSTALLDIR_ABS)/libs
+$(MAKE) -C sys install INSTALLDIR=$(INSTALLDIR_ABS)/sys
+$(MAKE) -C tools install INSTALLDIR=$(INSTALLDIR_ABS)/tools
+$(CP) -r sys/cmake $(INSTALLDIR_ABS)/cmake
+$(CP) -r licenses $(INSTALLDIR_ABS)
@echo $(VERSION_STRING) > $(INSTALLDIR)/version.txt
clean:
+$(MAKE) -C examples clean
+$(MAKE) -C libs clean
+$(MAKE) -C sys clean
+$(MAKE) -C tests clean
+$(MAKE) -C templates clean
+$(MAKE) -C tools clean