Skip to content

Commit

Permalink
examples: ensure the proper build order
Browse files Browse the repository at this point in the history
The Makefiles for the examples lacked dependencies between rules,
resulting in some cases a build error. To maintain a coherent build
process, this commit introduces dependencies to ensure that binaries are
built before being stripped and signed.

Signed-off-by: Joakim Bech <[email protected]>
Tested-by: Joakim Bech <[email protected]>
Reviewed-by: Sumit Garg <[email protected]>
Acked-by: Yuan Zhuang <[email protected]>
  • Loading branch information
jbech-linaro authored and DemesneGH committed Mar 19, 2024
1 parent 2af52d7 commit ec3eefd
Show file tree
Hide file tree
Showing 26 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion examples/acipher-rs/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ all: host strip
host:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: host
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/$(NAME) $(OUT_DIR)/$(NAME)

clean:
Expand Down
4 changes: 2 additions & 2 deletions examples/acipher-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ all: ta strip sign
ta:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: ta
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta

sign:
sign: strip
@$(SIGN) --uuid $(UUID) --key $(TA_SIGN_KEY) --in $(OUT_DIR)/stripped_ta --out $(OUT_DIR)/$(UUID).ta
@echo "SIGN => ${UUID}"

Expand Down
2 changes: 1 addition & 1 deletion examples/aes-rs/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ all: host strip
host:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: host
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/$(NAME) $(OUT_DIR)/$(NAME)

clean:
Expand Down
4 changes: 2 additions & 2 deletions examples/aes-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ all: ta strip sign
ta:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: ta
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta

sign:
sign: strip
@$(SIGN) --uuid $(UUID) --key $(TA_SIGN_KEY) --in $(OUT_DIR)/stripped_ta --out $(OUT_DIR)/$(UUID).ta
@echo "SIGN => ${UUID}"

Expand Down
2 changes: 1 addition & 1 deletion examples/authentication-rs/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ all: host strip
host:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: host
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/$(NAME) $(OUT_DIR)/$(NAME)

clean:
Expand Down
4 changes: 2 additions & 2 deletions examples/authentication-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ all: ta strip sign
ta:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: ta
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta

sign:
sign: strip
@$(SIGN) --uuid $(UUID) --key $(TA_SIGN_KEY) --in $(OUT_DIR)/stripped_ta --out $(OUT_DIR)/$(UUID).ta
@echo "SIGN => ${UUID}"

Expand Down
2 changes: 1 addition & 1 deletion examples/big_int-rs/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ all: host strip
host:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: host
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/$(NAME) $(OUT_DIR)/$(NAME)

clean:
Expand Down
4 changes: 2 additions & 2 deletions examples/big_int-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ all: ta strip sign
ta:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: ta
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta

sign:
sign: strip
@$(SIGN) --uuid $(UUID) --key $(TA_SIGN_KEY) --in $(OUT_DIR)/stripped_ta --out $(OUT_DIR)/$(UUID).ta
@echo "SIGN => ${UUID}"

Expand Down
2 changes: 1 addition & 1 deletion examples/diffie_hellman-rs/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ all: host strip
host:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: host
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/$(NAME) $(OUT_DIR)/$(NAME)

clean:
Expand Down
4 changes: 2 additions & 2 deletions examples/diffie_hellman-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ all: ta strip sign
ta:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: ta
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta

sign:
sign: strip
@$(SIGN) --uuid $(UUID) --key $(TA_SIGN_KEY) --in $(OUT_DIR)/stripped_ta --out $(OUT_DIR)/$(UUID).ta
@echo "SIGN => ${UUID}"

Expand Down
2 changes: 1 addition & 1 deletion examples/digest-rs/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ all: host strip
host:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: host
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/$(NAME) $(OUT_DIR)/$(NAME)

clean:
Expand Down
4 changes: 2 additions & 2 deletions examples/digest-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ all: ta strip sign
ta:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: ta
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta

sign:
sign: strip
@$(SIGN) --uuid $(UUID) --key $(TA_SIGN_KEY) --in $(OUT_DIR)/stripped_ta --out $(OUT_DIR)/$(UUID).ta
@echo "SIGN => ${UUID}"

Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world-rs/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ all: host strip
host:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: host
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/$(NAME) $(OUT_DIR)/$(NAME)

