Skip to content

Commit 63f3dfc

Browse files
author
liushihao
committed
supported for windows
1 parent 6b2a16a commit 63f3dfc

File tree

3 files changed

+31
-20
lines changed

3 files changed

+31
-20
lines changed

fileshare/makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ build-linux:
1717
dpkg -b linux-deb/ bin/fileshare.deb
1818
build-windows:
1919
flutter build windows
20-
mkdir build/windows/x64/runner/Release/lib/
20+
- mkdir build/windows/x64/runner/Release/lib/
2121
cp lib/*_windows.so build/windows/x64/runner/Release/lib/
2222
- mkdir bin
23-
mv build/windows/x64/runner/Release bin/fileshare-windows
23+
rm -rf bin/fileshare-windows
24+
cp -r build/windows/x64/runner/Release bin/fileshare-windows
2425
clean:
2526
rm -rf bin
2627
rm -rf linux-deb/opt/fileshare/*

makefile

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,40 @@ else
77
PLATFORM="Unix-Like"
88
endif
99
endif
10-
10+
build:
11+
ifeq ($(OS),Windows_NT)
12+
make build-windows
13+
else
14+
ifeq ($(shell uname),Darwin)
15+
echo "not supported: Darwin"
16+
exit 1
17+
else
18+
make build-linux
19+
endif
20+
endif
1121
clean:
1222
rm -rf bin/
1323
rm -rf server/web/
1424
cd fileshare_web && make clean
1525
cd fileshare && make clean
1626
@echo "clean done"
1727

18-
build-linux-and-android:
28+
build-linux:
1929
cd fileshare_web && make build-web
2030
cp -r fileshare_web/build/web/ ./fileshare_go/server/
2131
cd fileshare_go && make build-so-linux
22-
cd fileshare_go && make build-so-android
23-
cd fileshare && make build-apk
2432
cd fileshare && make build-linux
2533
cp -r fileshare/bin/ ./
26-
@echo "all done, look at the directory bin/"
34+
@echo "PLATFORM: $(PLATFORM) all done, look at the directory bin/"
35+
@echo "--------$$ ls -lha bin --------"
36+
@ls -lha bin
37+
build-windows:
38+
cd fileshare_web && make build-web
39+
cp -r fileshare_web/build/web/ ./fileshare_go/server/
40+
cd fileshare_go && make build-so-windows
41+
cd fileshare && make build-windows
42+
cp -r fileshare/bin/ ./
43+
@echo "PLATFORM: $(PLATFORM) all done, look at the directory bin/"
2744
@echo "--------$$ ls -lha bin --------"
2845
@ls -lha bin
2946

@@ -34,23 +51,16 @@ build-android:
3451
cd fileshare && make build-apk
3552
cp -r fileshare/bin/ ./
3653
@echo "all done, look at the directory bin/"
37-
@echo "--------$$ ls -lha bin --------"
54+
@echo "--------$$ ls -lha bin --------"
3855
@ls -lha bin
39-
build-linux:
56+
build-linux-and-android:
4057
cd fileshare_web && make build-web
4158
cp -r fileshare_web/build/web/ ./fileshare_go/server/
4259
cd fileshare_go && make build-so-linux
60+
cd fileshare_go && make build-so-android
61+
cd fileshare && make build-apk
4362
cd fileshare && make build-linux
4463
cp -r fileshare/bin/ ./
45-
@echo "PLATFORM: $(PLATFORM) all done, look at the directory bin/"
64+
@echo "all done, look at the directory bin/"
4665
@echo "--------$$ ls -lha bin --------"
4766
@ls -lha bin
48-
build-windows:
49-
cd fileshare_web && make build-web
50-
cp -r fileshare_web/build/web/ ./fileshare_go/server/
51-
cd fileshare_go && make build-so-windows
52-
cd fileshare && make build-windows
53-
cp -r fileshare/bin/ ./
54-
@echo "PLATFORM: $(PLATFORM) all done, look at the directory bin/"
55-
@echo "--------$$ ls -lha bin --------"
56-
@ls -lha bin

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
```shell
33
make build
44
```
5-
the binary file will be generated in the `bin` directory. linux and android are supported.
5+
the binary file will be generated in the `bin` directory. linux, windows and android are supported.
66

77

88
## Project Tree

0 commit comments

Comments
 (0)