Skip to content

Commit

Permalink
remove init config host
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed May 3, 2024
1 parent 279b54d commit 238021d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ jobs:
with:
packages: gcc rpm alien rsync pkg-config libudev-dev
- uses: actions/checkout@v3
- run: make init-config-host
- run: make rpm

19 changes: 11 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ ifneq ($(OS),Windows_NT)
ifeq ($(UNAME_S),Linux)
EXTRA_BUILD_FLAGS+= -tags=hidraw
endif
CLIENT_DEST?="./cmd./keymaster/"
else
CLIENT_DEST?=".\\\\cmd\\\\keymaster\\\\"
endif


Expand All @@ -35,30 +38,30 @@ all: install-client
cd cmd/keymaster-eventmond; go install -ldflags "${DEFAULT_LDFLAGS}"

build: cmd/keymasterd/binData.go
go build ${EXTRA_BUILD_FLAGS} -ldflags "${DEFAULT_LDFLAGS}" -o bin/ ./...
go build ${EXTRA_BUILD_FLAGS} -ldflags "${CLIENT_LDFLAGS}" -o bin/ ./...

cmd/keymasterd/binData.go:
-go-bindata -fs -o cmd/keymasterd/binData.go -prefix cmd/keymasterd/data cmd/keymasterd/data/...

install-client: init-config-host cmd/keymasterd/binData.go
install-client: cmd/keymasterd/binData.go
cd cmd/keymaster; go install ${EXTRA_BUILD_FLAGS} -ldflags "${CLIENT_LDFLAGS}"

build-client: cmd/keymasterd/binData.go
go build -ldflags "${CLIENT_LDFLAGS}" -o bin $CLIENT_DEST

win-client: client-test
go build -ldflags "${CLIENT_LDFLAGS}" -o bin .\cmd\keymaster\

client-test:
go test -v ./cmd/keymaster/...

get-deps: init-config-host
get-deps:
go get -t ./...

clean:
rm -f bin/*
rm -f keymaster-*.tar.gz

init-config-host:
@test -f cmd/keymaster/config_host.go || (cp -p templates/config_host_go cmd/keymaster/config_host.go && echo 'Created initial cmd/keymaster/config_host.go')

${BINARY}-${VERSION}.tar.gz:
mkdir ${BINARY}-${VERSION}
rsync -av --exclude="config.yml" --exclude="*.pem" --exclude="*.out" lib/ ${BINARY}-${VERSION}/lib/
Expand All @@ -76,11 +79,11 @@ rpm: ${BINARY}-${VERSION}.tar.gz

tar: ${BINARY}-${VERSION}.tar.gz

test: init-config-host
test:
make -f makefile.certs
go test ./...

verbose-test: init-config-host
verbose-test:
go test -v ./...

format:
Expand Down
1 change: 1 addition & 0 deletions cmd/keymaster/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const (

const userAgentAppName = "keymaster"
const defaultVersionNumber = "No version provided"
const defaultConfigHost = ""

var (
// Must be a global variable in the data segment so that the build
Expand Down
3 changes: 0 additions & 3 deletions templates/config_host_go

This file was deleted.

0 comments on commit 238021d

Please sign in to comment.