Skip to content

Commit 67fd36e

Browse files
committed
testing: Avoid unnecessary rebuilds of components built from Git repos
Installing apparently changes the timestamp on the repo dir triggering make to checkout and build the whole thing again.
1 parent 3a4372c commit 67fd36e

File tree

7 files changed

+35
-28
lines changed

7 files changed

+35
-28
lines changed

testing/scripts/recipes/005_anet.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ PREFIX = /usr/local/ada
88

99
all: install
1010

11-
$(PKG):
12-
git clone $(SRC) $(PKG)
11+
.$(PKG)-cloned:
12+
[ -d $(PKG) ] || git clone $(SRC) $(PKG)
13+
@touch $@
1314

14-
.$(PKG)-cloned-$(REV): $(PKG)
15+
.$(PKG)-checkout-$(REV): .$(PKG)-cloned
1516
cd $(PKG) && git fetch && git checkout $(REV)
1617
@touch $@
1718

18-
.$(PKG)-built-$(REV): .$(PKG)-cloned-$(REV)
19+
.$(PKG)-built-$(REV): .$(PKG)-checkout-$(REV)
1920
cd $(PKG) && make LIBRARY_KIND=static
2021
@touch $@
2122

testing/scripts/recipes/006_tkm-rpc.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ export ADA_PROJECT_PATH=$(PREFIX)/lib/gnat
1010

1111
all: install
1212

13-
$(PKG):
14-
git clone $(SRC) $(PKG)
13+
.$(PKG)-cloned:
14+
[ -d $(PKG) ] || git clone $(SRC) $(PKG)
15+
@touch $@
1516

16-
.$(PKG)-cloned-$(REV): $(PKG)
17+
.$(PKG)-checkout-$(REV): .$(PKG)-cloned
1718
cd $(PKG) && git fetch && git checkout $(REV)
1819
@touch $@
1920

20-
.$(PKG)-built-$(REV): .$(PKG)-cloned-$(REV)
21+
.$(PKG)-built-$(REV): .$(PKG)-checkout-$(REV)
2122
cd $(PKG) && make
2223
@touch $@
2324

testing/scripts/recipes/007_x509-ada.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ PREFIX = /usr/local/ada
88

99
all: install
1010

11-
$(PKG):
12-
git clone $(SRC) $(PKG)
11+
.$(PKG)-cloned:
12+
[ -d $(PKG) ] || git clone $(SRC) $(PKG)
13+
@touch $@
1314

14-
.$(PKG)-cloned-$(REV): $(PKG)
15+
.$(PKG)-checkout-$(REV): .$(PKG)-cloned
1516
cd $(PKG) && git fetch && git checkout $(REV)
1617
@touch $@
1718

18-
.$(PKG)-built-$(REV): .$(PKG)-cloned-$(REV)
19+
.$(PKG)-built-$(REV): .$(PKG)-checkout-$(REV)
1920
cd $(PKG) && make tests && make
2021
@touch $@
2122

testing/scripts/recipes/008_xfrm-ada.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ export ADA_PROJECT_PATH=$(PREFIX)/lib/gnat
1010

1111
all: install
1212

13-
$(PKG):
14-
git clone $(SRC) $(PKG)
13+
.$(PKG)-cloned:
14+
[ -d $(PKG) ] || git clone $(SRC) $(PKG)
15+
@touch $@
1516

16-
.$(PKG)-cloned-$(REV): $(PKG)
17+
.$(PKG)-checkout-$(REV): .$(PKG)-cloned
1718
cd $(PKG) && git fetch && git checkout $(REV)
1819
@touch $@
1920

20-
.$(PKG)-built-$(REV): .$(PKG)-cloned-$(REV)
21+
.$(PKG)-built-$(REV): .$(PKG)-checkout-$(REV)
2122
cd $(PKG) && make
2223
@touch $@
2324

testing/scripts/recipes/009_xfrm-proxy.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ export ADA_PROJECT_PATH=/usr/local/ada/lib/gnat
88

99
all: install
1010

11-
$(PKG):
12-
git clone $(SRC) $(PKG)
11+
.$(PKG)-cloned:
12+
[ -d $(PKG) ] || git clone $(SRC) $(PKG)
13+
@touch $@
1314

14-
.$(PKG)-cloned-$(REV): $(PKG)
15+
.$(PKG)-checkout-$(REV): .$(PKG)-cloned
1516
cd $(PKG) && git fetch && git checkout $(REV)
1617
@touch $@
1718

18-
.$(PKG)-built-$(REV): .$(PKG)-cloned-$(REV)
19+
.$(PKG)-built-$(REV): .$(PKG)-checkout-$(REV)
1920
cd $(PKG) && make
2021
@touch $@
2122

testing/scripts/recipes/010_tkm.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ export ADA_PROJECT_PATH=/usr/local/ada/lib/gnat
88

99
all: install
1010

11-
$(PKG):
12-
git clone $(SRC) $(PKG)
11+
.$(PKG)-cloned:
12+
[ -d $(PKG) ] || git clone $(SRC) $(PKG)
13+
@touch $@
1314

14-
.$(PKG)-cloned-$(REV): $(PKG)
15+
.$(PKG)-checkout-$(REV): .$(PKG)-cloned
1516
cd $(PKG) && git fetch && git checkout $(REV)
1617
@touch $@
1718

18-
.$(PKG)-built-$(REV): .$(PKG)-cloned-$(REV)
19+
.$(PKG)-built-$(REV): .$(PKG)-checkout-$(REV)
1920
cd $(PKG) && make
2021
@touch $@
2122

testing/scripts/recipes/011_botan.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ CONFIG_OPTS = \
1515

1616
all: install
1717

18-
$(PKG):
19-
git clone $(SRC) $(PKG)
18+
.$(PKG)-cloned:
19+
[ -d $(PKG) ] || git clone $(SRC) $(PKG)
20+
@touch $@
2021

21-
.$(PKG)-cloned-$(REV): $(PKG)
22+
.$(PKG)-checkout-$(REV): .$(PKG)-cloned
2223
cd $(PKG) && git fetch && git checkout $(REV)
2324
@touch $@
2425

25-
.$(PKG)-built-$(REV): .$(PKG)-cloned-$(REV)
26+
.$(PKG)-built-$(REV): .$(PKG)-checkout-$(REV)
2627
cd $(PKG) && python ./configure.py $(CONFIG_OPTS) && make -j $(NUM_CPUS)
2728
@touch $@
2829

0 commit comments

Comments
 (0)