shuffle makefile & add empty go.mod

go 1.16 requires go.mod in git folders now apparently
This commit is contained in:
Pierre Dubouilh 2021-04-17 15:42:15 +02:00 committed by Pierre Dubouilh
parent 8a7a542b22
commit e2aa4f149e
3 changed files with 24 additions and 13 deletions

3
.gitignore vendored
View file

@ -5,6 +5,7 @@ gossa-linux-arm64
gossa-mac gossa-mac
gossa-windows.exe gossa-windows.exe
gossa_test.go gossa_test.go
build-all
.vscode .vscode
test-fixture/* test-fixture/*
@ -39,4 +40,4 @@ test-fixture/*/*
!test-fixture/fancy-path !test-fixture/fancy-path
!test-fixture/fancy-path/* !test-fixture/fancy-path/*
!test-fixture/ext/* !test-fixture/ext/*
!test-fixture/ext !test-fixture/ext

View file

@ -1,8 +1,11 @@
FLAGS := -ldflags "-s -w"
NOCGO := CGO_ENABLED=0
build: build:
cp src/gossa.go gossa.go cp src/gossa.go gossa.go
make -C gossa-ui/ make -C gossa-ui/
go vet && go fmt go vet && go fmt
CGO_ENABLED=0 go build -ldflags "-s -w" -o gossa ${NOCGO} go build ${FLAGS} -o gossa
rm gossa.go rm gossa.go
install: install:
@ -19,18 +22,22 @@ run-extra:
test: test:
make build make build
-rm gossa_test.go rm -rf gossa_test.go
-@cd test-fixture && ln -s ../support . -@cd test-fixture && ln -s ../support .; true
cp src/gossa_test.go . cp src/gossa_test.go .
-@killall gossa
make run & -@killall gossa; true
-make run &
go test -run TestNormal go test -run TestNormal
killall gossa killall gossa
make run-extra & -make run-extra &
go test -run TestExtra go test -run TestExtra
killall gossa killall gossa
make run-ro & -make run-ro &
go test -run TestRo go test -run TestRo
killall gossa killall gossa
watch: watch:
@ -48,11 +55,11 @@ watch-test:
build-all: build-all:
cp src/gossa.go gossa.go cp src/gossa.go gossa.go
make -C gossa-ui/ make -C gossa-ui/
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o gossa-linux64 ${NOCGO} GOOS=linux GOARCH=amd64 go build ${FLAGS} -o build-all/gossa-linux64
env CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -ldflags "-s -w" -o gossa-linux-arm ${NOCGO} GOOS=linux GOARCH=arm go build ${FLAGS} -o build-all/gossa-linux-arm
env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w" -o gossa-linux-arm64 ${NOCGO} GOOS=linux GOARCH=arm64 go build ${FLAGS} -o build-all/gossa-linux-arm64
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -o gossa-mac ${NOCGO} GOOS=darwin GOARCH=amd64 go build ${FLAGS} -o build-all/gossa-mac
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o gossa-windows.exe ${NOCGO} GOOS=windows GOARCH=amd64 go build ${FLAGS} -o build-all/gossa-windows.exe
rm gossa.go rm gossa.go
clean: clean:

3
go.mod Normal file
View file

@ -0,0 +1,3 @@
module github.com/pldubouilh/gossa
go 1.16