mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
Build test programs as .so files. Added missing imports.
This commit is contained in:
parent
591832ec2e
commit
8d5ace308b
13 changed files with 128 additions and 75 deletions
|
@ -1,10 +1,24 @@
|
||||||
DEFS = -DWINELIB -DSTRICT
|
DEFS = @DLLFLAGS@ -DSTRICT
|
||||||
|
LDDLLFLAGS = @LDDLLFLAGS@
|
||||||
TOPSRCDIR = @top_srcdir@
|
TOPSRCDIR = @top_srcdir@
|
||||||
TOPOBJDIR = ..
|
TOPOBJDIR = ..
|
||||||
SRCDIR = @srcdir@
|
SRCDIR = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
MODULE = none
|
MODULE = none
|
||||||
PROGRAMS = expand hello hello2 hello3 hello4 hello5 new rolex vartest volinfo
|
PROGRAMS = expand hello hello2 hello3 hello4 hello5 new rolex vartest volinfo
|
||||||
|
ALL_LIBS = -L$(TOPOBJDIR) -lwine $(LIBS)
|
||||||
|
|
||||||
|
C_SRCS = \
|
||||||
|
expand.c \
|
||||||
|
hello.c \
|
||||||
|
hello2.c \
|
||||||
|
hello3.c \
|
||||||
|
hello4.c \
|
||||||
|
hello5.c \
|
||||||
|
new.c \
|
||||||
|
rolex.c \
|
||||||
|
vartest.c \
|
||||||
|
volinfo.c
|
||||||
|
|
||||||
SPEC_SRCS = \
|
SPEC_SRCS = \
|
||||||
expand.spec \
|
expand.spec \
|
||||||
|
@ -21,40 +35,66 @@ SPEC_SRCS = \
|
||||||
RC_SRCS = \
|
RC_SRCS = \
|
||||||
hello3res.rc
|
hello3res.rc
|
||||||
|
|
||||||
all: $(PROGRAMS)
|
all: $(PROGRAMS) $(PROGRAMS:%=%.so)
|
||||||
|
|
||||||
@MAKE_RULES@
|
@MAKE_RULES@
|
||||||
|
|
||||||
expand: expand.o expand.spec.o
|
expand.spec.c: expand.spec expand.o $(WINEBUILD)
|
||||||
$(CC) -o expand $+ -L$(DLLDIR) -llz32 -lntdll $(DLL_LINK) $(LIBS)
|
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym expand.o -o expand.spec.c -spec expand.spec
|
||||||
|
expand.so: expand.o expand.spec.o
|
||||||
|
$(LDSHARED) $(LDDLLFLAGS) -o expand.so $+ $(ALL_LIBS)
|
||||||
|
|
||||||
hello: hello.o hello.spec.o
|
hello.spec.c: hello.spec hello.o $(WINEBUILD)
|
||||||
$(CC) -o hello $+ -L$(DLLDIR) -luser32 -lgdi32 -lkernel32 -lntdll $(DLL_LINK) $(LIBS)
|
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym hello.o -o hello.spec.c -spec hello.spec
|
||||||
|
hello.so: hello.o hello.spec.o
|
||||||
|
$(LDSHARED) $(LDDLLFLAGS) -o hello.so $+ $(ALL_LIBS)
|
||||||
|
|
||||||
hello2: hello2.o hello2.spec.o
|
hello2.spec.c: hello2.spec hello2.o $(WINEBUILD)
|
||||||
$(CC) -o hello2 $+ -L$(DLLDIR) -luser32 -lgdi32 -lkernel32 -lntdll $(DLL_LINK) $(LIBS)
|
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym hello2.o -o hello2.spec.c -spec hello2.spec
|
||||||
|
hello2.so: hello2.o hello2.spec.o
|
||||||
|
$(LDSHARED) $(LDDLLFLAGS) -o hello2.so $+ $(ALL_LIBS)
|
||||||
|
|
||||||
hello3: hello3.o hello3.spec.o
|
hello3.spec.c: hello3.spec hello3.o hello3res.res $(WINEBUILD)
|
||||||
$(CC) -o hello3 $+ -L$(DLLDIR) -ladvapi32 -lcomctl32 -lcomdlg32 -lgdi32 -lkernel32 -lole32 -lrpcrt4 -lshell32 -lshlwapi -luser32 -lwinspool.drv -lntdll $(DLL_LINK) $(LIBS)
|
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym hello3.o -o hello3.spec.c -spec hello3.spec
|
||||||
|
hello3.so: hello3.o hello3.spec.o
|
||||||
|
$(LDSHARED) $(LDDLLFLAGS) -o hello3.so $+ $(ALL_LIBS)
|
||||||
|
|
||||||
hello3.spec.c: hello3res.res
|
hello4.spec.c: hello4.spec hello4.o $(WINEBUILD)
|
||||||
|
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym hello4.o -o hello4.spec.c -spec hello4.spec
|
||||||
|
hello4.so: hello4.o hello4.spec.o
|
||||||
|
$(LDSHARED) $(LDDLLFLAGS) -o hello4.so $+ $(ALL_LIBS)
|
||||||
|
|
||||||
hello4: hello4.o hello4.spec.o
|
hello5.spec.c: hello5.spec hello5.o $(WINEBUILD)
|
||||||
$(CC) -o hello4 $+ -L$(DLLDIR) -luser32 -lgdi32 -lkernel32 -lntdll $(DLL_LINK) $(LIBS)
|
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym hello5.o -o hello5.spec.c -spec hello5.spec
|
||||||
|
hello5.so: hello5.o hello5.spec.o
|
||||||
|
$(LDSHARED) $(LDDLLFLAGS) -o hello5.so $+ $(ALL_LIBS)
|
||||||
|
|
||||||
hello5: hello5.o hello5.spec.o
|
new.spec.c: new.spec new.o $(WINEBUILD)
|
||||||
$(CC) -o hello5 $+ -L$(DLLDIR) -lntdll $(DLL_LINK) $(LIBS)
|
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym new.o -o new.spec.c -spec new.spec
|
||||||
|
new.so: new.o new.spec.o
|
||||||
|
$(LDSHARED) $(LDDLLFLAGS) -o new.so $+ $(ALL_LIBS)
|
||||||
|
|
||||||
new: new.o new.spec.o
|
rolex.spec.c: rolex.spec rolex.o $(WINEBUILD)
|
||||||
$(CC) -o new $+ -L$(DLLDIR) -luser32 -lgdi32 -lkernel32 -lntdll $(DLL_LINK) $(LIBS)
|
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym rolex.o -o rolex.spec.c -spec rolex.spec
|
||||||
|
rolex.so: rolex.o rolex.spec.o
|
||||||
|
$(LDSHARED) $(LDDLLFLAGS) -o rolex.so $+ $(ALL_LIBS)
|
||||||
|
|
||||||
rolex: rolex.o rolex.spec.o
|
vartest.spec.c: vartest.spec vartest.o $(WINEBUILD)
|
||||||
$(CC) -o rolex $+ -L$(DLLDIR) -luser32 -lgdi32 -lkernel32 -lntdll $(DLL_LINK) $(LIBS)
|
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym vartest.o -o vartest.spec.c -spec vartest.spec
|
||||||
|
vartest.so: vartest.o vartest.spec.o
|
||||||
|
$(LDSHARED) $(LDDLLFLAGS) -o vartest.so $+ $(ALL_LIBS)
|
||||||
|
|
||||||
vartest: vartest.o vartest.spec.o
|
volinfo.spec.c: volinfo.spec volinfo.o $(WINEBUILD)
|
||||||
$(CC) -o vartest $+ -L$(DLLDIR) -ladvapi32 -lcomctl32 -lgdi32 -lkernel32 -lole32 -loleaut32 -lrpcrt4 -luser32 -lntdll $(DLL_LINK) $(LIBS)
|
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L $(DLLDIR) -sym volinfo.o -o volinfo.spec.c -spec volinfo.spec
|
||||||
|
volinfo.so: volinfo.o volinfo.spec.o
|
||||||
|
$(LDSHARED) $(LDDLLFLAGS) -o volinfo.so $+ $(ALL_LIBS)
|
||||||
|
|
||||||
volinfo: volinfo.o volinfo.spec.o
|
$(PROGRAMS):
|
||||||
$(CC) -o volinfo $+ -L$(DLLDIR) -lntdll $(DLL_LINK) $(LIBS)
|
$(LN_S) $(TOPOBJDIR)/wine $@
|
||||||
|
|
||||||
|
$(PROGRAMS:%=%.so/_checklink_): $(PROGRAMS:%=%.so)
|
||||||
|
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c `dirname $@` $(ALL_LIBS) && $(RM) checklink
|
||||||
|
|
||||||
|
checklink:: $(PROGRAMS:%=%.so/_checklink_)
|
||||||
|
|
||||||
### Dependencies:
|
### Dependencies:
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
name expand
|
name expand
|
||||||
mode guiexe
|
mode guiexe
|
||||||
type win32
|
type win32
|
||||||
init WinMain
|
|
||||||
|
import lz32.dll
|
||||||
|
import kernel32.dll
|
||||||
|
import ntdll.dll
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
name hello
|
name hello
|
||||||
mode guiexe
|
mode guiexe
|
||||||
type win32
|
type win32
|
||||||
init WinMain
|
|
||||||
|
import user32.dll
|
||||||
|
import gdi32.dll
|
||||||
|
import kernel32.dll
|
||||||
|
import ntdll.dll
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
name hello2
|
name hello2
|
||||||
mode guiexe
|
mode guiexe
|
||||||
type win32
|
type win32
|
||||||
init WinMain
|
|
||||||
|
import user32.dll
|
||||||
|
import kernel32.dll
|
||||||
|
import ntdll.dll
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
name hello3
|
name hello3
|
||||||
mode guiexe
|
mode guiexe
|
||||||
type win32
|
type win32
|
||||||
init WinMain
|
|
||||||
rsrc hello3res.res
|
rsrc hello3res.res
|
||||||
|
|
||||||
|
import comdlg32.dll
|
||||||
|
import user32.dll
|
||||||
|
import gdi32.dll
|
||||||
|
import kernel32.dll
|
||||||
|
import ntdll.dll
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/* even in MS Visual C++ */
|
/* even in MS Visual C++ */
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
#include "wingdi.h"
|
#include "wingdi.h"
|
||||||
#include <wine/winuser16.h>
|
/*#include <wine/winuser16.h>*/
|
||||||
|
|
||||||
void Write (HDC dc, int x, int y, char *s)
|
void Write (HDC dc, int x, int y, char *s)
|
||||||
{
|
{
|
||||||
|
@ -86,7 +86,7 @@ LRESULT CALLBACK WndProc2 (HWND wnd, UINT msg, WPARAM w, LPARAM l)
|
||||||
case WM_MOVE:
|
case WM_MOVE:
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
InvalidateRect( wnd, &rectInfo, TRUE );
|
InvalidateRect( wnd, &rectInfo, TRUE );
|
||||||
CalcChildScroll16( (UINT16)GetParent(wnd), SB_BOTH );
|
/*CalcChildScroll16( (UINT16)GetParent(wnd), SB_BOTH );*/
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
name hello4
|
name hello4
|
||||||
mode guiexe
|
mode guiexe
|
||||||
type win32
|
type win32
|
||||||
init WinMain
|
|
||||||
|
import user32.dll
|
||||||
|
import gdi32.dll
|
||||||
|
import kernel32.dll
|
||||||
|
import ntdll.dll
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
name hello5
|
name hello5
|
||||||
mode guiexe
|
mode guiexe
|
||||||
type win32
|
type win32
|
||||||
init WinMain
|
|
||||||
|
import kernel32.dll
|
||||||
|
import ntdll.dll
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
name new
|
name new
|
||||||
mode guiexe
|
mode guiexe
|
||||||
type win32
|
type win32
|
||||||
init WinMain
|
|
||||||
|
import user32.dll
|
||||||
|
import gdi32.dll
|
||||||
|
import kernel32.dll
|
||||||
|
import ntdll.dll
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
name rolex
|
name rolex
|
||||||
mode guiexe
|
mode guiexe
|
||||||
type win32
|
type win32
|
||||||
init WinMain
|
|
||||||
|
import user32.dll
|
||||||
|
import gdi32.dll
|
||||||
|
import kernel32.dll
|
||||||
|
import ntdll.dll
|
||||||
|
|
|
@ -56,49 +56,27 @@
|
||||||
|
|
||||||
#include <windef.h>
|
#include <windef.h>
|
||||||
|
|
||||||
#ifdef __unix__
|
|
||||||
#include <debugtools.h>
|
|
||||||
extern LPWSTR HEAP_strdupAtoW( HANDLE heap, DWORD flags, LPCSTR str );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
#define MAX_BUFFER 1024
|
||||||
|
|
||||||
static const int MAX_BUFFER = 1024;
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __unix__
|
|
||||||
char* WtoA( OLECHAR* p )
|
char* WtoA( OLECHAR* p )
|
||||||
{
|
{
|
||||||
int i = 0;
|
static char buffer[MAX_BUFFER];
|
||||||
char* pc = (char *)malloc( MAX_BUFFER*sizeof(char) );
|
DWORD len = WideCharToMultiByte( CP_ACP, 0, p, -1, buffer+1, sizeof(buffer)-3, NULL, NULL );
|
||||||
pc[0] = '\"';
|
buffer[0] = '\"';
|
||||||
pc++;
|
buffer[len] = '\"';
|
||||||
i = wcstombs( pc, p, MAX_BUFFER );
|
buffer[len+1] = 0;
|
||||||
if( i < MAX_BUFFER-1 )
|
return buffer;
|
||||||
{
|
|
||||||
pc[i] = '\"';
|
|
||||||
pc[i+1] = '\0';
|
|
||||||
}
|
|
||||||
pc--;
|
|
||||||
return pc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OLECHAR* AtoW( char* p )
|
OLECHAR* AtoW( char* p )
|
||||||
{
|
{
|
||||||
int i = 0;
|
OLECHAR *buffer;
|
||||||
OLECHAR* pwc = (OLECHAR *)malloc( MAX_BUFFER*sizeof(OLECHAR) );
|
DWORD len = MultiByteToWideChar( CP_ACP, 0, p, -1, NULL, 0 );
|
||||||
i = mbstowcs( pwc, p, MAX_BUFFER );
|
buffer = malloc( len * sizeof(OLECHAR) );
|
||||||
return pwc;
|
MultiByteToWideChar( CP_ACP, 0, p, -1, buffer, len );
|
||||||
|
return buffer;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
char* WtoA( OLECHAR* p )
|
|
||||||
{
|
|
||||||
return debugstr_wn( p, MAX_BUFFER );
|
|
||||||
}
|
|
||||||
OLECHAR* AtoW( char* p )
|
|
||||||
{
|
|
||||||
return HEAP_strdupAtoW( GetProcessHeap(), 0, p );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
name vartest
|
name vartest
|
||||||
mode guiexe
|
mode guiexe
|
||||||
type win32
|
type win32
|
||||||
init WinMain
|
|
||||||
|
import oleaut32.dll
|
||||||
|
import kernel32.dll
|
||||||
|
import ntdll.dll
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
name volinfo
|
name volinfo
|
||||||
mode guiexe
|
mode guiexe
|
||||||
type win32
|
type win32
|
||||||
init WinMain
|
|
||||||
|
import kernel32.dll
|
||||||
|
import ntdll.dll
|
||||||
|
|
Loading…
Reference in a new issue