MINGW_DIR=../../MinGW
GPP=wine "${MINGW_DIR}"/bin/mingw32-g++
CXXFLAGS=-O2 -I"${MINGW_DIR}"/wx/include
LIBS_BASE=-mwindows -s -static-libstdc++ -static-libgcc
LDFLAGS=${LIBS_BASE} -L"${MINGW_DIR}"/wx/lib -lwxmsw28_stc -lwxmsw28_aui -lwxmsw28_html -lwxmsw28_core -lwxbase28_net -lwxbase28 -lwxmsw28_adv -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregex -lwxexpat -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32 -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool 
OBJS_DIR=../../release.w32/complement

all: ${OBJS_DIR}  ../../bin/complement_wrap.exe ../../bin/complement.exe

include Makefile.common

${OBJS_DIR}:
	mkdir ${OBJS_DIR}

${OBJS_DIR}/resources_normal.o: resources_normal.rc manifest_normal.xml
	wine "${MINGW_DIR}"/bin/windres -i resources_normal.rc -o $@

${OBJS_DIR}/resources_root.o: resources_root.rc manifest_root.xml
	wine "${MINGW_DIR}"/bin/windres -i resources_root.rc -o $@

../../bin/complement.exe: ${OBJS_DIR} ${OBJS} ${OBJS_DIR}/resources_normal.o
	${GPP} ${OBJS} ${LDFLAGS} ${OBJS_DIR}/resources_normal.o -o $@

../../bin/complement_wrap.exe: ${OBJS_DIR}/resources_root.o complement_wrap.cpp
	${GPP} ${LIBS_BASE} complement_wrap.cpp ${OBJS_DIR}/resources_root.o -o $@

clean:
	rm -rf ${OBJS} ../../bin/complement.exe ../../bin/complement_wrap.exe ${OBJS_DIR}/resources_normal.o ${OBJS_DIR}/resources_root.o

