mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
11
Makefile
11
Makefile
@ -1,6 +1,7 @@
|
||||
PACKER_VERSION := 1.9.4
|
||||
PWN_HOSTNAME := pwnagotchi
|
||||
PWN_VERSION := $(shell cut -d"'" -f2 < pwnagotchi/_version.py)
|
||||
PWN_RELEASE := pwnagotchi-raspios-lite-$(PWN_VERSION)
|
||||
|
||||
MACHINE_TYPE := $(shell uname -m)
|
||||
ifneq (,$(filter x86_64,$(MACHINE_TYPE)))
|
||||
@ -33,7 +34,6 @@ langs:
|
||||
./scripts/language.sh compile $$(basename $$lang); \
|
||||
done
|
||||
|
||||
image:
|
||||
PACKER := /tmp/pwnagotchi/packer
|
||||
PACKER_URL := https://releases.hashicorp.com/packer/$(PACKER_VERSION)/packer_$(PACKER_VERSION)_linux_$(GOARCH).zip
|
||||
$(PACKER):
|
||||
@ -43,17 +43,16 @@ image:
|
||||
rm $(PACKER).zip
|
||||
chmod +x $@
|
||||
|
||||
SDIST := dist/pwnagotchi-$(PWN_VERSION).tar.gz
|
||||
$(SDIST): setup.py pwnagotchi
|
||||
python3 setup.py sdist
|
||||
|
||||
# Building the image requires packer, but don't rebuild the image just because packer updated.
|
||||
$(PWN_RELEASE).img: | $(PACKER)
|
||||
cd builder && packer init pwnagotchi.json.pkr.hcl && sudo $(UNSHARE) $(PACKER) build -var "pwn_hostname=$(PWN_HOSTNAME)" -var "pwn_version=$(PWN_VERSION)" pwnagotchi.json.pkr.hcl
|
||||
|
||||
.PHONY: image
|
||||
image: $(PWN_RELEASE).zip
|
||||
|
||||
clean:
|
||||
- python3 setup.py clean --all
|
||||
- rm -rf dist pwnagotchi.egg-info
|
||||
- rm -f $(PACKER)
|
||||
- rm -f $(PWN_RELEASE).*
|
||||
- sudo rm -rf builder/output-pwnagotchi builder/packer_cache
|
||||
|
||||
|
Reference in New Issue
Block a user