clean:
Expand Down
4 changes: 2 additions & 2 deletions examples/hello_world-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ all: ta strip sign
ta:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: ta
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta

sign:
sign: strip
@$(SIGN) --uuid $(UUID) --key $(TA_SIGN_KEY) --in $(OUT_DIR)/stripped_ta --out $(OUT_DIR)/$(UUID).ta
@echo "SIGN => ${UUID}"

Expand Down
2 changes: 1 addition & 1 deletion examples/hotp-rs/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ all: host strip
host:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: host
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/$(NAME) $(OUT_DIR)/$(NAME)

clean:
Expand Down
4 changes: 2 additions & 2 deletions examples/hotp-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ all: ta strip sign
ta:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: ta
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta

sign:
sign: strip
@$(SIGN) --uuid $(UUID) --key $(TA_SIGN_KEY) --in $(OUT_DIR)/stripped_ta --out $(OUT_DIR)/$(UUID).ta
@echo "SIGN => ${UUID}"

Expand Down
2 changes: 1 addition & 1 deletion examples/random-rs/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ all: host strip
host:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: host
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/$(NAME) $(OUT_DIR)/$(NAME)

clean:
Expand Down
4 changes: 2 additions & 2 deletions examples/random-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ all: ta strip sign
ta:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: ta
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta

sign:
sign: strip
@$(SIGN) --uuid $(UUID) --key $(TA_SIGN_KEY) --in $(OUT_DIR)/stripped_ta --out $(OUT_DIR)/$(UUID).ta
@echo "SIGN => ${UUID}"

Expand Down
2 changes: 1 addition & 1 deletion examples/secure_storage-rs/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ all: host strip
host:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: host
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/$(NAME) $(OUT_DIR)/$(NAME)

clean:
Expand Down
4 changes: 2 additions & 2 deletions examples/secure_storage-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ all: ta strip sign
ta:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: ta
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta

sign:
sign: strip
@$(SIGN) --uuid $(UUID) --key $(TA_SIGN_KEY) --in $(OUT_DIR)/stripped_ta --out $(OUT_DIR)/$(UUID).ta
@echo "SIGN => ${UUID}"

Expand Down
2 changes: 1 addition & 1 deletion examples/signature_verification-rs/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ all: host strip
host:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: host
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/$(NAME) $(OUT_DIR)/$(NAME)

clean:
Expand Down
4 changes: 2 additions & 2 deletions examples/signature_verification-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ all: ta strip sign
ta:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: ta
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta

sign:
sign: strip
@$(SIGN) --uuid $(UUID) --key $(TA_SIGN_KEY) --in $(OUT_DIR)/stripped_ta --out $(OUT_DIR)/$(UUID).ta
@echo "SIGN => ${UUID}"

Expand Down
2 changes: 1 addition & 1 deletion examples/supp_plugin-rs/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ all: host strip
host:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: host
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/$(NAME) $(OUT_DIR)/$(NAME)

clean:
Expand Down
4 changes: 2 additions & 2 deletions examples/supp_plugin-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ all: ta strip sign
ta:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: ta
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta

sign:
sign: strip
@$(SIGN) --uuid $(UUID) --key $(TA_SIGN_KEY) --in $(OUT_DIR)/stripped_ta --out $(OUT_DIR)/$(UUID).ta
@echo "SIGN => ${UUID}"

Expand Down
2 changes: 1 addition & 1 deletion examples/time-rs/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ all: host strip
host:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: host
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/$(NAME) $(OUT_DIR)/$(NAME)

clean:
Expand Down
4 changes: 2 additions & 2 deletions examples/time-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ all: ta strip sign
ta:
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip:
strip: ta
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/ta $(OUT_DIR)/stripped_ta

sign:
sign: strip
@$(SIGN) --uuid $(UUID) --key $(TA_SIGN_KEY) --in $(OUT_DIR)/stripped_ta --out $(OUT_DIR)/$(UUID).ta
@echo "SIGN => ${UUID}"

Expand Down

0 comments on commit ec3eefd

Please sign in to comment.