Skip to content

Commit

Permalink
update makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Nov 29, 2023
1 parent 079c428 commit 8f6ad17
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 22 deletions.
10 changes: 10 additions & 0 deletions Dockerfile-stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

# final stage
FROM debian:stable-slim
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
RUN update-ca-certificates
COPY bin/* /app
EXPOSE 8080
ENTRYPOINT ["./dora-explorer"]
CMD []
25 changes: 3 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# dora
EXECUTABLE=explorer
WINDOWS=$(EXECUTABLE)_windows_amd64.exe
LINUX=$(EXECUTABLE)_linux_amd64
DARWIN=$(EXECUTABLE)_darwin_amd64
VERSION := $(shell git rev-parse --short HEAD)
BUILDTIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
VERSION := $(shell git rev-parse --short HEAD)

Expand All @@ -18,23 +13,9 @@ all: test build
test:
go test ./...

build: windows linux darwin
build:
@echo version: $(VERSION)

windows: $(WINDOWS)

linux: $(LINUX)

darwin: $(DARWIN)

$(WINDOWS):
env CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -v -o bin/$(WINDOWS) -ldflags="-s -w $(GOLDFLAGS)" ./cmd/explorer

$(LINUX):
env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -v -o bin/$(LINUX) -ldflags="-s -w $(GOLDFLAGS)" ./cmd/explorer

$(DARWIN):
env CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -v -o bin/$(DARWIN) -ldflags="-s -w $(GOLDFLAGS)" ./cmd/explorer
env CGO_ENABLED=1 go build -v -o bin/ -ldflags="-s -w $(GOLDFLAGS)" ./cmd/*

clean:
rm -f $(WINDOWS) $(LINUX) $(DARWIN)
rm -f bin/*
File renamed without changes.

0 comments on commit 8f6ad17

Please sign in to comment.