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
Tue Nov 12 21:20:08 UTC 2019


laforge has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/56/16056/1

diff --git a/sysmoOCTSIM/gcc/Makefile b/sysmoOCTSIM/gcc/Makefile
index d98277a..4a03a3a 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.elf
+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: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191112/2005827f/attachment.htm>


More information about the gerrit-log mailing list