Skip to content

Commit a44a93b

Browse files
committed
Makefile: fix ghost binary naming
1 parent b0a7d26 commit a44a93b

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

Makefile

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ GO_DIRS=./overlord/... ./cmd/...
1414

1515
# Supported architectures for ghost binary
1616
GHOST_ARCHS=amd64 386 arm64 arm
17-
GHOST_BINS=$(addprefix $(BIN)/ghost., $(addsuffix .linux,$(GHOST_ARCHS)))
17+
GHOST_BINS=$(addprefix $(BIN)/ghost.linux., $(GHOST_ARCHS))
1818

1919
# Get list of apps with package.json
2020
APP_DIRS=$(shell find apps -maxdepth 1 -mindepth 1 \
@@ -57,11 +57,11 @@ ghost: deps
5757
$(call cmd_msg,GO,cmd/$@)
5858
@GOBIN=$(BIN) $(GO) install $(LDFLAGS) $(CURDIR)/cmd/$@
5959

60-
$(BIN)/ghost.%.linux:
60+
$(BIN)/ghost.linux.%:
6161
$(call cmd_msg,GO,$(notdir $@))
6262
@GOOS=linux GOARCH=$* $(GO) build $(LDFLAGS) -o $@ $(CURDIR)/cmd/ghost
6363

64-
$(BIN)/ghost.%.linux.sha1: $(BIN)/ghost.%.linux
64+
$(BIN)/ghost.linux.%.sha1: $(BIN)/ghost.linux.%
6565
$(call cmd_msg,SHA1,$(notdir $<))
6666
@cd $(BIN) && sha1sum $(notdir $<) > $(notdir $@)
6767

@@ -71,6 +71,9 @@ build-go: overlordd ghost ghost-all
7171

7272
build-py:
7373
@ln -sf ../scripts/ghost.py bin
74+
$(call cmd_msg,SHA1,ghost.py)
75+
@sha1sum scripts/ghost.py > bin/ghost.py.sha1
76+
7477
@mkdir -p $(BUILD)
7578
$(call cmd_msg,VENV,creating virtualenv)
7679
@rm -rf $(BUILD)/.venv
@@ -79,14 +82,21 @@ build-py:
7982
@cd $(BUILD); \
8083
. $(BUILD)/.venv/bin/activate; \
8184
pip install -q -r $(CURDIR)/requirements.txt; \
82-
pip install -q pyinstaller; \
83-
$(call cmd_msg,GEN,ovl.py.bin); \
84-
pyinstaller --onefile $(CURDIR)/scripts/ovl.py > /dev/null; \
85-
$(call cmd_msg,GEN,ghost.py.bin); \
85+
pip install -q pyinstaller
86+
87+
$(call cmd_msg,GEN,ovl.pybin)
88+
@cd $(BUILD); . $(BUILD)/.venv/bin/activate; \
89+
pyinstaller --onefile $(CURDIR)/scripts/ovl.py > /dev/null;
90+
@mv $(BUILD)/dist/ovl $(BIN)/ovl.pybin
91+
$(call cmd_msg,SHA1,ovl.pybin)
92+
@cd $(BIN) && sha1sum ovl.pybin > ovl.pybin.sha1
93+
94+
$(call cmd_msg,GEN,ghost.pybin)
95+
@cd $(BUILD); . $(BUILD)/.venv/bin/activate; \
8696
pyinstaller --onefile $(CURDIR)/scripts/ghost.py > /dev/null
87-
$(call cmd_msg,MV,binaries to $(BIN))
88-
@mv $(BUILD)/dist/ovl $(BIN)/ovl.py.bin
89-
@mv $(BUILD)/dist/ghost $(BIN)/ghost.py.bin
97+
@mv $(BUILD)/dist/ghost $(BIN)/ghost.pybin
98+
$(call cmd_msg,SHA1,ghost.pybin)
99+
@cd $(BIN) && sha1sum ghost.pybin > ghost.pybin.sha1
90100

91101
go-fmt:
92102
$(call cmd_msg,FMT,$(GO_DIRS))
@@ -124,5 +134,5 @@ clean-apps:
124134
clean: clean-apps
125135
$(call cmd_msg,RM,build artifacts)
126136
@rm -rf $(BIN)/ghost* $(BIN)/overlordd $(BUILD) \
127-
$(BIN)/ghost.py.bin $(BIN)/ovl.py.bin \
137+
$(BIN)/ghost.pybin $(BIN)/ovl.pybin \
128138
$(DIST_APPS_DIR)

0 commit comments

Comments
 (0)