-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
96 lines (81 loc) · 2.45 KB
/
Makefile
File metadata and controls
96 lines (81 loc) · 2.45 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Makefile for HackintoR
#
# Copyright (C) 2021 takfu.tk
#
# This is free software, licensed under the MIT General Public License.
# See /LICENSE for more information.
#
VERSION=1.0.0
GO_GEN=go generate main/hackintoR.go
NPM_PACK=npm run build:prod
DIST_DIR=./release
GO_CLEAN=go clean
NPM_CLEAN=npm cache clean -f
NODE_PATH=/usr/local
NODE_VERSION=15.12.0
GO_PATH=/usr/local
GO_VERSION=1.15.3
HackintoR: .bashrc generation
mkdir -p $(DIST_DIR) 2>/dev/null
flags="-X 'main.goversion=$(go version)'"
go build -ldflags "$$flags" -x -o $(DIST_DIR)/$@-${VERSION} main/hackintoR.go
echo "Done"
generation: .bashrc dist
source /$(shell whoami)/$<
$(GO_GEN)
dist: clean
$(NPM_PACK)
clean: modules
npm install --save
modules: native
rm node_$@ -fR
$(GO_CLEAN)
$(NPM_CLEAN)
native: .bashrc
if [ -z "$(echo $(whereis g++) | tr 'g++:' ' ')" ]; then yum install gcc-c++ -y ;fi
yum install python38.x86_64 -y
source /$(shell whoami)/$^
go get github.com/rakyll/statik
.ONESHELL:
.bashrc: world
person=$(shell whoami)
mkdir -p /$$person/.gopath >/dev/null
cat <<- EOF >> /$$person/$@
GOPATH=/$$person/.gopath
export GOPATH
EOF
echo 'export PATH=$$PATH:$$GOPATH/bin' >> /$$person/$@
world:
@if [[ "$$OSTYPE" == "linux-gnu" ]]; then \
echo "your OSTYPE is linux64 , Just waiting until PROGMS gracefully end." ;\
sleep 2; \
else \
echo "The current os is not supported" 1>&2; \
# exit 1; \
fi
@if type node >/dev/null 2>&1; then \
echo 'exists node' ; \
else \
echo 'not exists node' ; \
echo "installing nodejs" ; \
echo "https://nodejs.org/dist/latest-v15.x/node-v$(NODE_VERSION)-linux-x64.tar.gz" ; \
curl -jLO "https://nodejs.org/dist/latest-v15.x/node-v$(NODE_VERSION)-linux-x64.tar.gz" ; \
tar -C $(NODE_PATH) -zxvf node-*.tar.gz ; \
mv -vf $(NODE_PATH)/node-v$(NODE_VERSION)-* $(NODE_PATH)/node 2>/dev/null ; \
ln -sfn $(NODE_PATH)/node/bin/node /usr/bin/node ; \
ln -sfn $(NODE_PATH)/node/bin/npm /usr/bin/npm ; \
ln -sfn $(NODE_PATH)/node/bin/npx /usr/bin/npx ; \
rm node-*.tar.gz -fR ; \
echo "install nodejs done" ; \
fi
@if type go >/dev/null 2>&1; then \
echo 'exists go' ; \
else \
echo 'not exists go' ; \
curl -jLO "https://golang.org/dl/go$(GO_VERSION).linux-amd64.tar.gz" ; \
tar -C $(GO_PATH) -zxvf go$(GO_VERSION).linux*.tar.gz ; \
ln -sfn $(GO_PATH)/go/bin/go /usr/bin/go ; \
rm go$(GO_VERSION).linux*.tar.gz -fR ; \
echo "install golang done" ; \
fi
.PHONY: hackintor generation dist clean modules native world