#!/bin/sh # Compile mixmaster using MSVC MIXMASTER_VER ?=2.9.1 OPENSSL_VER ?=0.9.7c ZLIB_VER ?=1.1.4 PCRE_VER ?=2.08 INSTALL_DIR ?=C:\\Program Files\\Mixmaster MIXMASTER_DIR=mixmaster-${MIXMASTER_VER} MIXMASTER_GZ=${MIXMASTER_DIR}.tar.gz MIX_EXE=${MIXMASTER_DIR}/Src/Release/Mix.exe MIXLIB_DLL=${MIXMASTER_DIR}/Src/Release/mixlib.dll OPENSSL_DIR=openssl-${OPENSSL_VER} ZLIB_LIB=${MIXMASTER_DIR}/Src/zlib-${ZLIB_VER}/zlib.lib PCRE_LIB=${MIXMASTER_DIR}/Src/pcre-${PCRE_VER}/pcre.lib MIXMASTER_TOUCH=${MIXMASTER_DIR}${MIXMASTER_DIR}.touch MIX_MAK_PATCH_TOUCH=${MIXMASTER_DIR}/mix.mak.patch.touch UPX_TOUCH=${MIXMASTER_DIR}/upx.touch MIXMASTER_RAR=${MIXMASTER_DIR}.rar .PHONY: all clean dist install pack rar all: ${MIXMASTER_DIR}/Src/include/openssl/ui_compat.h \ ${MIXMASTER_DIR}/Src/libeay32.dll \ ${ZLIB_LIB} \ ${PCRE_LIB} \ ${MIXLIB_DLL} \ ${MIX_EXE} ${MIXMASTER_GZ}: wget -N http://easynews.dl.sourceforge.net/sourceforge/mixmaster/${MIXMASTER_GZ} ${MIXMASTER_TOUCH}: ${MIXMASTER_GZ} tar xzvf ${MIXMASTER_GZ} touch $@ # 3. Copy the following files from the OpenSSL package you built in # step 1 into the mixmaster tree. # # c:\openssl-0.9.7c\inc32\openssl\*.* -> c:\mixmaster-2.9.1\Src\include\openssl\ # c:\openssl-0.9.7c\out32dll\libeay32.* -> c:\mixmaster-2.9.1\Src\ ${MIXMASTER_DIR}/Src/include/openssl/ui_compat.h: ${MIXMASTER_TOUCH} mkdir -p ${MIXMASTER_DIR}/Src/include/openssl cp ${OPENSSL_DIR}/inc32/openssl/* ${MIXMASTER_DIR}/Src/include/openssl touch $@ ${MIXMASTER_DIR}/Src/libeay32.dll: ${MIXMASTER_TOUCH} cp ${OPENSSL_DIR}/out32dll/libeay32.* ${MIXMASTER_DIR}/Src touch $@ # 4. Copy the two makefiles mix.mak and mixlib.mak from c:\mixmaster-2.9.1\Win\ to # c:\mixmaster-2.9.1\Src\ ${MIXMASTER_DIR}/Src/mix.mak: ${MIXMASTER_TOUCH} cp ${MIXMASTER_DIR}/Win/mix*.mak ${MIXMASTER_DIR}/Src touch $@ # 5. Copy the makefile zlib.mak from c:\mixmaster-2.9.1\Win\ to # c:\mixmaster-2.9.1\Src\zlib-${ZLIB_VER}\ ${MIXMASTER_DIR}/Src/zlib-${ZLIB_VER}/zlib.mak: ${MIXMASTER_TOUCH} cp ${MIXMASTER_DIR}/Win/zlib.mak $@ touch $@ # 6. Copy the makefile pcre.mak from c:\mixmaster-2.9.1\Win\ to # c:\mixmaster-2.9.1\Src\pcre-${PCRE_VER}\ ${MIXMASTER_DIR}/Src/pcre-${PCRE_VER}/pcre.mak: ${MIXMASTER_TOUCH} cp ${MIXMASTER_DIR}/Win/pcre.mak $@ touch $@ # 7. Start a command line (Dos) session and cd \mixmaster-2.9.1\Src\zlib-${ZLIB_VER} # # 8. Build the zlib library by typing "nmake -f zlib.mak" ${ZLIB_LIB}: ${MIXMASTER_TOUCH} cd ${MIXMASTER_DIR}/Src/zlib-${ZLIB_VER} && \ MAKEFLAGS="" nmake -f ../../Win/zlib.mak # 9. Change dir to \mixmaster-2.9.1\Src\pcre-${PCRE_VER} # # 10. Build the pcre library by typing "nmake -f pcre.mak" # There may be some warnings which can be ignored. ${PCRE_LIB}: ${MIXMASTER_TOUCH} cd ${MIXMASTER_DIR}/Src/pcre-${PCRE_VER} && \ MAKEFLAGS="" nmake -f ../../Win/pcre.mak # 11. Change dir to \mixmaster-2.9.1\Src # # 12. Build the mixmaster library by typing "nmake -f mixlib.mak" # There may be some compiler warnings which can be ignored. ${MIXLIB_DLL}: ${MIXMASTER_TOUCH} cd ${MIXMASTER_DIR}/Src && \ MAKEFLAGS="" nmake -f ../Win/mixlib.mak touch $@ # 13. Build the mixmaster executable by typing "nmake -f mix.mak" ${MIX_MAK_PATCH_TOUCH}: ${MIXMASTER_TOUCH} cd ${MIXMASTER_DIR}/Win && \ patch -p0 <../../mix.mak.patch touch $@ ${MIX_EXE}: ${MIXMASTER_TOUCH} ${MIX_MAK_PATCH_TOUCH} cd ${MIXMASTER_DIR}/Src && \ MAKEFLAGS="" nmake -f ../Win/mix.mak chmod +x $@ touch $@ # ${MIXMASTER_DIR}/Src/mix.mak \ # ${MIXMASTER_DIR}/Src/zlib-${ZLIB_VER}/zlib.mak \ # ${MIXMASTER_DIR}/Src/pcre-${PCRE_VER}/pcre.mak \ # 14. Copy the files mix.exe and mixlib.dll from c:\mixmaster-2.9.1\Src\Release to a suitable # mixmaster run directory (e.g. c:\mix). # # 15. Copy c:\mixmaster-2.9.1\Src\libeay32.dll to the same mixmaster run directory. # # 16. Copy the other files required to run mixmaster from c:\mixmaster-2.9.1\conf # to the same mixmaster run directory. install: mkdir -p "${INSTALL_DIR}" cp -p \ ${MIX_EXE} \ ${MIXLIB_DLL} \ ${OPENSSL_DIR}/out32dll/libeay32.dll \ ${MIXMASTER_DIR}/conf/* \ "${INSTALL_DIR}" ${UPX_TOUCH}: ${MIX_EXE} upx ${MIXLIB_DLL} ${MIX_EXE} chmod +x ${MIX_EXE} touch $@ pack: ${UPX_TOUCH} ${MIXMASTER_RAR}: ${UPX_TOUCH} rar a -ep ${MIXMASTER_RAR} \ ${MIX_EXE} \ ${MIXLIB_DLL} \ ${OPENSSL_DIR}/out32dll/libeay32.dll \ ${MIXMASTER_DIR}/conf/* \ ${MIXMASTER_DIR}/README \ ${MIXMASTER_DIR}/COPYRIGHT rar: ${MIXMASTER_RAR} dist: rar clean: rm -fr \ ${MIXMASTER_GZ} \ ${MIXMASTER_DIR}/*.touch