mirror of
https://github.com/RoganDawes/P4wnP1_aloa.git
synced 2025-03-29 19:11:45 +01:00
Partially fixed makefile
This commit is contained in:
parent
471b3b853e
commit
c85834c3b6
69
Makefile
69
Makefile
@ -1,41 +1,52 @@
|
||||
all: build
|
||||
SHELL := /bin/bash
|
||||
PATH := /usr/local/go/bin:$(PATH)
|
||||
|
||||
all: compile
|
||||
|
||||
test:
|
||||
# export PATH="$$PATH:/usr/local/go/bin" # put into ~/.profile
|
||||
echo $(CURDIR)
|
||||
|
||||
# make dep runs without sudo
|
||||
dep:
|
||||
sudo apt-get -y install git screen hostapd autossh bluez bluez-tools bridge-utils policykit-1 genisoimage iodine haveged
|
||||
sudo apt-get -y install tcpdump
|
||||
sudo apt-get -y install python-pip python-dev
|
||||
sudo apt-get -y install git screen hostapd autossh bluez bluez-tools bridge-utils policykit-1 genisoimage iodine haveged
|
||||
sudo apt-get -y install tcpdump
|
||||
sudo apt-get -y install python-pip python-dev
|
||||
|
||||
# before installing dnsmasq, the nameserver from /etc/resolv.conf should be saved
|
||||
# to restore after install (gets overwritten by dnsmasq package)
|
||||
cp /etc/resolv.conf /tmp/backup_resolv.conf
|
||||
sudo apt-get -y install dnsmasq
|
||||
sudo /bin/bash -c 'cat /tmp/backup_resolv.conf > /etc/resolv.conf'
|
||||
# before installing dnsmasq, the nameserver from /etc/resolv.conf should be saved
|
||||
# to restore after install (gets overwritten by dnsmasq package)
|
||||
cp /etc/resolv.conf /tmp/backup_resolv.conf
|
||||
sudo apt-get -y install dnsmasq
|
||||
sudo /bin/bash -c 'cat /tmp/backup_resolv.conf > /etc/resolv.conf'
|
||||
|
||||
# python dependencies for HIDbackdoor
|
||||
sudo pip install pycrypto # already present on stretch
|
||||
sudo pip install pydispatcher
|
||||
# python dependencies for HIDbackdoor
|
||||
sudo pip install pycrypto # already present on stretch
|
||||
sudo pip install pydispatcher
|
||||
|
||||
# install go
|
||||
wget https://storage.googleapis.com/golang/go1.9.linux-armv6l.tar.gz
|
||||
sudo tar -C /usr/local -xzf go1.9.linux-armv6l.tar.gz
|
||||
export PATH=$PATH:/usr/local/go/bin # put into ~/.profile
|
||||
echo export PATH=$PATH:/usr/local/go/bin >> ~/.profile
|
||||
sudo bash -c 'echo export PATH=\$PATH:/usr/local/go/bin >> ~/.profile'
|
||||
# install go
|
||||
wget https://storage.googleapis.com/golang/go1.10.linux-armv6l.tar.gz
|
||||
sudo tar -C /usr/local -xzf go1.10.linux-armv6l.tar.gz
|
||||
|
||||
# install gopherjs
|
||||
go get -u github.com/gopherjs/gopherjs
|
||||
export PATH="$$PATH:/usr/local/go/bin"
|
||||
|
||||
# we don't need protoc + protoc-grpc-web, because the proto file is shipped pre-compiled
|
||||
# put into ~/.profile
|
||||
# ToDo: check if already present
|
||||
echo "export PATH=\$$PATH:/usr/local/go/bin" >> ~/.profile
|
||||
sudo bash -c 'echo export PATH=\$$PATH:/usr/local/go/bin >> ~/.profile'
|
||||
|
||||
# go dependencies for webapp (without my own)
|
||||
#go get google.golang.org/grpc
|
||||
#go get -u github.com/improbable-eng/grpc-web/go/grpcweb
|
||||
#go get -u github.com/gorilla/websocket
|
||||
# install gopherjs
|
||||
go get -u github.com/gopherjs/gopherjs
|
||||
|
||||
build:
|
||||
go get -u github.com/mame82/P4wnP1_go # partially downloads again, but we need the library packages in go path to build
|
||||
env GOBIN=$(pwd)/build go install ./... # compile all main packages to the build folder
|
||||
# we don't need protoc + protoc-grpc-web, because the proto file is shipped pre-compiled
|
||||
|
||||
# go dependencies for webapp (without my own)
|
||||
#go get google.golang.org/grpc
|
||||
#go get -u github.com/improbable-eng/grpc-web/go/grpcweb
|
||||
#go get -u github.com/gorilla/websocket
|
||||
|
||||
compile:
|
||||
go get -u github.com/mame82/P4wnP1_go/... # partially downloads again, but we need the library packages in go path to build
|
||||
env GOBIN=$(CURDIR)/build go install ./... # compile all main packages to the build folder
|
||||
|
||||
# compile the web app
|
||||
# ToDo: (check if dependencies have been fetched by 'go get', even with the build js tags)
|
||||
@ -56,7 +67,7 @@ install:
|
||||
|
||||
# careful testing
|
||||
#sudo update-rc.d dhcpcd disable
|
||||
#sudo update-rc.d dnsmasq disable
|
||||
#sudo update-rc.d dnsmasq disable
|
||||
|
||||
# reinit service daemon
|
||||
systemctl daemon-reload
|
||||
|
Loading…
x
Reference in New Issue
Block a user