From dc9d790bd3fd7306c26ee672de2b8e909053a82a Mon Sep 17 00:00:00 2001 From: Sauyon Lee Date: Mon, 3 Feb 2020 12:55:57 -0800 Subject: [PATCH] Makefile: Make better use of built-in variables --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index fd17cf53..40e49b18 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ clean: tools: $(addsuffix $(EXE),$(addprefix tools/bin/,$(BINARIES))) tools/tokenizer.jar $(addsuffix $(EXE),$(addprefix tools/bin/,$(BINARIES))): - go build -mod=vendor -o $@ ./extractor/cli/$(basename $(notdir $@)) + go build -mod=vendor -o $@ ./extractor/cli/$(basename $(@F)) tools-codeql: tools-$(CODEQL_PLATFORM) @@ -39,17 +39,17 @@ tools-codeql-full: tools-linux64 tools-osx64 tools-win64 tools-linux64: $(addprefix tools/linux64/,$(BINARIES)) tools/tokenizer.jar $(addprefix tools/linux64/,$(BINARIES)): - GOOS=linux GOARCH=amd64 go build -mod=vendor -o $@ ./extractor/cli/$(notdir $@) + GOOS=linux GOARCH=amd64 go build -mod=vendor -o $@ ./extractor/cli/$(@F) tools-osx64: $(addprefix tools/osx64/,$(BINARIES)) tools/tokenizer.jar $(addprefix tools/osx64/,$(BINARIES)): - GOOS=darwin GOARCH=amd64 go build -mod=vendor -o $@ ./extractor/cli/$(notdir $@) + GOOS=darwin GOARCH=amd64 go build -mod=vendor -o $@ ./extractor/cli/$(@F) tools-win64: $(addsuffix .exe,$(addprefix tools/win64/,$(BINARIES))) tools/tokenizer.jar $(addsuffix .exe,$(addprefix tools/win64/,$(BINARIES))): - env GOOS=windows GOARCH=amd64 go build -mod=vendor -o $@ ./extractor/cli/$(basename $(notdir $@)) + env GOOS=windows GOARCH=amd64 go build -mod=vendor -o $@ ./extractor/cli/$(basename $(@F)) .PHONY: extractor-common extractor extractor-full extractor-common: codeql-extractor.yml COPYRIGHT LICENSE ql/src/go.dbscheme \ @@ -71,14 +71,14 @@ tools/tokenizer.jar: tools/net/sourceforge/pmd/cpd/GoLanguage.class jar uf $@ -C tools opencsv tools/net/sourceforge/pmd/cpd/GoLanguage.class: extractor/net/sourceforge/pmd/cpd/GoLanguage.java - javac -cp extractor -d tools $^ + javac -cp extractor -d tools $< rm tools/net/sourceforge/pmd/cpd/AbstractLanguage.class rm tools/net/sourceforge/pmd/cpd/SourceCode.class rm tools/net/sourceforge/pmd/cpd/TokenEntry.class rm tools/net/sourceforge/pmd/cpd/Tokenizer.class ql/src/go.dbscheme: tools/$(CODEQL_PLATFORM)/go-extractor$(EXE) - env TRAP_FOLDER=/tmp $^ --dbscheme $@ + env TRAP_FOLDER=/tmp $< --dbscheme $@ build/stats/src.stamp: mkdir -p $(@D)/src