From 4c9be2589473ac7ab7f242a39c3967a03ebef118 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Tue, 22 Oct 2024 13:28:00 +0200 Subject: [PATCH] replace pull-firmware.sh with a Makefile; move targets into dist/ --- .gitignore | 9 ++++--- Makefile | 20 ++++++++------- dist/firmware/Makefile | 21 ++++++++++++++++ hp49g+.png => dist/hp49g+.png | Bin .../hp49g+small-notext.png | Bin hp50g.png => dist/hp50g.png | Bin x49gp.desktop.in => dist/x49gp.desktop.in | 0 x49gp.man.in => dist/x49gp.man.in | 0 firmware/Placeholder | 1 - pull-firmware.sh | 23 ------------------ 10 files changed, 38 insertions(+), 36 deletions(-) create mode 100644 dist/firmware/Makefile rename hp49g+.png => dist/hp49g+.png (100%) rename hp49g+small-notext.png => dist/hp49g+small-notext.png (100%) rename hp50g.png => dist/hp50g.png (100%) rename x49gp.desktop.in => dist/x49gp.desktop.in (100%) rename x49gp.man.in => dist/x49gp.man.in (100%) delete mode 100644 firmware/Placeholder delete mode 100755 pull-firmware.sh diff --git a/.gitignore b/.gitignore index 1eb1132..63bb23d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,11 +3,14 @@ .depend *.o *.d -/sdcard -/x49gp /src/qemu-git/arm-softmmu /src/qemu-git/libhw32 /src/qemu-git/libhw64 /src/qemu-git/config-host.* /src/qemu-git/config-all-devices.mak -/firmware/*.bin +/dist/x49gp +/dist/sdcard +/dist/firmware/*.zip +/dist/firmware/hp-arm-models-bootloader/ +/dist/firmware/hp4950v215/ +/dist/firmware/newrpl/ diff --git a/Makefile b/Makefile index c37218c..8fc2300 100644 --- a/Makefile +++ b/Makefile @@ -37,8 +37,8 @@ X49GP_DEBUG = \ DEBUG = -g # -pg -IMAGE49GP = hp49g+.png -IMAGE50G = hp50g.png +IMAGE49GP = dist/hp49g+.png +IMAGE50G = dist/hp50g.png QEMU_DEFINES = -DTARGET_ARM -DX49GP \ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \ @@ -131,7 +131,7 @@ VVFATOBJS = $(SRC_DIR)/block-vvfat.o \ VVFATOBJS += $(QEMU_DIR)/cutils.o -TARGET = x49gp +TARGET = dist/x49gp TARGET_ALLCAPS = X49GP all: do-it-all @@ -150,20 +150,20 @@ install: all $(TARGET).desktop $(TARGET).man install -D -m 755 $(TARGET) "$(DESTDIR)$(INSTALL_BINARY_DIR)/$(TARGET)" install -D -m 644 $(IMAGE49GP) "$(DESTDIR)$(INSTALL_DATA_DIR)/$(IMAGE49GP)" install -D -m 644 $(IMAGE50G) "$(DESTDIR)$(INSTALL_DATA_DIR)/$(IMAGE50G)" - install -D -m 755 pull-firmware.sh "$(DESTDIR)$(INSTALL_DATA_DIR)/pull-firmware.sh" + install -D -m 755 dist/firmware "$(DESTDIR)$(INSTALL_DATA_DIR)/firmware" install -D -m 644 $(TARGET).desktop "$(DESTDIR)$(INSTALL_MENU_DIR)/$(TARGET).desktop" install -D -m 644 $(TARGET).man "$(DESTDIR)$(INSTALL_MAN_DIR)/$(TARGET).1" -$(TARGET).desktop: x49gp.desktop.in +$(TARGET).desktop: $(TARGET).desktop.in perl -p -e "s!TARGET!$(TARGET)!" $@ -$(TARGET).man: x49gp.man.in +$(TARGET).man: $(TARGET).man.in perl -p -e "s!TARGET_ALLCAPS!$(TARGET_ALLCAPS)!;" -e "s!TARGET!$(TARGET)!" $@ -sdcard: +dist/sdcard: ifeq ($(shell uname),Darwin) rm -f sdcard.dmg - hdiutil create sdcard -megabytes 64 -fs MS-DOS -volname x49gp + hdiutil create $@ -megabytes 64 -fs MS-DOS -volname x49gp else /sbin/mkdosfs -v -C -S 512 -f 2 -F 16 -r 512 -R 2 -n "x49gp" $@ 65536 endif @@ -206,11 +206,13 @@ depend: depend-libs $(MAKEDEPEND) $(CFLAGS) $(X49GP_CFLAGS) $(SRCS) >.depend mrproper: clean-qemu distclean + make -C dist/firmware/ mrproper + pretty-code: clang-format -i $(SRC_DIR)/*.c $(SRC_DIR)/*.h pull-firmware: - ./pull-firmware.sh + make -C dist/firmware/ dummy: diff --git a/dist/firmware/Makefile b/dist/firmware/Makefile new file mode 100644 index 0000000..f239e08 --- /dev/null +++ b/dist/firmware/Makefile @@ -0,0 +1,21 @@ +.PHONY: get-roms mrproper + +all: bootloaders official newrpl + +mrproper: + rm -f ./hp-arm-models-bootloader ./hp4950v215 ./newrpl + +bootloaders: + wget https://www.hpcalc.org/hp49/pc/rom/hp-arm-models-bootloader.zip + unzip -j hp-arm-models-bootloader.zip -d hp-arm-models-bootloader + rm hp-arm-models-bootloader.zip + +official: + wget https://www.hpcalc.org/hp49/pc/rom/hp4950v215.zip + unzip -j hp4950v215.zip -d hp4950v215 + rm hp4950v215.zip + +newrpl: + mkdir -p newrpl + wget https://hpgcc3.org/downloads/newrplfw.bin -O newrpl/newrplfw.bin + echo "newrplfw.bin" > newrpl/update.scp diff --git a/hp49g+.png b/dist/hp49g+.png similarity index 100% rename from hp49g+.png rename to dist/hp49g+.png diff --git a/hp49g+small-notext.png b/dist/hp49g+small-notext.png similarity index 100% rename from hp49g+small-notext.png rename to dist/hp49g+small-notext.png diff --git a/hp50g.png b/dist/hp50g.png similarity index 100% rename from hp50g.png rename to dist/hp50g.png diff --git a/x49gp.desktop.in b/dist/x49gp.desktop.in similarity index 100% rename from x49gp.desktop.in rename to dist/x49gp.desktop.in diff --git a/x49gp.man.in b/dist/x49gp.man.in similarity index 100% rename from x49gp.man.in rename to dist/x49gp.man.in diff --git a/firmware/Placeholder b/firmware/Placeholder deleted file mode 100644 index 73160aa..0000000 --- a/firmware/Placeholder +++ /dev/null @@ -1 +0,0 @@ -This folder will hold ROM binary files. diff --git a/pull-firmware.sh b/pull-firmware.sh deleted file mode 100755 index 43974b8..0000000 --- a/pull-firmware.sh +++ /dev/null @@ -1,23 +0,0 @@ -CWD=$(pwd) -TEMPDIR=${TEMPDIR:-$CWD/tmpdir} -FWDIR=${FWDIR:-$CWD/firmware} - -mkdir -p "$FWDIR" -mkdir -p "$TEMPDIR" -cd "$TEMPDIR" || exit 1 - -echo "Retrieving Bootloader from hpcalc.org for HP 49g+ and HP 50g..." -wget https://www.hpcalc.org/hp49/pc/rom/hp-arm-models-bootloader.zip -unzip -j hp-arm-models-bootloader.zip -d "$TEMPDIR" -mv ./*.bin "$FWDIR"/ - -echo "Retrieving ROM 2.15 from hpcalc.org for HP 49g+ and HP 50g..." -wget https://www.hpcalc.org/hp49/pc/rom/hp4950v215.zip -unzip -j hp4950v215.zip -d "$TEMPDIR" -mv ./*.bin "$FWDIR"/ - -echo "Retrieving latest Unofficial newRPL build..." -wget https://hpgcc3.org/downloads/newrplfw.bin -O "$FWDIR"/newrplfw.bin - -cd "$CWD" || exit 1 -rm -rf "$TEMPDIR"