Change in osmo-ccid-firmware[master]: sysmoOCTSIM: Proper Makefile targets

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Nov 13 16:34:10 UTC 2019


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/16056 )

Change subject: sysmoOCTSIM: Proper Makefile targets
......................................................................

sysmoOCTSIM: Proper Makefile targets

It's really bad practsie to generate different output files from one
target, which breaks dependency generation and the like.  Let's have
separate Makefile targets for each output file we generate, all
depending on the .elf file.

Change-Id: Ie83722a9b61cfcd9865950ab4c088f59a15427ba
---
M sysmoOCTSIM/gcc/Makefile
1 file changed, 18 insertions(+), 7 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/sysmoOCTSIM/gcc/Makefile b/sysmoOCTSIM/gcc/Makefile
index c587fdd..595fd62 100644
--- a/sysmoOCTSIM/gcc/Makefile
+++ b/sysmoOCTSIM/gcc/Makefile
@@ -153,7 +153,13 @@
 vpath %.S ../
 
 # All Target
-all: $(SUB_DIRS) $(OUTPUT_FILE_PATH) sysmoOCTSIM.elf sysmoOCTSIM.bin
+all: $(SUB_DIRS) elf bin ihex eep lss
+
+elf: $(OUTPUT_FILE_NAME).elf sysmoOCTSIM.elf
+bin: $(OUTPUT_FILE_NAME).bin sysmoOCTSIM.bin
+ihex: $(OUTPUT_FILE_NAME).ihex
+eep: $(OUTPUT_FILE_NAME).eep
+lss: $(OUTPUT_FILE_NAME).lss
 
 # Linker target
 
@@ -167,13 +173,18 @@
 -L"../gcc/gcc"
 	@echo Finished building target: $@
 
-	$(OBJCOPY) -O binary "$(OUTPUT_FILE_NAME).elf" "$(OUTPUT_FILE_NAME).bin"
-	$(OBJCOPY) -O ihex -R .eeprom -R .fuse -R .lock -R .signature  \
-		"$(OUTPUT_FILE_NAME).elf" "$(OUTPUT_FILE_NAME).hex"
+%.bin: %.elf
+	$(OBJCOPY) -O binary $< $@
+
+%.ihex: %.elf
+	$(OBJCOPY) -O ihex -R .eeprom -R .fuse -R .lock -R .signature $< $@
+
+%.eep: %.elf
 	$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma \
-		.eeprom=0 --no-change-warnings -O binary "$(OUTPUT_FILE_NAME).elf" \
-		"$(OUTPUT_FILE_NAME).eep" || exit 0
-	$(OBJDUMP) -h -S "$(OUTPUT_FILE_NAME).elf" > "$(OUTPUT_FILE_NAME).lss"
+		.eeprom=0 --no-change-warnings -O binary $< $@ || exit 0
+
+%.lss: %.elf
+	$(OBJDUMP) -h -S $< > $@
 	$(SIZE) "$(OUTPUT_FILE_NAME).elf"
 
 sysmoOCTSIM.elf: $(OUTPUT_FILE_PATH)

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/16056
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-Change-Id: Ie83722a9b61cfcd9865950ab4c088f59a15427ba
Gerrit-Change-Number: 16056
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Hoernchen <ewild at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191113/64ef41b5/attachment.htm>


More information about the gerrit-log mailing list