BOOST_DIR = ../boost_$(BOOST_VER)_0($(MAYU_ARCH))
-# yamy.exe ###############################################################
+# yamy ###############################################################
-TARGET_1 = $(OUT_DIR_EXE)\yamy$(MAYU_ARCH).exe
+TARGET_1 = $(OUT_DIR_EXE)\yamy$(MAYU_ARCH)
OBJS_1 = \
$(OUT_DIR)\compiler_specific_func.obj \
$(OUT_DIR)\dlgeditsetting.obj \
EXTRADEP_4 = $(OUT_DIR_EXE)\yamy$(MAYU_ARCH).lib
!endif
+# yamy.exe ###############################################################
+
+!if "$(MAYU_ARCH)" == "32"
+TARGET_5 = $(OUT_DIR_EXE)\yamy.exe
+OBJS_5 = $(OUT_DIR)\yamy.obj
+
+SRCS_5 = yamy.cpp
+LIBS_5 = user32.lib
+
+RES_5 = $(OUT_DIR)\mayu.res
+!endif
+
# distribution ###############################################################
DISTRIB_SETTINGS = \
$(TARGET_1) \
$(TARGET_2) \
$(TARGET_4) \
+ $(TARGET_5) \
s\$(OUT_DIR)\setup.exe \
$(DISTRIB_SETTINGS) \
$(DISTRIB_MANUAL) \
# rules ###############################################################
-all: boost $(OUT_DIR) $(OUT_DIR_EXE) $(TARGET_1) $(TARGET_2) $(TARGET_3) $(TARGET_4)
+all: boost $(OUT_DIR) $(OUT_DIR_EXE) $(TARGET_1) $(TARGET_2) $(TARGET_3) $(TARGET_4) $(TARGET_5)
$(OUT_DIR):
if not exist "$(OUT_DIR)\\" $(MKDIR) $(OUT_DIR)
$(MAKEFUNC) < engine.h > functions.h
clean::
- -$(RM) $(TARGET_1) $(TARGET_2) $(TARGET_3) $(TARGET_4)
+ -$(RM) $(TARGET_1) $(TARGET_2) $(TARGET_3) $(TARGET_4) $(TARGET_5)
-$(RM) $(OUT_DIR)\*.obj
-$(RM) $(OUT_DIR)\*.res $(OUT_DIR_EXE)\*.exp
-$(RM) mayu.aps mayu.opt $(OUT_DIR_EXE)\*.pdb
distrib:
-@echo "we need cygwin tool"
-rm -f yamy-$(VERSION).zip
- zip yamy-$(VERSION).zip 104.mayu 109.mayu default.mayu emacsedit.mayu 104on109.mayu 109on104.mayu dot.mayu yamy.ini
+ zip yamy-$(VERSION).zip yamy.ini 104.mayu 109.mayu default.mayu emacsedit.mayu 104on109.mayu 109on104.mayu dot.mayu workaround.mayu
cd $(OUT_DIR_EXE)
- zip ../yamy-$(VERSION).zip yamy32.exe yamy64.exe yamy32.dll yamy64.dll yamyd32
+ zip ../yamy-$(VERSION).zip yamy.exe yamy32 yamy64 yamy32.dll yamy64.dll yamyd32
cd ..
srcdesc::
LDFLAGS_4 = \
$(guilflags) \
/PDB:$(TARGET_4).pdb \
- /LIBPATH:$(BOOST_DIR)/libs/regex/build/$(MAYU_REGEX_VC)0 \
+
+LDFLAGS_5 = \
+ $(guilflags) \
+ /PDB:$(TARGET_5).pdb \
$(TARGET_1): $(OBJS_1) $(RES_1) $(EXTRADEP_1)
$(link) -out:$@ $(ldebug) $(LDFLAGS_1) $(OBJS_1) $(LIBS_1) $(RES_1)
!if "$(MAYU_ARCH)" == "32"
$(TARGET_4): $(OBJS_4) $(EXTRADEP_4)
$(link) -out:$@ $(ldebug) $(LDFLAGS_4) $(OBJS_4) $(LIBS_4)
+
+$(TARGET_5): $(OBJS_5) $(EXTRADEP_5)
+ $(link) -out:$@ $(ldebug) $(LDFLAGS_5) $(OBJS_5) $(LIBS_5) $(RES_5)
!endif
REGEXPP_XCFLAGS = $(REGEXPP_XCFLAGS) XCFLAGS=-D_WCTYPE_INLINE_DEFINED
IDS_mayuFile "YAMY\83t\83@\83C\83\8b"\r
IDS_mayuShellOpen "notepad.exe ""%1"""\r
IDS_readFromHomeDirectory "(\83z\81[\83\80\83f\83B\83\8c\83N\83g\83\8a\82©\82ç)"\r
+ IDS_cannotInvoke "%s \82ð\8bN\93®\82Å\82«\82Ü\82¹\82ñ(0x%08x)"\r
END\r
\r
STRINGTABLE DISCARDABLE \r
IDS_mayuFile "YAMY file"\r
IDS_mayuShellOpen "notepad.exe ""%1"""\r
IDS_readFromHomeDirectory "(from home directory)"\r
+ IDS_cannotInvoke "can't invoke %s(0x%08x)"\r
END\r
\r
STRINGTABLE DISCARDABLE \r
#define IDS_mayuSymbols 27\r
#define IDS_version 28\r
#define IDS_homepage 29\r
+#define IDS_cannotInvoke 30\r
#define IDC_CURSOR_target 101\r
#define IDD_DIALOG_editSetting 102\r
#define IDD_DIALOG_investigate 103\r
--- /dev/null
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// yamy.cpp
+
+#include <windows.h>
+#include <tchar.h>
+#include "mayurc.h"
+
+/// main
+int WINAPI _tWinMain(HINSTANCE i_hInstance, HINSTANCE /* i_hPrevInstance */,
+ LPTSTR /* i_lpszCmdLine */, int /* i_nCmdShow */)
+{
+ typedef BOOL (WINAPI* ISWOW64PROCESS)(HANDLE hProcess, PBOOL Wow64Process);
+ BOOL isWow64;
+ ISWOW64PROCESS pIsWow64Process;
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ BOOL result;
+ TCHAR *yamyPath = _T("yamy32");
+
+ pIsWow64Process =
+ (ISWOW64PROCESS)::GetProcAddress(::GetModuleHandle(_T("kernel32.dll")),
+ "IsWow64Process");
+ ZeroMemory(&pi,sizeof(pi));
+ ZeroMemory(&si,sizeof(si));
+ si.cb=sizeof(si);
+
+ if (pIsWow64Process)
+ {
+ result = pIsWow64Process(::GetCurrentProcess(), &isWow64);
+ if (result != FALSE && isWow64 == TRUE)
+ {
+ yamyPath = _T("yamy64");
+ }
+ }
+
+ result = CreateProcess(yamyPath, yamyPath, NULL, NULL, FALSE,
+ NORMAL_PRIORITY_CLASS, 0, NULL, &si, &pi);
+
+ if (result == FALSE)
+ {
+ TCHAR buf[1024];
+ TCHAR text[1024];
+ TCHAR title[1024];
+
+ LoadString(i_hInstance, IDS_cannotInvoke,
+ text, sizeof(text)/sizeof(text[0]));
+ LoadString(i_hInstance, IDS_mayu,
+ title, sizeof(title)/sizeof(title[0]));
+ _stprintf_s(buf, sizeof(buf)/sizeof(buf[0]),
+ text, yamyPath, GetLastError());
+ MessageBox((HWND)NULL, buf, title, MB_OK | MB_ICONSTOP);
+ }
+ else
+ {
+ CloseHandle(pi.hThread);
+ CloseHandle(pi.hProcess);
+ }
+
+ return 0;
+}