-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
33 lines (28 loc) · 977 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
REPO_NAME=vanitygen-hd
TARGET_DIR=.target
DIST_DIR=.dist
NODE_VER=node12
PACKAGE_TARGETS=$(NODE_VER)-linux,$(NODE_VER)-macos,$(NODE_VER)-win
build:
@docker build -t zealic/$(REPO_NAME) .
exec:
@docker run -it --rm --entrypoint=ash zealic/$(REPO_NAME)
clean:
@rm -rf $(PWD)/$(TARGET_DIR)
@rm -rf $(PWD)/$(DIST_DIR)
package: clean
@tsc
@./node_modules/.bin/pkg -target=$(PACKAGE_TARGETS) --out-path=$(DIST_DIR) $(TARGET_DIR)/$(REPO_NAME).js
@(set -e; cd $(DIST_DIR); \
chmod +x $(REPO_NAME)-*; \
mv $(REPO_NAME)-linux $(REPO_NAME)_linux-amd64; \
mv $(REPO_NAME)-macos $(REPO_NAME)_darwin-amd64; \
mv $(REPO_NAME)-win.exe $(REPO_NAME)_windows-amd64.exe; \
sha256sum $(REPO_NAME)_* > checksum.sha256; \
)
dist:
@(set -e; cd $(DIST_DIR); \
tar cvzf $(REPO_NAME)_linux-amd64.tar.gz $(REPO_NAME)_linux-amd64; \
tar cvzf $(REPO_NAME)_darwin-amd64.tar.gz $(REPO_NAME)_darwin-amd64; \
zip $(REPO_NAME)_windows-amd64.zip $(REPO_NAME)_windows-amd64.exe; \
)