Skip to contentSkip to conversation

Makefile.target: set icon for binary file on Mac OS X

PATCH In review Programmingkid 3 participants 3 messages Feb 21, 2015 – May 11, 2015 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 Makefile.target: set icon for binary file on Mac OS X

Implements setting the icon for the binary file in Mac OS X.

---
Added $(SRC_PATH) to the path of the rsrc file.

 Makefile.target   |    4 +
 pc-bios/qemu.rsrc | 1504 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 1508 insertions(+), 0 deletions(-)
 create mode 100644 pc-bios/qemu.rsrc
Makefile.target +4 -0
index e9ff1ee..9661c87 100644
@@ -178,6 +178,10 @@ all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y)
 # build either PROG or PROGW
 $(QEMU_PROG_BUILD): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
 	$(call LINK,$^)
+ifdef CONFIG_DARWIN
+	Rez -append $(SRC_PATH)/pc-bios/qemu.rsrc -o $(QEMU_PROG)
+	SetFile -a C $(QEMU_PROG)
+endif
 
 gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
 	$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
pc-bios/qemu.rsrc new file +1504 -0

1,504 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 17 lines · Programmingkid

Implements setting the icon for the binary file in Mac OS X.

---
Added $(SRC_PATH) to the path of the rsrc file.

 Makefile.target   |    4 +
 pc-bios/qemu.rsrc | 1504 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 1508 insertions(+), 0 deletions(-)
 create mode 100644 pc-bios/qemu.rsrc
Makefile.target +0 -0
index e9ff1ee..9661c87 100644

Makefile.target all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y) · line 184

Quoted 7 lines
Makefile.target +4 -0
@@ -178,6 +178,10 @@ all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y)
 # build either PROG or PROGW
 $(QEMU_PROG_BUILD): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
        $(call LINK,$^)
+ifdef CONFIG_DARWIN
+       Rez -append $(SRC_PATH)/pc-bios/qemu.rsrc -o $(QEMU_PROG)
+       SetFile -a C $(QEMU_PROG)
+endif

When I came to look at this patch this hunk didn't quite apply cleanly any more. It also is missing the quiet-command use that makes the output look nice, and it would be cleaner to use $@ rather than $(QEMU_PROG). The tweaked Makefile.target hunk I came up with is:

===begin===

Makefile.target +4 -1
index 1083377..be01dd3 100644
@@ -180,6 +180,10 @@ $(QEMU_PROG_BUILD): config-devices.mak
 # build either PROG or PROGW
 $(QEMU_PROG_BUILD): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
        $(call LINK, $(filter-out %.mak, $^))
+ifdef CONFIG_DARWIN
+       $(call quiet-command,Rez -append $(SRC_PATH)/pc-bios/qemu.rsrc
-o $@,"  REZ   $(TARGET_DIR)$@")
+       $(call quiet-command,SetFile -a C $@,"  SETFILE $(TARGET_DIR)$@")
+endif
 
 gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
        $(call quiet-command,rm -f $@ && $(SHELL)

$(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES
)," GEN $(TARGET_DIR)$@")
===endit===

Unless anybody objects or Paolo particularly wants to take this through his tree I'll add this modified version to my cocoa tree.

thanks
-- PMM

#2 lore raw
Quoted 2 lines · Peter Maydell

Unless anybody objects or Paolo particularly wants to take this through his tree I'll add this modified version to my cocoa tree.

I almost never want to take something through my tree. :)

Paolo