Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff73b65

Browse files
authored
Merge pull request #114 from obsti8383/master
Optimize Makefile + Generate CycloneDX BOM
2 parents c426cf4 + b016e10 commit ff73b65

File tree

7 files changed

+649
-37
lines changed

7 files changed

+649
-37
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
.vscode/
12
build/
23
rsrc.syso

Makefile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
.DEFAULT_GOAL := build
2-
BUILD_FOLDER = $(shell pwd)/build
3-
FLAGS_WINDOWS = GOOS=windows GOARCH=386 CC=i686-w64-mingw32-gcc CGO_ENABLED=1
4-
MINGW32GCC := $(shell command -v i686-w64-mingw32-gcc 2> /dev/null)
2+
BUILD_FOLDER = $(shell pwd)/build
3+
FLAGS_WINDOWS = GOOS=windows GOARCH=386 CC=i686-w64-mingw32-gcc CGO_ENABLED=1
4+
MINGW32GCC = $(shell command -v i686-w64-mingw32-gcc 2> /dev/null)
5+
GOFLAGS_WINUI = -trimpath -buildvcs=false --ldflags '-s -w -extldflags "-static" -H windowsgui'
6+
GOFLAGS_CLI = -trimpath -buildvcs=false -tags=cli --ldflags '-s -w -extldflags "-static"'
57

68
clean:
79
rm -rf $(BUILD_FOLDER)
810

911
pre: clean
1012
@mkdir -p $(BUILD_FOLDER)
11-
env go get -d ./
12-
env go mod download
13-
go install github.com/akavel/rsrc
13+
cat tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI % go install %
14+
go mod download
1415

1516
build: pre lint vet
1617
ifndef MINGW32GCC
@@ -20,9 +21,11 @@ endif
2021
@echo "[builder] Building Windows executable"
2122
@mkdir -p $(BUILD_FOLDER)/
2223
$(GOPATH)/bin/rsrc -arch 386 -manifest harden.manifest -ico harden.ico -o rsrc.syso
23-
$(FLAGS_WINDOWS) go build --ldflags '-s -w -extldflags "-static" -H windowsgui' -o $(BUILD_FOLDER)/hardentools.exe
24+
$(FLAGS_WINDOWS) go build $(GOFLAGS_WINUI) -o $(BUILD_FOLDER)/hardentools.exe
25+
$(FLAGS_WINDOWS) cyclonedx-gomod app -output hardentools.bom.xml -licenses
2426
@echo "[builder] Building Windows commandline executable"
25-
$(FLAGS_WINDOWS) go build -tags cli --ldflags '-s -w -extldflags "-static"' -o $(BUILD_FOLDER)/hardentools-cli.exe
27+
$(FLAGS_WINDOWS) go build $(GOFLAGS_CLI) -o $(BUILD_FOLDER)/hardentools-cli.exe
28+
$(FLAGS_WINDOWS) GOFLAGS=-tags=cli cyclonedx-gomod app -output hardentools-cli.bom.xml -licenses
2629
@echo "[builder] Done!"
2730

2831

go.mod

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,63 @@
11
module github.com/securitywithoutborders/hardentools
22

3-
go 1.16
3+
go 1.18
44

55
require (
66
fyne.io/fyne/v2 v2.0.1
7-
github.com/akavel/rsrc v0.10.2 // indirect
8-
golang.org/x/sys v0.0.0-20210313110737-8e9fff1a3a18
7+
github.com/CycloneDX/cyclonedx-gomod v1.2.0
8+
github.com/akavel/rsrc v0.10.2
9+
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e
10+
)
11+
12+
require (
13+
github.com/CycloneDX/cyclonedx-go v0.5.0 // indirect
14+
github.com/Microsoft/go-winio v0.4.16 // indirect
15+
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
16+
github.com/acomagu/bufpipe v1.0.3 // indirect
17+
github.com/davecgh/go-spew v1.1.1 // indirect
18+
github.com/dgryski/go-minhash v0.0.0-20170608043002-7fe510aff544 // indirect
19+
github.com/ekzhu/minhash-lsh v0.0.0-20171225071031-5c06ee8586a1 // indirect
20+
github.com/emirpasic/gods v1.12.0 // indirect
21+
github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3 // indirect
22+
github.com/fsnotify/fsnotify v1.4.9 // indirect
23+
github.com/fyne-io/mobile v0.1.2 // indirect
24+
github.com/go-enry/go-license-detector/v4 v4.3.0 // indirect
25+
github.com/go-git/gcfg v1.5.0 // indirect
26+
github.com/go-git/go-billy/v5 v5.3.1 // indirect
27+
github.com/go-git/go-git/v5 v5.4.2 // indirect
28+
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 // indirect
29+
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200625191551-73d3c3675aa3 // indirect
30+
github.com/godbus/dbus/v5 v5.0.4 // indirect
31+
github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff // indirect
32+
github.com/google/uuid v1.3.0 // indirect
33+
github.com/hhatto/gorst v0.0.0-20181029133204-ca9f730cac5b // indirect
34+
github.com/imdario/mergo v0.3.12 // indirect
35+
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
36+
github.com/jdkato/prose v1.1.0 // indirect
37+
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
38+
github.com/mitchellh/go-homedir v1.1.0 // indirect
39+
github.com/montanaflynn/stats v0.0.0-20151014174947-eeaced052adb // indirect
40+
github.com/peterbourgon/ff/v3 v3.1.0 // indirect
41+
github.com/pkg/errors v0.9.1 // indirect
42+
github.com/pmezard/go-difflib v1.0.0 // indirect
43+
github.com/rs/zerolog v1.26.1 // indirect
44+
github.com/russross/blackfriday/v2 v2.0.1 // indirect
45+
github.com/sergi/go-diff v1.1.0 // indirect
46+
github.com/shogo82148/go-shuffle v0.0.0-20170808115208-59829097ff3b // indirect
47+
github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95 // indirect
48+
github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564 // indirect
49+
github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9 // indirect
50+
github.com/stretchr/testify v1.7.0 // indirect
51+
github.com/xanzy/ssh-agent v0.3.0 // indirect
52+
golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce // indirect
53+
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2 // indirect
54+
golang.org/x/image v0.0.0-20200430140353-33d19683fad8 // indirect
55+
golang.org/x/mod v0.5.1 // indirect
56+
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
57+
golang.org/x/text v0.3.7 // indirect
58+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
59+
gonum.org/v1/gonum v0.7.0 // indirect
60+
gopkg.in/neurosnap/sentences.v1 v1.0.6 // indirect
61+
gopkg.in/warnings.v0 v0.1.2 // indirect
62+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
963
)

0 commit comments

Comments
 (0)