bin-caddy/Makefile
GregoryDosh 7f4da66830
All checks were successful
Build Caddy / Build Caddy (push) Successful in 4m9s
simpler license & build log
2024-12-10 13:27:01 -06:00

65 lines
No EOL
2.3 KiB
Makefile

# Custom build of Caddy with a Rate Limiter and WAF
# Source available at git.auengun.net/homelab/bin-caddy
# Copyright (C) 2024 GregoryDosh
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# SPDX-License-Identifier: AGPL-3.0-or-later
# SPDX-FileCopyrightText: 2024 GregoryDosh
# avoid noisy directory messages
MAKEFLAGS += --no-print-directory
.PHONY: build
build:
@go get
@go mod verify
@echo "Building Linux/amd64"
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o release/caddy-linux-amd64
sha256sum release/caddy-linux-amd64 | cut -f1 -d " " > release/caddy-linux-amd64.sha256
@echo "Building Linux/arm64"
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o release/caddy-linux-arm64
sha256sum release/caddy-linux-arm64 | cut -f1 -d " " > release/caddy-linux-arm64.sha256
.PHONY: vet
vet:
# REUSE-IgnoreStart
@echo "// SPDX-FileCopyrightText: NONE" | tee release/build.log
@echo "//" | tee -a release/build.log
@echo "// SPDX-License-Identifier: AGPL-3.0-or-later" | tee -a release/build.log
# REUSE-IgnoreEnd
@echo
@echo "Starting at `date`" | tee -a release/build.log
@echo
@echo # Syft Scan Format... | tee -a release/build.log
@syft scan -o json ./ >> release/syft.json | tee -a release/build.log
@echo
@echo # Grype Vulnerability Scanning... | tee -a release/build.log
@grype --fail-on high -o table sbom:release/syft.json | tee -a release/build.log
@echo
@echo # REUSE License Checking... | tee -a release/build.log
@reuse lint | tee -a release/build.log
.PHONY: clean
clean:
@rm -f ./release/caddy-linux-amd64
@rm -f ./release/caddy-linux-amd64.sha256
@rm -f ./release/caddy-linux-arm64
@rm -f ./release/caddy-linux-arm64.sha256
@rm -f ./release/*.log