forked from tenbaht/sduino
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.core
More file actions
59 lines (45 loc) · 1.45 KB
/
Makefile.core
File metadata and controls
59 lines (45 loc) · 1.45 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
NAME=sduino
ifndef COREVERSION
$(error COREVERSION is not set)
endif
ifndef SDCCVERSION
$(error SDCCVERSION is not set)
endif
ifndef TOOLSVERSION
$(error TOOLSVERSION is not set)
endif
# where to put the generated files
COREDIR?=release/v$(COREVERSION)
PARTSDIR?=parts
# subtree of the repository to be included in the archive
SUBTREE=sduino/stm8
#
### No user serviceable part below here. ################################
#
# filename for the generated core file
COREFILE=$(COREDIR)/$(NAME)-core-$(COREVERSION).tar.bz2
# filename for the new platform entry
PLATFORM_ENTRY=$(PARTSDIR)/platform-entry-$(NAME)-$(COREVERSION).txt
EXCLUDES=$(addprefix --exclude=, $(IGNORE))
#
# The actual rules
#
# generate one platform entry for the new core file
$(PLATFORM_ENTRY): $(COREFILE)
./gen_platform_entry.sh $^ "$(COREVERSION)" "$(SDCCVERSION)" "$(TOOLSVERSION)" |\
sed "s/^/ /" > $@
$(COREFILE): | $(COREDIR)
echo "Generating the core archive file."
$(eval TMPDIR := $(shell mktemp -d))
cd ..; git archive -v HEAD:sduino/stm8|tar -x -C $(TMPDIR)
sed -i '/^tools\.stm8/ s#{runtime.hardware.path}/tools#{runtime.tools.STM8Tools.path}#' \
$(TMPDIR)/platform.txt
tar cvjf $(COREFILE) -C $(TMPDIR) .
rm -rf $(TMPDIR)
# make a new release directory if not present
#
# make sure to define an order-only dependency on this rule by placing it on
# the right side of a pipe symbol. This prevents rebuilding the archives
# every time.
$(COREDIR):
mkdir -p $@