make.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. installpath=`go env GOPATH | awk -F ':' '{print $1}'`/bin
  2. buildmql() {
  3. echo build
  4. CGO_ENABLED=0 go test -o ./mql -c -args
  5. echo build linux
  6. CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go test -o ${installpath}/matrix/mql/mql -c -args
  7. echo build arm64
  8. CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go test -o ${installpath}/matrix/mql/mql_arm -c -args
  9. echo build darwin
  10. CGO_ENABLED=0 GOOS=darwin go test -o ${installpath}/matrix/mql/mql_mac -c -args
  11. echo build windows
  12. CGO_ENABLED=0 GOOS=windows go test -o ${installpath}/matrix/mql/mql.exe -c -args
  13. echo build loong64
  14. CGO_ENABLED=0 GOOS=linux GOARCH=loong64 go test -o ${installpath}/matrix/mql/mql_loong -c -args
  15. cp -pf ${installpath}/matrix/mql/mql ${installpath}/linux_amd64
  16. echo "${newdirinfo}" > mqldirinfo
  17. }
  18. newdirinfo=`ls -lrt *.go ../odbcmql/*.go ../../go.*`
  19. dirinfo=`cat mqldirinfo`
  20. if [[ "${dirinfo}" != "${newdirinfo}" || "$1" == "force" ]]; then
  21. buildmql
  22. fi
  23. # ls -l | grep '^d' | awk '{print $9}' | xargs -I % cp -rf % ${installpath}/matrix/mql
  24. cp -pf initkeyspace.sh ${installpath}/matrix/mql
  25. cp -pf initkeyspace.sh ${installpath}/linux_amd64
  26. cp -pf mqltest.sh ${installpath}/matrix/mql
  27. cp -pf mqltest.sh ${installpath}/linux_amd64
  28. cp -pf oktest.sh ${installpath}/matrix/mql
  29. cp -pf oktest.sh ${installpath}/linux_amd64
  30. cp -pf pprof.sh ${installpath}/matrix/mql
  31. cp -pf pprof.sh ${installpath}/linux_amd64
  32. cp -pf ${installpath}/linux_amd64/msh ${installpath}/matrix/mql
  33. ./syncmql.sh