Skip to contentSkip to conversation

selftests/x86/sgx: Do not generate object files

PATCH New Jarkko Sakkinen 1 participant 1 message Aug 16, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/x86/sgx: Do not generate object files

Invoke GCC in a way that it generates and links the binary in a single step because we do not need the side products. Additionally, add a missing dependency to encls.lds (i.e. make did not do anything if encls.lds was changed).

---
 tools/testing/selftests/x86/sgx/Makefile | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
tools/testing/selftests/x86/sgx/Makefile +2 -8
index fdd67478c52b..b96aff1a7fba 100644
@@ -29,14 +29,8 @@ $(OUTPUT)/encl_piggy.o: $(OUTPUT)/encl.bin $(OUTPUT)/encl.ss
 $(OUTPUT)/encl.bin: $(OUTPUT)/encl.elf $(OUTPUT)/sgxsign
 	$(OBJCOPY) -O binary $< $@
 
-$(OUTPUT)/encl.elf: $(OUTPUT)/encl.o $(OUTPUT)/encl_bootstrap.o
-	$(CC) $(ENCL_CFLAGS) -T encl.lds -o $@ $^
-
-$(OUTPUT)/encl.o: encl.c
-	$(CC) $(ENCL_CFLAGS) -c $< -o $@
-
-$(OUTPUT)/encl_bootstrap.o: encl_bootstrap.S
-	$(CC) $(ENCL_CFLAGS) -c $< -o $@
+$(OUTPUT)/encl.elf: encl.lds encl.c encl_bootstrap.S
+	$(CC) $(ENCL_CFLAGS) -T $^ -o $@
 
 $(OUTPUT)/encl.ss: $(OUTPUT)/encl.bin  $(OUTPUT)/sgxsign
 	$(OUTPUT)/sgxsign signing_key.pem $(OUTPUT)/encl.bin $(OUTPUT)/encl.ss
Signature · 1 line
2.20.1