Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # temporary replacement for cmake on windoze...
- # user@phobos-windowz MINGW64 ~
- # $ wx-config --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__
- #
- # user@phobos-windowz MINGW64 ~
- # $ wx-config --cxxflags
- # -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__
- #
- # user@phobos-windowz MINGW64 ~
- # $ wx-config --libs
- # -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
- CC="gcc"
- CPP="g++"
- LD="gcc"
- #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__"
- #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__"
- #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"
- CFLAGS="-Wno-write-strings `wx-config --cflags`"
- CXXFLAGS="-DUNICODE -fpermissive -Wno-write-strings `wx-config --cflags`"
- LDFLAGS="`wx-config --libs`"
- filelist=" \
- cmdline \
- fileformat \
- blowfish \
- md5 \
- misc \
- memo \
- main \
- bodychart \
- ui \
- wxwidgets/prefs \
- wxwidgets/newuser \
- wxwidgets/newfile_dialog \
- wxwidgets/consentement_dialog \
- wxwidgets/newmemo \
- wxwidgets/about_dialog \
- wxwidgets/noteedit \
- wxwidgets/password \
- wxwidgets/accounting_dialog \
- wxwidgets/progress_dialog \
- wxwidgets/needleedit_dialog \
- wxwidgets/exposition \
- wxwidgets/unlockfile \
- wxwidgets/license_dialog \
- wxwidgets/mainwindow \
- wxwidgets/pointedit \
- wxwidgets/iconselector \
- wxwidgets/openfile \
- wxwidgets/editorwindow \
- wxwidgets/advancedsearch \
- wxwidgets/csst_dialog \
- wxwidgets/keygen \
- wxwidgets/add_extraflag_dialog \
- "
- function highlight {
- # TODO: figure out the escape sequences for using \033 in sed commands
- sed -e 's/error:/[1;31merror:[0;37m/g' -e 's/warning:/[1;36mwarning:[0;37m/g'
- }
- function compile {
- file=""
- for suffix in c cpp; do
- if [ "$file" = "" ]; then
- testfile="../${1}.${suffix}"
- echo -n "looking for $testfile... "
- if [ -f $testfile ]; then
- echo "found."
- file=${testfile}
- else
- echo "not found."
- fi
- fi
- done
- if true; then # recompile everything
- #if [ "./${1}.o" -ot "$file" ]; then # we'd have to trace through all the headers included by $file
- case "${file}" in
- *.c)
- echo ${CC} -c -o ./${1}.o ${CFLAGS} ${file}
- ${CC} -c -o ./${1}.o ${CFLAGS} ${file} 2>&1 | highlight
- [ "${PIPESTATUS[0]}" = "0" ] || exit 1
- ;;
- *.cpp)
- echo ${CPP} -c -o ./${1}.o ${CXXFLAGS} ${file}
- ${CPP} -c -o ./${1}.o ${CXXFLAGS} ${file} 2>&1 | highlight
- [ "${PIPESTATUS[0]}" = "0" ] || exit 1
- ;;
- *)
- echo "don't know what to do with $file"
- exit 1
- ;;
- esac
- else
- echo "${1}.o is up to date."
- fi
- }
- for file in $filelist; do
- echo "________ ${file} ________"
- compile "${file}"
- done
- echo "________ LINKING ________"
- echo ${LD} -o acu.exe *.o wxwidgets/*.o ${LDFLAGS}
- ${LD} -o acu.exe *.o wxwidgets/*.o ${LDFLAGS} || exit 1
- echo "SUCCESS"
Add Comment
Please, Sign In to add comment