forked from tenbaht/sduino
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.tools
More file actions
81 lines (59 loc) · 2.27 KB
/
Makefile.tools
File metadata and controls
81 lines (59 loc) · 2.27 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
80
81
NAME=sduino-tools
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 find the tools directory
BASEDIR=../sduino
# Ignore all files matching one of these shell patterns:
IGNORE=*~ *bak x build-* *.orig *.rej
# where to put the generated files
ARCHIVEDIR=release/v$(COREVERSION)
PARTSDIR=parts
#
### No user serviceable part below here. Only generated content. ########
#
# The filename stem of the tools archives to be generated
# (up to the first dash '-')
TOOLS_STEM=$(ARCHIVEDIR)/$(NAME)
# filename for the new tools entries
TOOLS_ENTRY=$(PARTSDIR)/tools-entry-$(NAME)-$(TOOLSVERSION).txt
# The individual filenames for the different tools archives
TOOLS_LINUX32=$(ARCHIVEDIR)/$(NAME)_linux32-$(TOOLSVERSION).tar.bz2
TOOLS_LINUX64=$(ARCHIVEDIR)/$(NAME)_linux64-$(TOOLSVERSION).tar.bz2
TOOLS_MACOSX=$(ARCHIVEDIR)/$(NAME)_macosx-$(TOOLSVERSION).tar.bz2
TOOLS_WINDOWS=$(ARCHIVEDIR)/$(NAME)_mingw32-$(TOOLSVERSION).tar.bz2
TOOLS_TARS=$(TOOLS_LINUX32) $(TOOLS_LINUX64) $(TOOLS_MACOSX) $(TOOLS_WINDOWS)
EXCLUDES=$(addprefix --exclude=, $(IGNORE))
#
# The actual rules
#
# generate one tools entry for all matching tools files
$(TOOLS_ENTRY) : $(TOOLS_TARS)
./gen_tools_entry.sh "$(TOOLS_STEM)" "$(TOOLSVERSION)" "$(COREVERSION)" > $@
$(TOOLS_LINUX32): | $(ARCHIVEDIR)
@echo "Generating the tools archive file for Linux 32 bit."
tar cjf $@ $(EXCLUDES) -C $(BASEDIR) --transform s/linux32/linux/ \
tools/wrapper tools/linux32
$(TOOLS_LINUX64): | $(ARCHIVEDIR)
@echo "Generating the tools archive file for Linux 64 bit."
tar cjf $@ $(EXCLUDES) -C $(BASEDIR) --transform s/linux64/linux/ \
tools/wrapper tools/linux64
$(TOOLS_MACOSX): | $(ARCHIVEDIR)
@echo "Generating the tools archive file for Mac OSX"
tar cjf $@ $(EXCLUDES) -C $(BASEDIR) tools/wrapper tools/macosx
$(TOOLS_WINDOWS): | $(ARCHIVEDIR)
@echo "Generating the tools archive file for Windows."
tar cjhf $@ $(EXCLUDES) -C $(BASEDIR) tools/wrapper tools/win
# 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.
$(ARCHIVEDIR):
mkdir -p $@