Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,21 @@ bin2c: bin2c.c
endif

install: rpiboot
install -m 755 rpiboot $(INSTALL_PREFIX)/bin/
install -d $(INSTALL_PREFIX)/share/rpiboot
install -d $(INSTALL_PREFIX)/share/rpiboot/msd
install -d $(INSTALL_PREFIX)/share/rpiboot/mass-storage-gadget64
install -m 644 msd/bootcode.bin $(INSTALL_PREFIX)/share/rpiboot/msd
install -m 644 msd/bootcode4.bin $(INSTALL_PREFIX)/share/rpiboot/msd
install -m 644 msd/start.elf $(INSTALL_PREFIX)/share/rpiboot/msd
install -m 644 mass-storage-gadget64/boot.img $(INSTALL_PREFIX)/share/rpiboot/mass-storage-gadget64
install -m 644 mass-storage-gadget64/config.txt $(INSTALL_PREFIX)/share/rpiboot/mass-storage-gadget64
install -m 644 mass-storage-gadget64/bootfiles.bin $(INSTALL_PREFIX)/share/rpiboot/mass-storage-gadget64
install -d $(DESTDIR)$(INSTALL_PREFIX)/bin
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having both DESTDIR and INSTALL_PREFIX looks a bit weird. Would it be clearer to initialize INSTALL_PREFIX if INSTALL_PREFIX is not defined and DESTDIR is defined?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's common practice to have both PREFIX and DESTDIR. PREFIX is used at compile time for the software to know its final destination, and DESTDIR is used at install time for staging before packaging.
It's possible to use a different PREFIX when compiling and installing (or here, INSTALL_PREFIX) but it can be really awkward to handle in packaging frameworks, and even create bugs when packaging: some software re-generates artefacts when installing, and the resulting bugs only surface in specific compilation contexts, making them hard to track (aka heisenbugs).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, seems safe so merging

install -m 755 rpiboot $(DESTDIR)$(INSTALL_PREFIX)/bin/
install -d $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot
install -d $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot/msd
install -d $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot/mass-storage-gadget64
install -m 644 msd/bootcode.bin $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot/msd
install -m 644 msd/bootcode4.bin $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot/msd
install -m 644 msd/start.elf $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot/msd
install -m 644 mass-storage-gadget64/boot.img $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot/mass-storage-gadget64
install -m 644 mass-storage-gadget64/config.txt $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot/mass-storage-gadget64
install -m 644 mass-storage-gadget64/bootfiles.bin $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot/mass-storage-gadget64

uninstall:
rm -f $(INSTALL_PREFIX)/bin/rpiboot
rm -rf $(INSTALL_PREFIX)/share/rpiboot
rm -f $(DESTDIR)$(INSTALL_PREFIX)/bin/rpiboot
rm -rf $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot

clean:
rm -f rpiboot msd/*.h bin2c
Expand Down
Loading