[FIX] HEAD & 3_0 winbindd_proto - Makefile.in

Martin Pool mbp at samba.org
Thu May 16 23:43:01 GMT 2002


On 16 May 2002, abartlet at samba.org wrote:
> On Fri, May 17, 2002 at 07:44:14AM +0200, Stefan (metze) Metzmacher wrote:
> > I noticed a bug in HEAD's and 3_0's Makefile(Makefile.in)
> > 
> > when I run make clean 'nsswitch/winbindd_proto.h' is deleted, but when I 
> > run make it's not created!

That was bugging me too.  Here's a patch (committed) which makes
winbindd_proto handling consistent with the other header files, so
that at least "make clean; make all" doesn't fail.

It's still not safe for parallel builds, i.e. "make clean; make -j3
all" will probably crash, but "make clean; make proto && make -j3 all"
seems OK.  I'm not sure if it is possible to solve that and still
support ancient non-GNU versions of Make.

-- 
Martin 
tab tab ding


--- Makefile.in.~1.476.~	Fri May 17 16:12:25 2002
+++ Makefile.in	Fri May 17 16:34:39 2002
@@ -470,7 +470,7 @@ TDBBACKUP_OBJ = tdb/tdbbackup.o $(TDBBAS
 ######################################################################
 # now the rules...
 ######################################################################
-all : SHOWFLAGS include/proto.h include/wrepld_proto.h include/build_env.h $(SPROGS) $(PROGS) $(WINBIND_PROGS) $(WINBIND_SPROGS) $(LPROGS) $(SHLIBS)
+all : SHOWFLAGS proto_exists $(SPROGS) $(PROGS) $(WINBIND_PROGS) $(WINBIND_SPROGS) $(LPROGS) $(SHLIBS)
 
 pam_smbpass : SHOWFLAGS bin/pam_smbpass. at SHLIBEXT@
 
@@ -831,12 +831,14 @@ clean: delheaders
 	-rm -f core */*~ *~ */*.o */*.po */*.po32 */*. at SHLIBEXT@ \
 	$(TOPFILES) $(PROGS) $(SPROGS) .headers.stamp
 
-winbindd_proto:
-	@cd $(srcdir) && $(SHELL) script/mkproto.sh $(AWK) \
-	  -h _WINBINDD_PROTO_H_ nsswitch/winbindd_proto.h \
-	  $(WINBINDD_OBJ1)
+# Making this target will just make sure that the prototype files
+# exist, not necessarily that they are up to date.  Since they're
+# removed by "make clean" this will always be run when you do anything
+# afterwards.
+proto_exists: include/proto.h include/wrepld_proto.h include/build_env.h nsswitch/winbindd_proto.h
 
 delheaders:
+	@echo Removing prototype headers
 	@/bin/rm -f $(srcdir)/include/proto.h $(srcdir)/include/build_env.h 
 	@/bin/rm -f $(srcdir)/include/wrepld_proto.h $(srcdir)/nsswitch/winbindd_proto.h 
 	@/bin/rm -f include/proto.h include/build_env.h include/wrepld_proto.h nsswitch/winbindd_proto.h 
@@ -855,10 +857,20 @@ include/wrepld_proto.h:
 	  -h _WREPLD_PROTO_H_ $(builddir)/include/wrepld_proto.h \
 	  $(WREPL_OBJ1)
 
+nsswitch/winbindd_proto.h: 
+	@cd $(srcdir) && $(SHELL) script/mkproto.sh $(AWK) \
+	  -h _WINBINDD_PROTO_H_ nsswitch/winbindd_proto.h \
+	  $(WINBINDD_OBJ1)
+
+# "make headers" or "make proto" calls a subshell because we need to
+# make sure these commands are executed in sequence even for a
+# parallel make.
 headers: 
-	$(MAKE) delheaders include/proto.h include/build_env.h include/wrepld_proto.h winbindd_proto
+	$(MAKE) delheaders include/proto.h include/build_env.h include/wrepld_proto.h nsswitch/winbindd_proto.h
+
+proto: headers winbindd_proto 
 
-proto: headers 
+winbindd_proto: headers
 
 .PHONY: headers proto
 




More information about the samba-technical mailing list