From 0715614b52e1cebff3dbe68a2ec7328ab0e34e04 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 25 Aug 2000 16:50:08 +0000 Subject: [PATCH] * Makefile.in: Only build dumper.exe when all of its library and include dependencies are available. --- winsup/utils/ChangeLog | 5 +++++ winsup/utils/Makefile.in | 32 ++++++++++++++++++++++++-------- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index fec76b728..877aac332 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,8 @@ +Fri Aug 25 12:41:53 2000 Christopher Faylor + + * Makefile.in: Only build dumper.exe when all of its library and + include dependencies are available. + Fri Aug 25 11:44:29 2000 Christopher Faylor * Makefile.in: Make failure to build dumper.exe a non-error. diff --git a/winsup/utils/Makefile.in b/winsup/utils/Makefile.in index d78ecdeba..5e523c4f3 100644 --- a/winsup/utils/Makefile.in +++ b/winsup/utils/Makefile.in @@ -35,6 +35,10 @@ include $(srcdir)/../Makefile.common MINGW_INCLUDES:=-I$(mingw_source)/include -I$(cygwin_source)/include -I$(w32api_include) +libbfd:=$(bupdir2)/bfd/libbfd.a +libintl:=$(bupdir2)/intl/libintl.a +build_dumper:=${shell test -r $(libbfd) -a -r $(libintl) -a -d $(updir1)/include && echo 1} + DUMPER_INCLUDES:=-I$(bupdir2)/bfd -I$(updir1)/include MINGW_CXXFLAGS:=$(CXXFLAGS) -mno-cygwin $(MINGW_INCLUDES) @@ -55,7 +59,7 @@ ALL_LDLIBS:=${patsubst $(w32api_lib)/lib%.a,-l%,\ ${filter-out $(libcygwin), $(ALL_DEP_LDLIBS)}}}} MINGW_LIB:=$(mingw_build)/libmingw32.a -DUMPER_LIB:=-L$(bupdir2)/bfd -lbfd -L$(bupdir2)/libiberty -liberty -L$(bupdir2)/intl -lintl +DUMPER_LIB:=-L$(bupdir2)/bfd -lbfd -L$(bupdir1)/libiberty -liberty -L$(bupdir2)/intl -lintl MINGW_LDLIBS:=$(ALL_LDLIBS) $(MINGW_LIB) MINGW_DEP_LDLIBS:=${ALL_DEP_LDLIBS} ${MINGW_LIB} ALL_LDFLAGS:=-B$(newlib_build)/libc/ -B$(newlib_build)/libm/ -B$(w32api_lib)/ \ @@ -66,12 +70,18 @@ DUMPER_LDFLAGS:=$(ALL_LDFLAGS) $(DUMPER_LIB) PROGS:=mount$(EXEEXT) umount$(EXEEXT) ps$(EXEEXT) kill$(EXEEXT) \ mkpasswd$(EXEEXT) mkgroup$(EXEEXT) cygpath$(EXEEXT) cygcheck$(EXEEXT) \ passwd$(EXEEXT) getfacl$(EXEEXT) setfacl$(EXEEXT) strace$(EXEEXT) \ - regtool$(EXEEXT) dumper$(EXEEXT) + regtool$(EXEEXT) + +ifdef build_dumper +PROGS+=dumper$(EXEEXT) +else +PROGS:=warn_dumper $(PROGS) +endif .SUFFIXES: .NOEXPORT: -.PHONY: all install clean realclean +.PHONY: all install clean realclean warn_dumper all: Makefile $(PROGS) @@ -84,13 +94,13 @@ else endif dumper.o: dumper.cc dumper.h - -$(CC) -c -o $@ $(DUMPER_CFLAGS) ${firstword $^} + $(CC) -c -o $@ $(DUMPER_CFLAGS) ${firstword $^} module_info.o: module_info.cc - -$(CC) -c -o $@ $(DUMPER_CFLAGS) $^ + $(CC) -c -o $@ $(DUMPER_CFLAGS) $^ parse_pe.o: parse_pe.cc dumper.h - -$(CC) -c -o $@ $(DUMPER_CFLAGS) ${firstword $^} + $(CC) -c -o $@ $(DUMPER_CFLAGS) ${firstword $^} mingw_getopt.o: $(cygwin_source)/lib/getopt.c $(CC) -c -o $@ $(MINGW_CFLAGS) $^ @@ -114,11 +124,17 @@ $(cygwin_build)/libcygwin.a: $(cygwin_build)/Makefile $(mingw_build)/libmingw32.a: $(mingw_build)/Makefile @$(MAKE) -C $(@D) $(@F) +warn_dumper: + @echo '*** Not building dumper.exe since some required libraries or headers' + @echo '*** are missing (libbfd.a, libintl.a, and include/).' + @echo '*** Check out and build these libraries from sources.redhat.com if you' + @echo '*** need dumper.exe. Otherwise, you can safely ignore this warning.' + dumper.exe: module_info.o parse_pe.o dumper.o $(ALL_DEP_LDLIBS) ifdef VERBOSE - -$(CC) -o $@ ${wordlist 1,3,$^} -B$(cygwin_build)/ $(DUMPER_LDFLAGS) + $(CC) -o $@ ${wordlist 1,3,$^} -B$(cygwin_build)/ $(DUMPER_LDFLAGS) else - -@echo $(CC) -o $@ ${wordlist 1,3,$^} ${filter-out -B%, $(DUMPER_LDFLAGS)};\ + @echo $(CC) -o $@ ${wordlist 1,3,$^} ${filter-out -B%, $(DUMPER_LDFLAGS)};\ $(CC) -o $@ ${wordlist 1,3,$^} -B$(cygwin_build)/ $(DUMPER_LDFLAGS) endif