-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
47 lines (44 loc) · 1.52 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
output=output
output-linux=$(output)/linux
output-windows=$(output)/windows
build: build-linux build-windows
build-linux:
test -d $(output) || mkdir $(output)
# Test if the output folder exists. If not create it.
test -d $(output-linux) || mkdir $(output-linux)
# Remove all files in the output folder
rm -rfv $(output-linux)/*
# Install dependencies
cd client && yarn install
# Build React fontend
cd client && yarn build
# Copy the frontend build to the output folder
mv client/build $(output-linux)
# Build the Go server
cd server && dep ensure
cd server && go build -o worky
# Copy Go server to output directory
mv server/worky $(output-linux)
# Compress the output to a release package
zip -r $(output-linux).zip $(output-linux)
tar -zcvf $(output-linux).tar.gz $(output-linux)
build-windows:
test -d $(output) || mkdir $(output)
# Test if the output folder exists. If not create it.
test -d $(output-windows) || mkdir $(output-windows)
# Remove all files in the output folder
rm -rfv $(output-windows)/*
# Install dependencies
cd client && yarn install
# Build React fontend
cd client && yarn build
# Copy the frontend build to the output folder
mv client/build $(output-windows)
# Build the Go server
cd server && dep ensure
cd server && GOOS=windows GOARCH=386 go build -o worky.exe
# Copy Go server to output directory
mv server/worky.exe $(output-windows)
# Compress the output to a release package
zip -r $(output-windows).zip $(output-windows)
tar -zcvf $(output-windows).tar.gz $(output-windows)