mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Add Makefile for building go components
* Makefile with the following targets
** build for (linux system)
** build_win (windows system)
** build_tag (build from the last tag)
** clean for (removing the binaries)
* Adjust README file
This commit is contained in:
parent
c57de75dac
commit
97ca513f9b
2 changed files with 45 additions and 4 deletions
39
Makefile
Normal file
39
Makefile
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
# Simple Make file to build csaf_distribution components
|
||||||
|
|
||||||
|
SHELL=/bin/bash
|
||||||
|
BUILD = go build
|
||||||
|
buildMsg = "Building binaries..."
|
||||||
|
|
||||||
|
.PHONY: build build_win build_tag clean
|
||||||
|
|
||||||
|
all:
|
||||||
|
@echo choose a target from: build build_win build_tag clean
|
||||||
|
|
||||||
|
# Build all the binaries and place them in the current directory level.
|
||||||
|
build:
|
||||||
|
@echo $(buildMsg)
|
||||||
|
@$(BUILD) -o ./ -v ./cmd/...
|
||||||
|
|
||||||
|
# Build the binaries for windows and place them in the current directory level.
|
||||||
|
build_win:
|
||||||
|
@echo $(buildMsg)
|
||||||
|
@env GOOS=windows $(BUILD) -o ./ -v ./cmd/...
|
||||||
|
|
||||||
|
# Build the binaries from the latest github tag.
|
||||||
|
TAG = $(shell git tag --sort=-version:refname | head -n 1)
|
||||||
|
build_tag:
|
||||||
|
ifeq ($(TAG),)
|
||||||
|
@echo "No Tag found"
|
||||||
|
else
|
||||||
|
@git checkout -q tags/${TAG};
|
||||||
|
@echo $(buildMsg)
|
||||||
|
@$(BUILD) -o ./ -v ./cmd/...;
|
||||||
|
@env GOOS=windows $(BUILD) -o ./ -v ./cmd/...
|
||||||
|
@git checkout -q main
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Remove binary files
|
||||||
|
clean:
|
||||||
|
@rm -f csaf_checker csaf_provider csaf_uploader csaf_checker.exe csaf_provider.exe csaf_uploader.exe
|
||||||
|
|
||||||
|
|
||||||
10
README.md
10
README.md
|
|
@ -10,10 +10,12 @@
|
||||||
- Clone the repository `git clone https://github.com/csaf-poc/csaf_distribution.git `
|
- Clone the repository `git clone https://github.com/csaf-poc/csaf_distribution.git `
|
||||||
|
|
||||||
- Build Go components
|
- Build Go components
|
||||||
``` bash
|
Makefile supplies the following builds:
|
||||||
cd csaf_distribution
|
- For Linux Systems :`make build`
|
||||||
go build -v ./cmd/...
|
- For Windows platform: `make build_win`
|
||||||
```
|
- Build from the last tag: `make build_tag`
|
||||||
|
|
||||||
|
These places the binares in the current directory.
|
||||||
|
|
||||||
- [Install](http://nginx.org/en/docs/install.html) **nginx**
|
- [Install](http://nginx.org/en/docs/install.html) **nginx**
|
||||||
- To configure nginx see [docs/provider-setup.md](docs/provider-setup.md)
|
- To configure nginx see [docs/provider-setup.md](docs/provider-setup.md)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue