-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
107 lines (84 loc) · 2.87 KB
/
Makefile
File metadata and controls
107 lines (84 loc) · 2.87 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#
# make
# make all -- build everything
#
# make install -- install picosim binaries to /usr/local
#
# make clean -- remove build files
#
all: build
$(MAKE) -C build $@
install: build
$(MAKE) -C build $@
clean:
rm -rf build
.PHONY: all clean install patches
# Configure for build
build: bash
cmake -B $@ .
#
# Checkout Bash sources.
# Select a specific commit.
#
BASH_REPO = https://github.com/sailfishos-mirror/bash.git
BASH_5_2_PATCH_21 = 2bb3cbefdb8fd019765b1a9cc42ecf37ff22fec6
bash:
git clone --depth 30 $(BASH_REPO) $@
(cd $@; git reset --hard $(BASH_5_2_PATCH_21))
#
# Create patches from C sources.
#
PATCHES = patches/bashline.diff \
patches/display.diff \
patches/terminal.diff \
patches/locale.diff \
patches/sig.diff \
patches/variables.diff \
patches/parse.diff
patches: bash $(PATCHES)
patches/bashline.diff: bash/bashline.c bashline.c
-diff -u -w bash/bashline.c bashline.c > $@
patches/display.diff: bash/lib/readline/display.c lib/readline/display.c
-diff -u -w bash/lib/readline/display.c lib/readline/display.c > $@
patches/terminal.diff: bash/lib/readline/terminal.c lib/readline/terminal.c
-diff -u -w bash/lib/readline/terminal.c lib/readline/terminal.c > $@
patches/locale.diff: bash/locale.c locale.c
-diff -u -w bash/locale.c locale.c > $@
patches/sig.diff: bash/sig.c sig.c
-diff -u -w bash/sig.c sig.c > $@
patches/variables.diff: bash/variables.c variables.c
-diff -u -w bash/variables.c variables.c > $@
patches/parse.diff: bash/parse.y parse.y
-diff -u -w bash/parse.y parse.y > $@
#
# Create C sources by applying patches to the original Bash code.
#
SOURCES = bashline.c-new \
lib/readline/display.c-new \
lib/readline/terminal.c-new \
locale.c-new \
sig.c-new \
variables.c-new \
parse.y-new
sources: bash $(SOURCES)
@mv bashline.c-new bashline.c
@mv lib/readline/display.c-new lib/readline/display.c
@mv lib/readline/terminal.c-new lib/readline/terminal.c
@mv locale.c-new locale.c
@mv sig.c-new sig.c
@mv variables.c-new variables.c
@mv parse.y-new parse.y
bashline.c-new: bash/bashline.c
patch --ignore-whitespace -o $@ bash/bashline.c patches/bashline.diff
lib/readline/display.c-new: bash/lib/readline/display.c
patch --ignore-whitespace -o $@ bash/lib/readline/display.c patches/display.diff
lib/readline/terminal.c-new: bash/lib/readline/terminal.c
patch --ignore-whitespace -o $@ bash/lib/readline/terminal.c patches/terminal.diff
locale.c-new: bash/locale.c
patch --ignore-whitespace -o $@ bash/locale.c patches/locale.diff
sig.c-new: bash/sig.c
patch --ignore-whitespace -o $@ bash/sig.c patches/sig.diff
variables.c-new: bash/variables.c
patch --ignore-whitespace -o $@ bash/variables.c patches/variables.diff
parse.y-new: bash/parse.y
patch --ignore-whitespace -o $@ bash/parse.y patches/parse.diff