Skip to content
Snippets Groups Projects
Commit 21ec006f authored by Alexandre Julliard's avatar Alexandre Julliard
Browse files

Build Win32 resources as .res files and dump them into the .spec.c file.

parent 003e24ca
No related branches found
No related tags found
No related merge requests found
Showing
with 45 additions and 59 deletions
......@@ -16,7 +16,6 @@
# GLUE : C sources for which glue code needs to be generated
# EXTRA_SRCS : extra source files for make depend
# EXTRA_OBJS : extra object files
# WRCEXTRA : extra wrc flags (e.g. '-p _SysRes')
# SUBDIRS : subdirectories that contain a Makefile
# EXTRASUBDIRS : subdirectories that do not contain a Makefile
......@@ -55,10 +54,9 @@ LINT = @LINT@
LINTFLAGS = @LINTFLAGS@
ALLLINTFLAGS = $(LINTFLAGS) $(DEFS) $(OPTIONS) $(DIVINCL)
WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi_check/winapi_check
BUILD = $(TOPOBJDIR)/tools/winebuild/winebuild
WINEBUILD = $(TOPOBJDIR)/tools/winebuild/winebuild
MAKEDEP = $(TOPOBJDIR)/tools/makedep
WRC = $(TOPOBJDIR)/tools/wrc/wrc
WRCFLAGS = -c -s -p $*
WMC = $(TOPOBJDIR)/tools/wmc/wmc
DLLDIR = $(TOPOBJDIR)/dlls
@SET_MAKE@
......@@ -81,7 +79,7 @@ CLEAN_FILES = *.o *.a *.so *.ln \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \
*.flc *.spec.c *.glue.c y.tab.c y.tab.h lex.yy.c core
OBJS = $(SPEC_SRCS:.spec=.spec.o) $(C_SRCS:.c=.o) $(GEN_C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) \
$(ASM_SRCS:.S=.o) $(RC_SRCS:.rc=.o) $(GLUE:.c=.glue.o) $(EXTRA_OBJS)
$(ASM_SRCS:.S=.o) $(RC16_SRCS:.rc16=.o) $(GLUE:.c=.glue.o) $(EXTRA_OBJS)
LINTS = $(C_SRCS:.c=.ln)
......@@ -156,7 +154,7 @@ DLLS = \
# Implicit rules
.SUFFIXES: .mc .rc .res .spec .spec.c .spec.o .glue.c
.SUFFIXES: .mc .rc .rc16 .res .spec .spec.c .spec.o .glue.c
.c.o:
$(CC) -c $(ALLCFLAGS) -o $*.o $<
......@@ -173,26 +171,17 @@ DLLS = \
.mc.rc:
LD_LIBRARY_PATH="$(TOPOBJDIR):$$LD_LIBRARY_PATH" $(WMC) -i -H /dev/null -o $@ $<
.rc.s:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) $<
.rc.h:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -nh $<
.rc16.s:
LD_LIBRARY_PATH="$(TOPOBJDIR):$$LD_LIBRARY_PATH" $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -w16 -m -c -p `basename $*` -s $<
.rc.res:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -r $<
.res.s:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) -b $<
.res.h:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) -bnh $<
LD_LIBRARY_PATH="$(TOPOBJDIR):$$LD_LIBRARY_PATH" $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -r $<
.spec.spec.c:
$(BUILD) @DLLFLAGS@ -o $@ -spec $<
LD_LIBRARY_PATH="$(TOPOBJDIR):$$LD_LIBRARY_PATH" $(WINEBUILD) @DLLFLAGS@ -o $@ -spec $<
.c.glue.c:
$(BUILD) @DLLFLAGS@ -o $@ -glue $<
LD_LIBRARY_PATH="$(TOPOBJDIR):$$LD_LIBRARY_PATH" $(WINEBUILD) @DLLFLAGS@ -o $@ -glue $<
.c.ln:
$(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
......@@ -205,24 +194,28 @@ all: Makefile
# Rule to rebuild the resource compiler
$(WRC) check_wrc:
$(WRC):
cd $(TOPOBJDIR)/tools/wrc && $(MAKE) wrc
# Rule to rebuild the message compiler
$(WMC) check_wmc:
$(WMC):
cd $(TOPOBJDIR)/tools/wmc && $(MAKE) wmc
# Rule to rebuild the 'makedep' program
$(MAKEDEP) check_makedep:
$(MAKEDEP):
cd $(TOPOBJDIR)/tools && $(MAKE) makedep
# Rule to rebuild the 'winebuild' program
$(BUILD) check_winebuild:
$(WINEBUILD):
cd $(TOPOBJDIR)/tools/winebuild && $(MAKE) winebuild
# Rule for main module spec file
$(MODULE).spec.c: $(RC_SRCS:.rc=.res)
# Rules for makefile
Makefile: Makefile.in $(TOPSRCDIR)/configure
......@@ -260,8 +253,8 @@ winapi_check::
$(SUBDIRS:%=%/__depend__): $(MAKEDEP) dummy
cd `dirname $@` && $(MAKE) depend
depend: $(MAKEDEP) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS) $(GEN_C_SRCS) $(SUBDIRS:%=%/__depend__)
$(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS) -C. $(GEN_C_SRCS)
depend: $(MAKEDEP) $(C_SRCS) $(RC_SRCS) $(RC16_SRCS) $(EXTRA_SRCS) $(GEN_C_SRCS) $(SUBDIRS:%=%/__depend__)
$(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(RC16_SRCS) $(EXTRA_SRCS) -C. $(GEN_C_SRCS)
# Rules for cleaning
......@@ -272,7 +265,7 @@ $(EXTRASUBDIRS:%=%/__clean__): dummy
-cd `dirname $@` && $(RM) $(CLEAN_FILES)
clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
$(RM) $(CLEAN_FILES) $(GEN_C_SRCS) $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.s) $(RC_SRCS:.rc=.h) $(MC_SRCS:.mc=.rc) $(PROGRAMS)
$(RM) $(CLEAN_FILES) $(GEN_C_SRCS) $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.res) $(RC16_SRCS:.rc16=.s) $(MC_SRCS:.mc=.rc) $(PROGRAMS)
# Rules for installing
......@@ -284,11 +277,11 @@ $(SUBDIRS:%=%/__uninstall__): dummy
# Misc. rules
$(SPEC_SRCS:.spec=.spec.c): $(BUILD) $(TOPSRCDIR)/include/builtin16.h
$(SPEC_SRCS:.spec=.spec.c): $(WINEBUILD) $(TOPSRCDIR)/include/builtin16.h
$(GLUE:.c=.glue.c): $(BUILD) $(TOPSRCDIR)/include/builtin16.h
$(GLUE:.c=.glue.c): $(WINEBUILD) $(TOPSRCDIR)/include/builtin16.h
$(RC_SRCS:.rc=.s): $(WRC)
$(RC_SRCS:.rc=.res) $(RC16_SRCS:.rc16=.s): $(WRC)
$(MC_SRCS:.mc=.rc): $(WMC)
......
......@@ -2,4 +2,4 @@
*.spec.glue.s
Makefile
libcomctl32.so.1.0
rsrc.s
rsrc.res
......@@ -4,7 +4,6 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = comctl32
SOVERSION = 1.0
WRCEXTRA = -s -p$(MODULE)
IMPORTS = user32 gdi32 advapi32 kernel32
C_SRCS = \
......@@ -40,6 +39,4 @@ RC_SRCS= \
@MAKE_DLL_RULES@
all: check_wrc
### Dependencies:
name comctl32
type win32
init COMCTL32_LibMain
rsrc comctl32
rsrc rsrc.res
import user32.dll
import gdi32.dll
......
......@@ -2,4 +2,4 @@
*.spec.glue.s
Makefile
libcomdlg32.so.1.0
rsrc.s
rsrc.res
......@@ -6,7 +6,6 @@ MODULE = comdlg32
SOVERSION = 1.0
ALTNAMES = commdlg
IMPORTS = shell32 shlwapi comctl32 user32 winspool.drv gdi32 kernel32
WRCEXTRA = -s -pcomdlg32
C_SRCS = \
cdlg32.c \
......@@ -26,6 +25,4 @@ RC_SRCS= \
@MAKE_DLL_RULES@
all: check_wrc
### Dependencies:
name comdlg32
type win32
init COMDLG32_DllEntryPoint
rsrc comdlg32
rsrc rsrc.res
import shell32.dll
import shlwapi.dll
......
*.spec.c
Makefile
kernel.s
kernel.res
libkernel32.so.1.0
utthunk.glue.c
......@@ -34,6 +34,6 @@ EXTRASUBDIRS = \
@MAKE_DLL_RULES@
depend $(RC_SRCS:.rc=.s): $(MC_SRCS:.mc=.rc)
depend $(RC_SRCS:.rc=.res): $(MC_SRCS:.mc=.rc)
### Dependencies:
name kernel32
type win32
init MAIN_KernelInit
rsrc kernel
rsrc kernel.res
import ntdll.dll
......
......@@ -3,4 +3,4 @@
Makefile
libmsacm.so.1.0
libmsacm32.so.1.0
msacm.s
msacm.res
name msacm32
type win32
init MSACM32_LibMain
rsrc msacm
rsrc msacm.res
import winmm.dll
import user32.dll
......
Makefile
libserialui.so.1.0
serialui.spec.c
serialui_rc.s
serialui_rc.res
name serialui
type win32
init SERIALUI_LibMain
rsrc serialui_rc
rsrc serialui_rc.res
import user32.dll
import advapi32.dll
......
......@@ -2,4 +2,4 @@
*.spec.glue.s
Makefile
libshell32.so.1.0
shres.s
shres.res
......@@ -42,7 +42,5 @@ RC_SRCS= \
@MAKE_DLL_RULES@
all: check_wrc
### Dependencies:
name shell32
type win32
init Shell32LibMain
rsrc shres
rsrc shres.res
# fixme: avoid this import
import ole32.dll
......
......@@ -4,7 +4,6 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = user32
SOVERSION = 1.0
WRCEXTRA = -w16 -m
ALTNAMES = user keyboard ddeml display mouse
IMPORTS = gdi32 advapi32 kernel32
......@@ -23,26 +22,28 @@ C_SRCS = \
thunk.c \
user_main.c
RC_SRCS = \
disp.rc \
mouserc.rc
RC16_SRCS = \
resources/display.rc16 \
resources/mouse.rc16
RC_SRCS = resources/user32.rc
GLUE = thunk.c
EXTRA_OBJS = \
$(TOPOBJDIR)/controls/controls.o \
$(TOPOBJDIR)/resources/resources.o \
$(TOPOBJDIR)/windows/windows.o
SUBDIRS = \
$(TOPOBJDIR)/controls \
$(TOPOBJDIR)/resources \
$(TOPOBJDIR)/windows
EXTRASUBDIRS = \
resources
@MAKE_DLL_RULES@
$(EXTRA_OBJS): $(TOOLSUBDIRS) dummy
@cd `dirname $@` && $(MAKE) `basename $@`
### Dependencies:
name display
type win16
owner user32
rsrc disp
rsrc display
1 stub BitBlt
2 stub ColorInfo
......
name mouse
type win16
owner user32
rsrc mouserc
rsrc mouse
1 pascal16 Inquire(ptr) MOUSE_Inquire
2 pascal16 Enable(segptr) WIN16_MOUSE_Enable
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment