diff --git a/Make.rules.in b/Make.rules.in index 644811e7606..8ff56390dc1 100644 --- a/Make.rules.in +++ b/Make.rules.in @@ -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) diff --git a/dlls/comctl32/.cvsignore b/dlls/comctl32/.cvsignore index 5134e4ca344..6ae9a077f27 100644 --- a/dlls/comctl32/.cvsignore +++ b/dlls/comctl32/.cvsignore @@ -2,4 +2,4 @@ *.spec.glue.s Makefile libcomctl32.so.1.0 -rsrc.s +rsrc.res diff --git a/dlls/comctl32/Makefile.in b/dlls/comctl32/Makefile.in index 193ab095468..19490e138f3 100644 --- a/dlls/comctl32/Makefile.in +++ b/dlls/comctl32/Makefile.in @@ -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: diff --git a/dlls/comctl32/comctl32.spec b/dlls/comctl32/comctl32.spec index 6b20abc10fb..2cd1bbef364 100644 --- a/dlls/comctl32/comctl32.spec +++ b/dlls/comctl32/comctl32.spec @@ -1,7 +1,7 @@ name comctl32 type win32 init COMCTL32_LibMain -rsrc comctl32 +rsrc rsrc.res import user32.dll import gdi32.dll diff --git a/dlls/commdlg/.cvsignore b/dlls/commdlg/.cvsignore index 1b957094a42..8231de2ecf2 100644 --- a/dlls/commdlg/.cvsignore +++ b/dlls/commdlg/.cvsignore @@ -2,4 +2,4 @@ *.spec.glue.s Makefile libcomdlg32.so.1.0 -rsrc.s +rsrc.res diff --git a/dlls/commdlg/Makefile.in b/dlls/commdlg/Makefile.in index dcf0854e625..029ecb9c3d1 100644 --- a/dlls/commdlg/Makefile.in +++ b/dlls/commdlg/Makefile.in @@ -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: diff --git a/dlls/commdlg/comdlg32.spec b/dlls/commdlg/comdlg32.spec index b4cbeb5187b..e63af388b75 100644 --- a/dlls/commdlg/comdlg32.spec +++ b/dlls/commdlg/comdlg32.spec @@ -1,7 +1,7 @@ name comdlg32 type win32 init COMDLG32_DllEntryPoint -rsrc comdlg32 +rsrc rsrc.res import shell32.dll import shlwapi.dll diff --git a/dlls/kernel/.cvsignore b/dlls/kernel/.cvsignore index 5c16c63379f..9873ff06484 100644 --- a/dlls/kernel/.cvsignore +++ b/dlls/kernel/.cvsignore @@ -1,5 +1,5 @@ *.spec.c Makefile -kernel.s +kernel.res libkernel32.so.1.0 utthunk.glue.c diff --git a/dlls/kernel/Makefile.in b/dlls/kernel/Makefile.in index 7d0ec924080..d4f3c42ca1b 100644 --- a/dlls/kernel/Makefile.in +++ b/dlls/kernel/Makefile.in @@ -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: diff --git a/dlls/kernel/kernel32.spec b/dlls/kernel/kernel32.spec index 8c01816cce9..9ec04762b93 100644 --- a/dlls/kernel/kernel32.spec +++ b/dlls/kernel/kernel32.spec @@ -1,7 +1,7 @@ name kernel32 type win32 init MAIN_KernelInit -rsrc kernel +rsrc kernel.res import ntdll.dll diff --git a/dlls/msacm/.cvsignore b/dlls/msacm/.cvsignore index 4be7f8b0540..4a5bd72cbe7 100644 --- a/dlls/msacm/.cvsignore +++ b/dlls/msacm/.cvsignore @@ -3,4 +3,4 @@ Makefile libmsacm.so.1.0 libmsacm32.so.1.0 -msacm.s +msacm.res diff --git a/dlls/msacm/msacm32.spec b/dlls/msacm/msacm32.spec index 13e297c3adf..6c2b7820498 100644 --- a/dlls/msacm/msacm32.spec +++ b/dlls/msacm/msacm32.spec @@ -1,7 +1,7 @@ name msacm32 type win32 init MSACM32_LibMain -rsrc msacm +rsrc msacm.res import winmm.dll import user32.dll diff --git a/dlls/serialui/.cvsignore b/dlls/serialui/.cvsignore index ce9997d6a63..2492d953f72 100644 --- a/dlls/serialui/.cvsignore +++ b/dlls/serialui/.cvsignore @@ -1,4 +1,4 @@ Makefile libserialui.so.1.0 serialui.spec.c -serialui_rc.s +serialui_rc.res diff --git a/dlls/serialui/serialui.spec b/dlls/serialui/serialui.spec index c6d3d067b79..65014da67f5 100644 --- a/dlls/serialui/serialui.spec +++ b/dlls/serialui/serialui.spec @@ -1,7 +1,7 @@ name serialui type win32 init SERIALUI_LibMain -rsrc serialui_rc +rsrc serialui_rc.res import user32.dll import advapi32.dll diff --git a/dlls/shell32/.cvsignore b/dlls/shell32/.cvsignore index a904018808e..52d8c78cc3b 100644 --- a/dlls/shell32/.cvsignore +++ b/dlls/shell32/.cvsignore @@ -2,4 +2,4 @@ *.spec.glue.s Makefile libshell32.so.1.0 -shres.s +shres.res diff --git a/dlls/shell32/Makefile.in b/dlls/shell32/Makefile.in index 2cdb32e3c64..abe912809cb 100644 --- a/dlls/shell32/Makefile.in +++ b/dlls/shell32/Makefile.in @@ -42,7 +42,5 @@ RC_SRCS= \ @MAKE_DLL_RULES@ -all: check_wrc - ### Dependencies: diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec index b508da6c0cf..76ed32261e0 100644 --- a/dlls/shell32/shell32.spec +++ b/dlls/shell32/shell32.spec @@ -1,7 +1,7 @@ name shell32 type win32 init Shell32LibMain -rsrc shres +rsrc shres.res # fixme: avoid this import import ole32.dll diff --git a/dlls/user/Makefile.in b/dlls/user/Makefile.in index cb7d1045f5d..3f51237607e 100644 --- a/dlls/user/Makefile.in +++ b/dlls/user/Makefile.in @@ -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: - diff --git a/dlls/user/display.spec b/dlls/user/display.spec index d1f0ecac644..fa03cf1022b 100644 --- a/dlls/user/display.spec +++ b/dlls/user/display.spec @@ -1,7 +1,7 @@ name display type win16 owner user32 -rsrc disp +rsrc display 1 stub BitBlt 2 stub ColorInfo diff --git a/dlls/user/mouse.spec b/dlls/user/mouse.spec index 06e31f99fc3..132e27e1974 100644 --- a/dlls/user/mouse.spec +++ b/dlls/user/mouse.spec @@ -1,7 +1,7 @@ name mouse type win16 owner user32 -rsrc mouserc +rsrc mouse 1 pascal16 Inquire(ptr) MOUSE_Inquire 2 pascal16 Enable(segptr) WIN16_MOUSE_Enable diff --git a/dlls/user/resources/.cvsignore b/dlls/user/resources/.cvsignore new file mode 100644 index 00000000000..55589a2b3e1 --- /dev/null +++ b/dlls/user/resources/.cvsignore @@ -0,0 +1,3 @@ +display.s +mouse.s +user32.res diff --git a/dlls/user/user32.spec b/dlls/user/user32.spec index 48680191bf4..f7461d6cfb8 100644 --- a/dlls/user/user32.spec +++ b/dlls/user/user32.spec @@ -1,7 +1,7 @@ name user32 type win32 init USER_Init -rsrc user32 +rsrc resources/user32.res import gdi32.dll import advapi32.dll diff --git a/dlls/wineps/.cvsignore b/dlls/wineps/.cvsignore index 0ebc2b72d9b..20564a9364d 100644 --- a/dlls/wineps/.cvsignore +++ b/dlls/wineps/.cvsignore @@ -1,5 +1,5 @@ Makefile libwineps.so.1.0 -rsrc.s +rsrc.res wineps.spec.c wineps16.spec.c diff --git a/dlls/wineps/Makefile.in b/dlls/wineps/Makefile.in index 6baacb4f418..3437aebc181 100644 --- a/dlls/wineps/Makefile.in +++ b/dlls/wineps/Makefile.in @@ -5,7 +5,6 @@ VPATH = @srcdir@ MODULE = wineps SOVERSION = 1.0 ALTNAMES = wineps16 -WRCEXTRA = -s -pwineps IMPORTS = user32 gdi32 kernel32 C_SRCS = \ diff --git a/dlls/wineps/wineps.spec b/dlls/wineps/wineps.spec index 6b0ab5c1912..17053e3b0c4 100644 --- a/dlls/wineps/wineps.spec +++ b/dlls/wineps/wineps.spec @@ -1,7 +1,7 @@ name wineps type win32 init PSDRV_Init -rsrc wineps +rsrc rsrc.res import user32.dll import gdi32.dll diff --git a/dlls/winmm/.cvsignore b/dlls/winmm/.cvsignore index 9231b6a655d..f1a60649415 100644 --- a/dlls/winmm/.cvsignore +++ b/dlls/winmm/.cvsignore @@ -3,4 +3,4 @@ *.spec.glue.s Makefile libwinmm.so.1.0 -winmm_res.s +winmm_res.res diff --git a/dlls/winmm/Makefile.in b/dlls/winmm/Makefile.in index e9907b5f3fa..5448f6357e9 100644 --- a/dlls/winmm/Makefile.in +++ b/dlls/winmm/Makefile.in @@ -36,6 +36,4 @@ SUBDIRS = \ @MAKE_DLL_RULES@ -all: check_wrc - ### Dependencies: diff --git a/dlls/winmm/winmm.spec b/dlls/winmm/winmm.spec index 68446516520..08bf8660a80 100644 --- a/dlls/winmm/winmm.spec +++ b/dlls/winmm/winmm.spec @@ -1,7 +1,7 @@ name winmm type win32 init WINMM_LibMain -rsrc winmm_res +rsrc winmm_res.res import user32.dll import kernel32.dll diff --git a/if1632/Makefile.in b/if1632/Makefile.in index 7e2b875e266..cb78c74810d 100644 --- a/if1632/Makefile.in +++ b/if1632/Makefile.in @@ -23,7 +23,7 @@ all: $(MODULE).o $(MODULE).o: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in $(LDCOMBINE) $(OBJS) -o $@ -asmrelay.s: $(BUILD) - $(BUILD) @DLLFLAGS@ -o $@ -relay +asmrelay.s: $(WINEBUILD) + LD_LIBRARY_PATH="$(TOPOBJDIR):$$LD_LIBRARY_PATH" $(WINEBUILD) @DLLFLAGS@ -o $@ -relay ### Dependencies: diff --git a/libtest/.cvsignore b/libtest/.cvsignore index efb2d9a1294..e4e523f0e5f 100644 --- a/libtest/.cvsignore +++ b/libtest/.cvsignore @@ -7,7 +7,7 @@ hello2 hello2.spec.c hello3 hello3.spec.c -hello3res.s +hello3res.res hello4 hello4.spec.c hello5 diff --git a/libtest/Makefile.in b/libtest/Makefile.in index 14e38f6e823..90e8714bb99 100644 --- a/libtest/Makefile.in +++ b/libtest/Makefile.in @@ -21,7 +21,7 @@ SPEC_SRCS = \ RC_SRCS = \ hello3res.rc -all: check_wrc $(PROGRAMS) +all: $(PROGRAMS) @MAKE_RULES@ @@ -34,9 +34,11 @@ hello: hello.o hello.spec.o hello2: hello2.o hello2.spec.o $(CC) -o hello2 $+ -L$(DLLDIR) -lgdi32 -lkernel32 -luser32 $(DLL_LINK) $(LIBS) -hello3: hello3.o hello3.spec.o hello3res.o +hello3: hello3.o hello3.spec.o $(CC) -o hello3 $+ -L$(DLLDIR) -ladvapi32 -lcomctl32 -lcomdlg32 -lgdi32 -lkernel32 -lole32 -lrpcrt4 -lshell32 -lshlwapi -luser32 -lwinspool.drv $(DLL_LINK) $(LIBS) +hello3.spec.c: hello3res.res + hello4: hello4.o hello4.spec.o $(CC) -o hello4 $+ -L$(DLLDIR) -lgdi32 -lkernel32 -luser32 $(DLL_LINK) $(LIBS) diff --git a/libtest/hello3.spec b/libtest/hello3.spec index 8dd4e4a3846..67b1097677d 100644 --- a/libtest/hello3.spec +++ b/libtest/hello3.spec @@ -2,4 +2,4 @@ name hello3 mode guiexe type win32 init WinMain -rsrc hello3res +rsrc hello3res.res diff --git a/programs/avitools/Makefile.in b/programs/avitools/Makefile.in index e9884a26cb3..2f7e97f111f 100644 --- a/programs/avitools/Makefile.in +++ b/programs/avitools/Makefile.in @@ -12,7 +12,7 @@ SPEC_SRCS = \ aviinfo.spec \ aviplay.spec -all: check_wrc $(PROGRAMS) +all: $(PROGRAMS) @MAKE_RULES@ diff --git a/programs/clock/.cvsignore b/programs/clock/.cvsignore index a315e8e2c4a..d5353648642 100644 --- a/programs/clock/.cvsignore +++ b/programs/clock/.cvsignore @@ -1,4 +1,4 @@ Makefile clock clock.spec.c -rsrc.s +rsrc.res diff --git a/programs/clock/Makefile.in b/programs/clock/Makefile.in index 09246de98ac..b2453d57647 100644 --- a/programs/clock/Makefile.in +++ b/programs/clock/Makefile.in @@ -6,7 +6,6 @@ VPATH = @srcdir@ MODULE = none PROGRAMS = clock IMPORTS = advapi32 comctl32 shlwapi shell32 comdlg32 ole32 rpcrt4 winspool.drv user32 gdi32 kernel32 -WRCEXTRA = -s -p clock LICENSELANG = En @@ -21,14 +20,15 @@ SPEC_SRCS = clock.spec RC_SRCS = rsrc.rc -all: check_wrc $(PROGRAMS) +all: $(PROGRAMS) @MAKE_RULES@ - clock: $(OBJS) $(CC) -o clock $(OBJS) $(DLL_LINK) $(LIBS) +$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res) + install:: $(INSTALL_PROGRAM) clock $(bindir)/clock diff --git a/programs/clock/clock.spec b/programs/clock/clock.spec index 2e9df98de58..394fd04a10b 100644 --- a/programs/clock/clock.spec +++ b/programs/clock/clock.spec @@ -2,4 +2,4 @@ name clock mode guiexe type win32 init WinMain -rsrc clock +rsrc rsrc.res diff --git a/programs/cmdlgtst/.cvsignore b/programs/cmdlgtst/.cvsignore index 90d8e1b08a0..29bc66af96f 100644 --- a/programs/cmdlgtst/.cvsignore +++ b/programs/cmdlgtst/.cvsignore @@ -1,4 +1,4 @@ Makefile -cmdlgr.s +cmdlgr.res cmdlgtst cmdlgtst.spec.c diff --git a/programs/cmdlgtst/Makefile.in b/programs/cmdlgtst/Makefile.in index 7964d138c74..1e023b2cac9 100644 --- a/programs/cmdlgtst/Makefile.in +++ b/programs/cmdlgtst/Makefile.in @@ -6,7 +6,6 @@ VPATH = @srcdir@ MODULE = none PROGRAMS = cmdlgtst IMPORTS = advapi32 comctl32 comdlg32 shell32 shlwapi ole32 rpcrt4 winspool.drv user32 gdi32 kernel32 -WRCEXTRA = -s -p cmdlgtst C_SRCS = \ cmdlgtst.c @@ -17,13 +16,15 @@ SPEC_SRCS = \ RC_SRCS = \ cmdlgr.rc -all: check_wrc $(PROGRAMS) +all: $(PROGRAMS) @MAKE_RULES@ cmdlgtst: $(OBJS) $(CC) -o cmdlgtst $(OBJS) $(DLL_LINK) $(LIBS) +$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res) + install:: $(INSTALL_PROGRAM) cmdlgtst $(bindir)/cmdlgtst diff --git a/programs/cmdlgtst/cmdlgtst.spec b/programs/cmdlgtst/cmdlgtst.spec index 6f379007d78..eb79a658af2 100644 --- a/programs/cmdlgtst/cmdlgtst.spec +++ b/programs/cmdlgtst/cmdlgtst.spec @@ -2,5 +2,5 @@ name cmdlgtst mode guiexe type win32 init WinMain -rsrc cmdlgtst +rsrc cmdlgr.res import comdlg32.dll diff --git a/programs/notepad/.cvsignore b/programs/notepad/.cvsignore index 576cdea5ed8..46fda4aebd3 100644 --- a/programs/notepad/.cvsignore +++ b/programs/notepad/.cvsignore @@ -1,4 +1,4 @@ Makefile notepad notepad.spec.c -rsrc.s +rsrc.res diff --git a/programs/notepad/Makefile.in b/programs/notepad/Makefile.in index 97662596783..d7cda1effaf 100644 --- a/programs/notepad/Makefile.in +++ b/programs/notepad/Makefile.in @@ -6,7 +6,6 @@ VPATH = @srcdir@ MODULE = none PROGRAMS = notepad IMPORTS = advapi32 comctl32 shlwapi shell32 ole32 rpcrt4 comdlg32 winspool.drv user32 gdi32 kernel32 -WRCEXTRA = -s -p notepad LICENSELANG = En @@ -22,13 +21,15 @@ SPEC_SRCS = notepad.spec RC_SRCS = rsrc.rc -all: check_wrc $(PROGRAMS) +all: $(PROGRAMS) @MAKE_RULES@ notepad: $(OBJS) $(CC) -o notepad $(OBJS) $(DLL_LINK) $(LIBS) +$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res) + install:: $(INSTALL_PROGRAM) notepad $(bindir)/notepad diff --git a/programs/notepad/notepad.spec b/programs/notepad/notepad.spec index a5ee592a110..c2002591492 100644 --- a/programs/notepad/notepad.spec +++ b/programs/notepad/notepad.spec @@ -2,5 +2,5 @@ name notepad mode guiexe type win32 init WinMain -rsrc notepad +rsrc rsrc.res import comdlg32.dll diff --git a/programs/progman/.cvsignore b/programs/progman/.cvsignore index 447481c6f6b..8716df3e6f7 100644 --- a/programs/progman/.cvsignore +++ b/programs/progman/.cvsignore @@ -1,4 +1,4 @@ Makefile progman progman.spec.c -rsrc.s +rsrc.res diff --git a/programs/progman/Makefile.in b/programs/progman/Makefile.in index 6d12e9b82c6..98b426445cb 100644 --- a/programs/progman/Makefile.in +++ b/programs/progman/Makefile.in @@ -6,7 +6,6 @@ VPATH = @srcdir@ MODULE = none PROGRAMS = progman IMPORTS = shlwapi shell32 comdlg32 ole32 rpcrt4 winspool.drv user32 gdi32 kernel32 -WRCEXTRA = -s -p progman LICENSELANG = En @@ -24,13 +23,15 @@ SPEC_SRCS = progman.spec RC_SRCS = rsrc.rc -all: check_wrc $(PROGRAMS) +all: $(PROGRAMS) @MAKE_RULES@ progman: $(OBJS) $(CC) -o progman $(OBJS) $(DLL_LINK) $(LIBS) +$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res) + install:: $(INSTALL_PROGRAM) progman $(bindir)/progman diff --git a/programs/progman/progman.spec b/programs/progman/progman.spec index 5e4c692f86c..a85ede3f10c 100644 --- a/programs/progman/progman.spec +++ b/programs/progman/progman.spec @@ -2,5 +2,5 @@ name progman mode guiexe type win32 init WinMain -rsrc progman +rsrc rsrc.res import comdlg32.dll diff --git a/programs/uninstaller/.cvsignore b/programs/uninstaller/.cvsignore index 664cfff4531..43799b4091d 100644 --- a/programs/uninstaller/.cvsignore +++ b/programs/uninstaller/.cvsignore @@ -1,4 +1,4 @@ Makefile -rsrc.s +rsrc.res uninstaller uninstaller.spec.c diff --git a/programs/uninstaller/Makefile.in b/programs/uninstaller/Makefile.in index 99b1564f0cf..62e008366ac 100644 --- a/programs/uninstaller/Makefile.in +++ b/programs/uninstaller/Makefile.in @@ -5,7 +5,6 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = none PROGRAMS = uninstaller -WRCEXTRA = -s -p uninstaller IMPORTS = user32 gdi32 kernel32 LICENSELANG = En @@ -17,13 +16,15 @@ SPEC_SRCS = uninstaller.spec RC_SRCS = rsrc.rc -all: check_wrc $(PROGRAMS) +all: $(PROGRAMS) @MAKE_RULES@ uninstaller: $(OBJS) $(CC) -o uninstaller $(OBJS) $(DLL_LINK) $(LIBS) +$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res) + install:: $(INSTALL_PROGRAM) uninstaller $(bindir)/uninstaller diff --git a/programs/uninstaller/uninstaller.spec b/programs/uninstaller/uninstaller.spec index 4763ae8a145..7473669c173 100644 --- a/programs/uninstaller/uninstaller.spec +++ b/programs/uninstaller/uninstaller.spec @@ -2,4 +2,4 @@ name uninstaller mode guiexe type win32 init WinMain -rsrc uninstaller +rsrc rsrc.res diff --git a/programs/view/.cvsignore b/programs/view/.cvsignore index e7bc3b6fff3..7deec698e2b 100644 --- a/programs/view/.cvsignore +++ b/programs/view/.cvsignore @@ -1,4 +1,4 @@ Makefile view view.spec.c -viewrc.s +viewrc.res diff --git a/programs/view/Makefile.in b/programs/view/Makefile.in index ddba9301346..4f4c4fcf633 100644 --- a/programs/view/Makefile.in +++ b/programs/view/Makefile.in @@ -6,7 +6,6 @@ VPATH = @srcdir@ MODULE = none PROGRAMS = view IMPORTS = advapi32 comctl32 comdlg32 shell32 shlwapi ole32 rpcrt4 winspool.drv user32 gdi32 kernel32 -WRCEXTRA = -s -p view C_SRCS = \ init.c \ @@ -19,13 +18,15 @@ SPEC_SRCS = \ RC_SRCS = \ viewrc.rc -all: check_wrc $(PROGRAMS) +all: $(PROGRAMS) @MAKE_RULES@ view: $(OBJS) $(CC) -o view $(OBJS) $(DLL_LINK) $(LIBS) +$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res) + install:: $(INSTALL_PROGRAM) view $(bindir)/view diff --git a/programs/view/view.spec b/programs/view/view.spec index 34d2915e8b3..8ffc6ecb771 100644 --- a/programs/view/view.spec +++ b/programs/view/view.spec @@ -2,4 +2,4 @@ name view mode guiexe type win32 init WinMain -rsrc view +rsrc viewrc.res diff --git a/programs/wcmd/.cvsignore b/programs/wcmd/.cvsignore index d588e377ecb..06b676630bb 100644 --- a/programs/wcmd/.cvsignore +++ b/programs/wcmd/.cvsignore @@ -1,4 +1,4 @@ Makefile wcmd wcmd.spec.c -wcmdrc.s +wcmdrc.res diff --git a/programs/wcmd/Makefile.in b/programs/wcmd/Makefile.in index 87812b2cb2d..2b960e06cf4 100644 --- a/programs/wcmd/Makefile.in +++ b/programs/wcmd/Makefile.in @@ -6,7 +6,6 @@ VPATH = @srcdir@ MODULE = none PROGRAMS = wcmd IMPORTS = user32 gdi32 kernel32 -WRCEXTRA = -s -p wcmd C_SRCS = \ batch.c \ @@ -20,10 +19,12 @@ SPEC_SRCS = \ RC_SRCS = \ wcmdrc.rc -all: check_wrc $(PROGRAMS) +all: $(PROGRAMS) @MAKE_RULES@ +$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res) + wcmd: $(OBJS) $(CC) -o wcmd $(OBJS) $(DLL_LINK) $(LIBS) diff --git a/programs/wcmd/wcmd.spec b/programs/wcmd/wcmd.spec index 3cffcff20fd..60cb6bb4f90 100644 --- a/programs/wcmd/wcmd.spec +++ b/programs/wcmd/wcmd.spec @@ -1,5 +1,5 @@ name wcmd mode cuiexe type win32 -rsrc wcmd init wine_main +rsrc wcmdrc.res diff --git a/programs/winemine/.cvsignore b/programs/winemine/.cvsignore index 5315ee1e41b..f16473ece95 100644 --- a/programs/winemine/.cvsignore +++ b/programs/winemine/.cvsignore @@ -1,4 +1,4 @@ Makefile -rsrc.s +rsrc.res winemine winemine.spec.c diff --git a/programs/winemine/Makefile.in b/programs/winemine/Makefile.in index 5934a75a40a..c9bc2d1937e 100644 --- a/programs/winemine/Makefile.in +++ b/programs/winemine/Makefile.in @@ -5,7 +5,6 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = none PROGRAMS = winemine -WRCEXTRA = -s -p winemine IMPORTS = user32 gdi32 kernel32 LICENSELANG = En @@ -14,18 +13,19 @@ C_SRCS = \ main.c \ dialog.c - SPEC_SRCS = winemine.spec RC_SRCS = rsrc.rc -all: check_wrc $(PROGRAMS) +all: $(PROGRAMS) @MAKE_RULES@ winemine: $(OBJS) $(CC) -o winemine $(OBJS) $(DLL_LINK) $(LIBS) +$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res) + install:: $(INSTALL_PROGRAM) winemine $(bindir)/winemine diff --git a/programs/winemine/winemine.spec b/programs/winemine/winemine.spec index 6425621f9e7..0f756996bca 100644 --- a/programs/winemine/winemine.spec +++ b/programs/winemine/winemine.spec @@ -2,4 +2,4 @@ name winemine mode guiexe type win32 init WinMain -rsrc winemine +rsrc rsrc.res diff --git a/programs/winhelp/.cvsignore b/programs/winhelp/.cvsignore index 395405857ed..35d22567c7b 100644 --- a/programs/winhelp/.cvsignore +++ b/programs/winhelp/.cvsignore @@ -1,7 +1,7 @@ Makefile hlp2sgml lex.yy.c -rsrc.s +rsrc.res winhelp winhelp.spec.c y.tab.c diff --git a/programs/winhelp/Makefile.in b/programs/winhelp/Makefile.in index d7ebbbfd232..831c7d7cfcb 100644 --- a/programs/winhelp/Makefile.in +++ b/programs/winhelp/Makefile.in @@ -6,7 +6,6 @@ VPATH = @srcdir@ MODULE = none PROGRAMS = winhelp hlp2sgml IMPORTS = advapi32 comctl32 shlwapi shell32 ole32 rpcrt4 comdlg32 winspool.drv user32 gdi32 kernel32 -WRCEXTRA = -s -p winhelp C_SRCS = \ winhelp.c \ @@ -21,12 +20,14 @@ EXTRA_OBJS = y.tab.o lex.yy.o RC_SRCS = rsrc.rc -all: check_wrc $(PROGRAMS) +all: $(PROGRAMS) depend: y.tab.h @MAKE_RULES@ +$(SPEC_SRCS:.spec=.spec.c): $(RC_SRCS:.rc=.res) + winhelp: $(OBJS) $(CC) -o winhelp $(OBJS) $(DLL_LINK) $(LIBS) diff --git a/programs/winhelp/winhelp.spec b/programs/winhelp/winhelp.spec index 81efffa13a6..23b5798bb80 100644 --- a/programs/winhelp/winhelp.spec +++ b/programs/winhelp/winhelp.spec @@ -2,5 +2,5 @@ name winhelp mode guiexe type win32 init WinMain -rsrc winhelp +rsrc rsrc.res import comdlg32.dll diff --git a/relay32/builtin32.c b/relay32/builtin32.c index 233eafd70bb..cda826da8d0 100644 --- a/relay32/builtin32.c +++ b/relay32/builtin32.c @@ -115,6 +115,28 @@ static inline void fixup_rva_ptrs( void *array, void *base, int count ) } +/*********************************************************************** + * fixup_resources + */ +static void fixup_resources( IMAGE_RESOURCE_DIRECTORY *dir, char *root, void *base ) +{ + IMAGE_RESOURCE_DIRECTORY_ENTRY *entry; + int i; + + entry = (IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1); + for (i = 0; i < dir->NumberOfNamedEntries + dir->NumberOfIdEntries; i++, entry++) + { + void *ptr = root + entry->u2.s.OffsetToDirectory; + if (entry->u2.s.DataIsDirectory) fixup_resources( ptr, root, base ); + else + { + IMAGE_RESOURCE_DATA_ENTRY *data = ptr; + fixup_rva_ptrs( &data->OffsetToData, base, 1 ); + } + } +} + + /*********************************************************************** * BUILTIN32_DoLoadImage * @@ -126,7 +148,7 @@ static HMODULE BUILTIN32_DoLoadImage( const BUILTIN32_DESCRIPTOR *descr ) IMAGE_DOS_HEADER *dos; IMAGE_NT_HEADERS *nt; IMAGE_SECTION_HEADER *sec; - INT i, size, nb_sections; + INT size, nb_sections; BYTE *addr, *code_start, *data_start; int page_size = VIRTUAL_GetPageSize(); @@ -213,13 +235,11 @@ static HMODULE BUILTIN32_DoLoadImage( const BUILTIN32_DESCRIPTOR *descr ) /* Build the resource directory */ dir = &nt->OptionalHeader.DataDirectory[IMAGE_FILE_RESOURCE_DIRECTORY]; - if (dir->VirtualAddress) + if (dir->Size) { - BUILTIN32_RESOURCE *rsrc = (BUILTIN32_RESOURCE *)dir->VirtualAddress; - IMAGE_RESOURCE_DATA_ENTRY *rdep = rsrc->entries; - dir->VirtualAddress = (BYTE *)rsrc->restab - addr; - dir->Size = rsrc->restabsize; - for (i = 0; i < rsrc->nresources; i++) rdep[i].OffsetToData += dir->VirtualAddress; + void *ptr = (void *)dir->VirtualAddress; + fixup_rva_ptrs( &dir->VirtualAddress, addr, 1 ); + fixup_resources( ptr, ptr, addr ); } /* Build the export directory */ diff --git a/tools/makedep.c b/tools/makedep.c index 11cbc8d9782..4c253e2f337 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -265,27 +265,26 @@ static void output_src( FILE *file, INCL_FILE *pFile, int *column ) char *ext = strrchr( obj, '.' ); if (ext) { - if (!strcmp( ext, ".y" )) /* yacc file */ + *ext++ = 0; + if (!strcmp( ext, "y" )) /* yacc file */ { - fprintf( file, "y.tab.o: y.tab.c" ); - *column += 16; + *column += fprintf( file, "y.tab.o: y.tab.c" ); } - else if (!strcmp( ext, ".l" )) /* lex file */ + else if (!strcmp( ext, "l" )) /* lex file */ { - fprintf( file, "lex.yy.o: lex.yy.c" ); - *column += 18; + *column += fprintf( file, "lex.yy.o: lex.yy.c" ); } - else if (!strcmp( ext, ".rc" )) /* resource file */ + else if (!strcmp( ext, "rc" )) /* resource file */ { - strcpy( ext, ".s" ); - fprintf( file, "%s: %s", obj, pFile->filename ); - *column += strlen(obj) + strlen(pFile->filename); + *column += fprintf( file, "%s.res: %s", obj, pFile->filename ); + } + else if (!strcmp( ext, "rc16" )) /* Win16 resource file */ + { + *column += fprintf( file, "%s.s: %s", obj, pFile->filename ); } else { - strcpy( ext, ".o" ); - fprintf( file, "%s: %s", obj, pFile->filename ); - *column += strlen(obj) + strlen(pFile->filename) + 2; + *column += fprintf( file, "%s.o: %s", obj, pFile->filename ); } } free( obj );