This commit is contained in:
mmetc 2022-02-14 22:21:19 +01:00 committed by GitHub
parent 43d5690432
commit 556892cf86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View file

@ -61,6 +61,9 @@ LD_OPTS_VARS= \
export LD_OPTS=-ldflags "-s -w $(LD_OPTS_VARS)" export LD_OPTS=-ldflags "-s -w $(LD_OPTS_VARS)"
export LD_OPTS_STATIC=-ldflags "-s -w $(LD_OPTS_VARS) -extldflags '-static'" export LD_OPTS_STATIC=-ldflags "-s -w $(LD_OPTS_VARS) -extldflags '-static'"
GOCMD=go
GOTEST=$(GOCMD) test
RELDIR = crowdsec-$(BUILD_VERSION) RELDIR = crowdsec-$(BUILD_VERSION)
.PHONY: all .PHONY: all
@ -89,7 +92,7 @@ goversion:
fi fi
.PHONY: clean .PHONY: clean
clean: clean: testclean
@$(MAKE) -C $(CROWDSEC_FOLDER) clean --no-print-directory @$(MAKE) -C $(CROWDSEC_FOLDER) clean --no-print-directory
@$(MAKE) -C $(CSCLI_FOLDER) clean --no-print-directory @$(MAKE) -C $(CSCLI_FOLDER) clean --no-print-directory
@$(RM) $(CROWDSEC_BIN) @$(RM) $(CROWDSEC_BIN)
@ -101,6 +104,7 @@ clean:
@$(RM) $(SPLUNK_PLUGIN_FOLDER)/$(SPLUNK_PLUGIN_BIN) @$(RM) $(SPLUNK_PLUGIN_FOLDER)/$(SPLUNK_PLUGIN_BIN)
@$(RM) $(EMAIL_PLUGIN_FOLDER)/$(EMAIL_PLUGIN_BIN) @$(RM) $(EMAIL_PLUGIN_FOLDER)/$(EMAIL_PLUGIN_BIN)
cscli: goversion cscli: goversion
@GOARCH=$(GOARCH) GOOS=$(GOOS) $(MAKE) -C $(CSCLI_FOLDER) build --no-print-directory @GOARCH=$(GOARCH) GOOS=$(GOOS) $(MAKE) -C $(CSCLI_FOLDER) build --no-print-directory
@ -137,8 +141,14 @@ splunk-plugin_static:goversion
email-plugin_static:goversion email-plugin_static:goversion
@GOARCH=$(GOARCH) GOOS=$(GOOS) $(MAKE) -C $(EMAIL_PLUGIN_FOLDER) static --no-print-directory @GOARCH=$(GOARCH) GOOS=$(GOOS) $(MAKE) -C $(EMAIL_PLUGIN_FOLDER) static --no-print-directory
.PHONY: testclean
testclean:
@$(RM) pkg/apiserver/ent
@$(RM) -r pkg/cwhub/hubdir
.PHONY: test
test: goversion test: goversion
@$(MAKE) -C $(CROWDSEC_FOLDER) test --no-print-directory $(GOTEST) $(LD_OPTS) ./...
.PHONY: package .PHONY: package
package: package:

View file

@ -27,7 +27,7 @@ test:
$(GOTEST) $(LD_OPTS) -v ./... $(GOTEST) $(LD_OPTS) -v ./...
clean: clean:
rm -f $(CROWDSEC_BIN) @$(RM) $(CROWDSEC_BIN)
.PHONY: install .PHONY: install
install: install-conf install-bin install: install-conf install-bin