The MinGW.org Windows System Libraries
Revisão | 796e3f70c06d0c85c7d9a6fd71ea4ec25849aed0 (tree) |
---|---|
Hora | 2013-12-22 02:01:16 |
Autor | Keith Marshall <keithmarshall@user...> |
Commiter | Keith Marshall |
Avoid gratuitously overriding makefile build rules.
@@ -1,3 +1,13 @@ | ||
1 | +2013-12-21 Keith Marshall <keithmarshall@users.sourceforge.net> | |
2 | + | |
3 | + Avoid gratuitously overriding makefile build rules. | |
4 | + | |
5 | + * Makefile.in (DRV_TARGETS, DRV_OR_DLL): New macros; define them. | |
6 | + (winapi_lib_LIBRARIES): Use them; adapt generic command set to handle | |
7 | + cases where supplementary objects must be added to .def file payload. | |
8 | + (libws2_32.a, libshell32.a): Now built by this generic rule; delete | |
9 | + redundant explicit build rules. | |
10 | + | |
1 | 11 | 2013-12-20 Keith Marshall <keithmarshall@users.sourceforge.net> |
2 | 12 | |
3 | 13 | Correct invalid makefile shell command syntax. |
@@ -684,15 +684,19 @@ $(moldname_DEF): lib/lib32/moldname.def.in | ||
684 | 684 | $? > $@ |
685 | 685 | |
686 | 686 | SRCDIR := lib/lib32 |
687 | -$(notdir $(winapi_lib_LIBRARIES)): $(addprefix lib/lib32/,$(winapi_DEF)) | |
688 | - @echo Making library $@ from $(subst lib,,$(@:.a=.def)). | |
689 | - if test $@ = libwinspool.a; then \ | |
690 | - $(DLLTOOL) $(DLLTOOL_FLAGS) $(subst lib,,$(@:.a=.drv)) --def $(addprefix $(top_srcdir)/lib/lib32/,$(subst lib,,$(@:.a=.def))) --output-lib $@ ; \ | |
691 | - else \ | |
692 | - $(DLLTOOL) $(DLLTOOL_FLAGS) $(subst lib,,$(@:.a=.dll)) --def $(addprefix $(top_srcdir)/lib/lib32/,$(subst lib,,$(@:.a=.def))) --output-lib $@ ; \ | |
693 | - fi | |
687 | +DRV_TARGETS = winspool | |
688 | +DRV_OR_DLL = `case $* in $(DRV_TARGETS)) echo drv ;; *) echo dll ;; esac` | |
689 | +vpath %.def ${top_srcdir}/lib/lib32 | |
690 | + | |
691 | +$(winapi_lib_LIBRARIES): lib%.a: %.def | |
692 | + @echo Making library $@ from $< | |
693 | + $(DLLTOOL) $(DLLTOOL_FLAGS) $*.$(DRV_OR_DLL) --def $< --output-lib $@ | |
694 | + test -z "$(lib$*_a_OBJECTS)" || $(AR) rc $@ $(lib$*_a_OBJECTS) | |
694 | 695 | $(RANLIB) $@ |
695 | 696 | |
697 | +libshell32.a: shell32.def $(libshell32_a_OBJECTS) | |
698 | +libws2_32.a: ws2_32.def $(libws2_32_a_OBJECTS) | |
699 | + | |
696 | 700 | $(notdir $(winapi_mri_LIBRARIES)): $(addprefix lib/lib32/,$(winapi_MRI)) |
697 | 701 | @echo Making library $@ from $<. |
698 | 702 | $(AR) -M < $< |
@@ -861,22 +865,6 @@ libstrmiids.a: $(libstrmiids_a_OBJECTS) | ||
861 | 865 | $(AR) rc $@ $(libstrmiids_a_OBJECTS) |
862 | 866 | $(RANLIB) $@ |
863 | 867 | |
864 | -# Note this target will override the previous global rules and give a warning | |
865 | -# from the make process. It is needed due to the extra ws2_32.o object file. | |
866 | -libws2_32.a: lib/lib32/ws2_32.def $(libws2_32_a_OBJECTS) | |
867 | - @echo Making library $@ from $(subst lib,,$(@:.a=.def)). | |
868 | - $(DLLTOOL) $(DLLTOOL_FLAGS) $(subst lib,,$(@:.a=.dll)) --def $(addprefix $(top_srcdir)/lib/lib32/,$(subst lib,,$(@:.a=.def))) --output-lib $@ | |
869 | - $(AR) rc $@ $(libws2_32_a_OBJECTS) | |
870 | - $(RANLIB) $@ | |
871 | - | |
872 | -# Note this target will override the previous global rules and give a warning | |
873 | -# from the make process. It is needed due to the extra shell32.o object file. | |
874 | -libshell32.a: lib/lib32/shell32.def $(libshell32_a_OBJECTS) | |
875 | - @echo Making library $@ from $(subst lib,,$(@:.a=.def)). | |
876 | - $(DLLTOOL) $(DLLTOOL_FLAGS) $(subst lib,,$(@:.a=.dll)) --def $(addprefix $(top_srcdir)/lib/lib32/,$(subst lib,,$(@:.a=.def))) --output-lib $@ | |
877 | - $(AR) rc $@ $(libshell32_a_OBJECTS) | |
878 | - $(RANLIB) $@ | |
879 | - | |
880 | 868 | _libm_dummy.c: |
881 | 869 | @echo "static int __mingw_libm_dummy;" > _libm_dummy.c |
882 | 870 |