forked from raspberrypi/usbboot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·35 lines (27 loc) · 1.08 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
PKG_VER=$(shell grep rpiboot debian/changelog | head -n1 | sed 's/.*(\(.*\)).*/\1/g')
GIT_VER=$(shell git rev-parse HEAD 2>/dev/null | cut -c1-8 || echo "")
rpiboot: main.c bootfiles.c msd/bootcode.h msd/start.h msd/bootcode4.h msd/start4.h
$(CC) -Wall -Wextra -g -o $@ main.c bootfiles.c `pkg-config --cflags --libs libusb-1.0` -DGIT_VER="\"$(GIT_VER)\"" -DPKG_VER="\"$(PKG_VER)\""
%.h: %.bin ./bin2c
./bin2c $< $@
%.h: %.elf ./bin2c
./bin2c $< $@
bin2c: bin2c.c
$(CC) -Wall -Wextra -g -o $@ $<
install: rpiboot
install -m 755 rpiboot /usr/bin/
install -d /usr/share/rpiboot
install -m 644 msd/bootcode.bin /usr/share/rpiboot/
install -m 644 msd/bootcode4.bin /usr/share/rpiboot/
install -m 644 msd/start.elf /usr/share/rpiboot/
install -m 644 msd/start4.elf /usr/share/rpiboot/
uninstall:
rm -f /usr/bin/rpiboot
rm -f /usr/share/rpiboot/bootcode.bin
rm -f /usr/share/rpiboot/bootcode4.bin
rm -f /usr/share/rpiboot/start.elf
rm -f /usr/share/rpiboot/start4.elf
rmdir --ignore-fail-on-non-empty /usr/share/rpiboot/
clean:
rm -f rpiboot msd/*.h bin2c
.PHONY: uninstall clean