Selaa lähdekoodia

clean up installation

Tobias Simetsreiter 4 vuotta sitten
vanhempi
sitoutus
041f356277
2 muutettua tiedostoa jossa 20 lisäystä ja 19 poistoa
  1. 1 0
      .gitignore
  2. 19 19
      Makefile

+ 1 - 0
.gitignore

@@ -57,6 +57,7 @@ docs/_build/
 
 # PyBuilder
 target/
+build
 wavesharelib
 runtime
 config.mk

+ 19 - 19
Makefile

@@ -8,12 +8,16 @@ run:
 
 rerun: update run
 
-deploy: bcmlib wiringpi pythonlib
-	-ln -s sub/wavesharelib/RaspberryPi&JetsonNano/python/ wavesharelib
+deps: bcmlib pythonlib
+
+install:
+	rm -f wavesharelib
+	ln -s sub/wavesharelib/RaspberryPi\&JetsonNano/python/ wavesharelib
+	echo "${CRON_TIMER}" > /etc/cron.d/42-raspi_zero_waveshare
 
 update:
 	ssh ${RASPI_REMOTE} mkdir -p ${DEPLOY_DIR}
-	rsync -ai --delete ./ ${RASPI_REMOTE}:${DEPLOY_DIR}/
+	rsync -ai --delete --exclude build ./ ${RASPI_REMOTE}:${DEPLOY_DIR}/
 
 install_ssh: update remote/deploy
 
@@ -23,29 +27,25 @@ ssh/%:
 remote/%:
 	ssh ${RASPI_REMOTE} "cd ${DEPLOY_DIR};$(MAKE) ${*}"
 
-bcmlib:
-	wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.60.tar.gz
-	tar zxvf bcm2835-1.60.tar.gz
-	cd bcm2835-1.60/ && \
-	sudo ./configure && \
-	sudo make && \
+build/bcm2835-1.60:
+	mkdir -p build
+	curl -o build/bcm2835-1.60.tar.gz -L http://www.airspayce.com/mikem/bcm2835/bcm2835-1.60.tar.gz
+	tar xv -C build -f build/bcm2835-1.60.tar.gz
+	cd build/bcm2835-1.60/ && \
+	./configure
+	$(MAKE) -C build/bcm2835-1.60/
+	$(MAKE) -C build/bcm2835-1.60/
+
+bcmlib: build/bcm2835-1.60
+	cd build/bcm2835-1.60/ && \
 	sudo make check && \
 	sudo make install
 	#For more details, please refer to http://www.airspayce.com/mikem/bcm2835/
 
-wiringpi:
-	sudo apt-get install -y wiringpi
-	#For Pi 4, you need to update it:
-	wget https://project-downloads.drogon.net/wiringpi-latest.deb
-	sudo dpkg -i wiringpi-latest.deb
-	rm -rf wiringpi-latest.deb
-	gpio -v
-	#You will get 2.52 information if you install it correctly
-
 pythonlib:
 	#python3
 	sudo apt-get update
-	sudo apt-get install -y python3-pip python3-pil python3-numpy
+	sudo apt-get install -y python3-pip python3-pil python3-numpy wiringpi
 	sudo pip3 install RPi.GPIO spidev qrcode
 
 # demo-py/%: