Update Makefile

This commit is contained in:
Torjus Håkestad 2021-04-10 12:03:13 +02:00
parent a60190e6ac
commit 0fb2871ba1

View File

@ -14,7 +14,7 @@ BUILD_DIR = build/binary/current
BUILD_OUTPUT = $(BUILD_DIR)/$(NAME)-$(VERSION)-$(OS)-$(ARCH) BUILD_OUTPUT = $(BUILD_DIR)/$(NAME)-$(VERSION)-$(OS)-$(ARCH)
BUILD_FLAGS = -tags embed -ldflags "-X github.uio.no/torjus/apiary.Build=$(GIT_COMMIT)" -o $(BUILD_OUTPUT) BUILD_FLAGS = -tags embed -ldflags "-X github.uio.no/torjus/apiary.Build=$(GIT_COMMIT)" -o $(BUILD_OUTPUT)
GEODB_URL = https://github.com/geoacumen/geoacumen-country/raw/master/Geoacumen-Country.mmdb GEODB_URL = https://raw.githubusercontent.com/geoacumen/geoacumen-country/master/Geoacumen-Country.mmdb
GEODB_PATH = honeypot/Geoacumen-Country.mmdb GEODB_PATH = honeypot/Geoacumen-Country.mmdb
FRONTEND_BUILD_DIR = web/frontend/dist FRONTEND_BUILD_DIR = web/frontend/dist
@ -33,7 +33,10 @@ $(GEODB_PATH):
$(BUILD_DIR): $(BUILD_DIR):
mkdir -p $(BUILD_DIR) mkdir -p $(BUILD_DIR)
$(BUILD_OUTPUT): $(BUILD_DIR) $(GEODB_PATH) $(FRONTEND_BUILD_DIR):
cd web/frontend && yarn install && yarn build
$(BUILD_OUTPUT): $(BUILD_DIR) $(GEODB_PATH) $(FRONTEND_BUILD_DIR)
CGO_ENABLED=0 go build $(BUILD_FLAGS) cmd/apiary.go CGO_ENABLED=0 go build $(BUILD_FLAGS) cmd/apiary.go
frontend: frontend:
@ -45,7 +48,7 @@ clean:
geodb: $(GEODB_PATH) geodb: $(GEODB_PATH)
build: $(BUILD_OUTPUT) frontend build: $(BUILD_OUTPUT)
install: build install: build
mkdir -p $(INSTALL_BIN_DIR) mkdir -p $(INSTALL_BIN_DIR)