make.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. echo "/* test.code.version="`git log -1 --format=%cd --date=format:%Y%m%d%H%M%S`" */;" > basic/99ver/99ver.mql
  19. newdirinfo=`ls -lrt *.go ../odbcmql/*.go ../../go.*`
  20. dirinfo=`cat mqldirinfo`
  21. if [[ "${dirinfo}" != "${newdirinfo}" || "$1" == "force" ]]; then
  22. buildmql
  23. fi
  24. # ls -l | grep '^d' | awk '{print $9}' | xargs -I % cp -rf % ${installpath}/matrix/mql
  25. cp -pf initkeyspace.sh ${installpath}/matrix/mql
  26. cp -pf initkeyspace.sh ${installpath}/linux_amd64
  27. cp -pf mqltest.sh ${installpath}/matrix/mql
  28. cp -pf mqltest.sh ${installpath}/linux_amd64
  29. cp -pf oktest.sh ${installpath}/matrix/mql
  30. cp -pf oktest.sh ${installpath}/linux_amd64
  31. cp -pf pprof.sh ${installpath}/matrix/mql
  32. cp -pf pprof.sh ${installpath}/linux_amd64
  33. cp -pf ${installpath}/linux_amd64/msh ${installpath}/matrix/mql
  34. ./syncmql.sh