Browse Source

Makefile and build scripts

master
jahway603 3 years ago
parent
commit
76ba27a799
  1. 24
      Makefile
  2. 31
      util/build.sh
  3. 34
      util/build_arm.sh

24
Makefile

@ -0,0 +1,24 @@
# Copyright (c) 2021 Jahway603 & The Hush Developers
# Released under the GPLv3
#
# HightLightD (Hush) Makefile
# author: jahway603
PROJECT_NAME := "highlightd"
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
#.PHONY: build
build:
# Build binary for the x86 64-bit PC arch (amd64)
./util/build.sh
build-arm:
# Build binary for ARM architecture (aarch64)
./util/build_arm.sh
clean:
@echo "Cleaning project $(PROJECT_NAME) files..."
rm -f $(PROJECT_NAME)
rm -rf /tmp/$(PROJECT_NAME)-*

31
util/build.sh

@ -0,0 +1,31 @@
#!/usr/bin/env bash
# Copyright 2021 Jahway603 & The Hush Developers
# Distributed under the GPLv3 software license, see the accompanying
# file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html
# Purpose: Script to build HighLightD on x86 64-bit arch
# Check if go is installed on system and exits if it is not
if ! [ -x "$(command -v go)" ]; then
echo 'Error: go is not installed. Install go and try again.' >&2
exit 1
fi
echo ""
echo "Welcome to the Hush magic folks... the highd life"
echo ""
echo ' |\_/| D\___/\'
echo ' (0_0) (0_o)'
echo ' ==(Y)== (V)'
echo '----------(u)---(u)----oOo--U--oOo---'
echo '__|_______|_______|_______|_______|__'
echo ""
# now to compiling...
echo ""
echo "You have go installed, so starting to compile Hush highlightd for you..."
go build -o highlightd main.go
echo ""
echo "Hush highlightd is now compiled for you. Enjoy and reach out if you need support."
echo "For options, run ./highlightd --help"
echo "For version info, run ./highlightd version"

34
util/build_arm.sh

@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Copyright 2021 Jahway603 & The Hush Developers
# Distributed under the GPLv3 software license, see the accompanying
# file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html
# Purpose: Script to build the ARM or aarch64 architecture,
# which is what the PinePhone boards are running
# Check if go is installed on system and exits if it is not
if ! [ -x "$(command -v go)" ]; then
echo 'Error: go is not installed. Install go and try again.' >&2
exit 1
fi
echo ""
echo "Welcome to the Hush magic folks... the highd life"
echo ""
echo ' |\_/| D\___/\'
echo ' (0_0) (0_o)'
echo ' ==(Y)== (V)'
echo '----------(u)---(u)----oOo--U--oOo---'
echo '__|_______|_______|_______|_______|__'
echo ""
# now to compiling...
echo ""
echo "You have go installed, so starting to compile Hush highlightd for you..."
env GOOS=linux GOARCH=arm64 go build -o highlightd_aarch64 main.go
mv highlightd_aarch64 highlightd
echo ""
echo "Hush highlightd is now compiled for your ARM farm or PineBook Pro. Enjoy and reach out if you need support."
echo "For options, run ./highlightd --help"
echo "For version info, run ./highlightd version"
Loading…
Cancel
Save