delt01

Untitled

Feb 16th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.79 KB | None | 0 0
  1. #!/bin/bash
  2. # temporary replacement for cmake on windoze...
  3.  
  4. # user@phobos-windowz MINGW64 ~
  5. # $ wx-config --cflags
  6. # -I/usr/local/lib/wx/include/msw-unicode-3.1 -I/usr/local/include/wx-3.1 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__
  7. #
  8. # user@phobos-windowz MINGW64 ~
  9. # $ wx-config --cxxflags
  10. # -I/usr/local/lib/wx/include/msw-unicode-3.1 -I/usr/local/include/wx-3.1 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__
  11. #
  12. # user@phobos-windowz MINGW64 ~
  13. # $ wx-config --libs
  14. # -L/usr/local/lib   -Wl,--subsystem,windows -mwindows -lwx_mswu_xrc-3.1 -lwx_mswu_html-3.1 -lwx_mswu_qa-3.1 -lwx_mswu_adv-3.1 -lwx_mswu_core-3.1 -lwx_baseu_xml-3.1 -lwx_baseu_net-3.1 -lwx_baseu-3.1
  15.  
  16. CC="gcc"
  17. CPP="g++"
  18. LD="gcc"
  19.  
  20. #CFLAGS="-I/usr/local/lib/wx/include/msw-unicode-3.1 -I/usr/local/include/wx-3.1 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__"
  21. #CXXFLAGS="-DUNICODE -I/usr/local/lib/wx/include/msw-unicode-3.1 -I/usr/local/include/wx-3.1 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__"
  22. #LDFLAGS="-L/usr/local/lib   -Wl,--subsystem,windows -mwindows /usr/local/lib/libwx_mswu_xrc-3.1.a /usr/local/lib/libwx_mswu_qa-3.1.a /usr/local/lib/libwx_baseu_net-3.1.a /usr/local/lib/libwx_mswu_html-3.1.a /usr/local/lib/libwx_mswu_adv-3.1.a /usr/local/lib/libwx_mswu_core-3.1.a /usr/local/lib/libwx_baseu_xml-3.1.a /usr/local/lib/libwx_baseu-3.1.a -lpng -ljpeg -ltiff -lexpat -lwxregexu-3.1 -lz -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lcomdlg32 -ladvapi32 -lversion -lwsock32 -lgdi32"
  23. CFLAGS="-Wno-write-strings `wx-config --cflags`"
  24. CXXFLAGS="-DUNICODE -fpermissive -Wno-write-strings `wx-config --cflags`"
  25. LDFLAGS="`wx-config --libs`"
  26.  
  27. filelist=" \
  28. cmdline \
  29. fileformat \
  30. blowfish \
  31. md5 \
  32. misc \
  33. memo \
  34. main \
  35. bodychart \
  36. ui \
  37. wxwidgets/prefs \
  38. wxwidgets/newuser \
  39. wxwidgets/newfile_dialog \
  40. wxwidgets/consentement_dialog \
  41. wxwidgets/newmemo \
  42. wxwidgets/about_dialog \
  43. wxwidgets/noteedit \
  44. wxwidgets/password \
  45. wxwidgets/accounting_dialog \
  46. wxwidgets/progress_dialog \
  47. wxwidgets/needleedit_dialog \
  48. wxwidgets/exposition \
  49. wxwidgets/unlockfile \
  50. wxwidgets/license_dialog \
  51. wxwidgets/mainwindow \
  52. wxwidgets/pointedit \
  53. wxwidgets/iconselector \
  54. wxwidgets/openfile \
  55. wxwidgets/editorwindow \
  56. wxwidgets/advancedsearch \
  57. wxwidgets/csst_dialog \
  58. wxwidgets/keygen \
  59. wxwidgets/add_extraflag_dialog \
  60. "
  61.  
  62. function highlight {
  63.   # TODO: figure out the escape sequences for using \033 in sed commands
  64.   sed -e 's/error:/error:/g' -e 's/warning:/warning:/g'
  65. }
  66.  
  67. function compile {
  68.   file=""
  69.   for suffix in c cpp; do
  70.     if [ "$file" = "" ]; then
  71.       testfile="../${1}.${suffix}"
  72.       echo -n "looking for $testfile... "
  73.       if [ -f $testfile ]; then
  74.         echo "found."
  75.         file=${testfile}
  76.       else
  77.         echo "not found."
  78.       fi
  79.     fi
  80.   done
  81.  
  82.   if true; then   # recompile everything
  83.   #if [ "./${1}.o" -ot "$file" ]; then   # we'd have to trace through all the headers included by $file
  84.     case "${file}" in
  85.       *.c)
  86.         echo ${CC} -c -o ./${1}.o ${CFLAGS} ${file}
  87.              ${CC} -c -o ./${1}.o ${CFLAGS} ${file} 2>&1 | highlight
  88.         [ "${PIPESTATUS[0]}" = "0" ] || exit 1
  89.       ;;
  90.      
  91.       *.cpp)
  92.         echo ${CPP} -c -o ./${1}.o ${CXXFLAGS} ${file}
  93.              ${CPP} -c -o ./${1}.o ${CXXFLAGS} ${file} 2>&1 | highlight
  94.         [ "${PIPESTATUS[0]}" = "0" ] || exit 1
  95.       ;;
  96.      
  97.       *)
  98.         echo "don't know what to do with $file"
  99.         exit 1
  100.       ;;
  101.      
  102.     esac
  103.   else
  104.     echo "${1}.o is up to date."
  105.   fi
  106. }
  107.  
  108. for file in $filelist; do
  109.   echo "________ ${file} ________"
  110.   compile "${file}"
  111. done
  112.  
  113. echo "________ LINKING ________"
  114. echo ${LD} -o acu.exe *.o wxwidgets/*.o ${LDFLAGS}
  115.      ${LD} -o acu.exe *.o wxwidgets/*.o ${LDFLAGS} || exit 1
  116.  
  117. echo "SUCCESS"
Add Comment
Please, Sign In to add comment