[openib-general] Re: [PATCH] osm: support osm_svn_revision.h in case ofSVN export

Hal Rosenstock halr at voltaire.com
Mon Jan 30 07:56:58 PST 2006


On Mon, 2006-01-30 at 09:53, Michael S. Tsirkin wrote:
> Quoting r. Eitan Zahavi <eitan at mellanox.co.il>:
> > Subject: [PATCH] osm: support osm_svn_revision.h in case ofSVN export
> > 
> > Hi Hal
> > 
> > We are using SVN export when building standalone OpenSM packages.
> > During the SVN export we overwrite the osm_svn_revision.h with the 
> > SVN version used for the export.
> > 
> > However the makefile override that. This patch avoids this by checking 
> > if the svnversion is "exported".
> > 
> > Eitan
> 
> Hi!
> The way osm_svn_revision_new.h is removed to trigger re-make on the
> next pass is IMO ugly: thats what .PHONY target is for.
> 
> ---
> 
> Simplify Makefile.am (remove an extra target, use -n flag to svnversion)
> and make it possible to build opensm on platforms without subversion installed.

Thanks. Applied.

-- Hal

> Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>
> 
> Index: openib/src/userspace/management/osm/opensm/Makefile.am
> ===================================================================
> --- openib/src/userspace/management/osm/opensm/Makefile.am	(revision 5207)
> +++ openib/src/userspace/management/osm/opensm/Makefile.am	(working copy)
> @@ -10,25 +10,25 @@
>  endif
>  
>  if OSMV_OPENIB
> -$(srcdir)/../include/opensm/osm_svn_revision_new.h:
> -	echo -n "#define OSM_SVN_REVISION \"" >$(srcdir)/../include/opensm/osm_svn_revision_new.h ; \
> -	svnversion $(srcdir)/.. | tr -d '\n' >> $(srcdir)/../include/opensm/osm_svn_revision_new.h ; \
> -	echo "\"" >> $(srcdir)/../include/opensm/osm_svn_revision_new.h ; \
> -	if test `cat $(srcdir)/../include/opensm/osm_svn_revision_new.h | grep exported | wc -l` = 1; \
> -	then \
> -		cp $(srcdir)/../include/opensm/osm_svn_revision.h \
> -		   $(srcdir)/../include/opensm/osm_svn_revision_new.h; \
> +.PHONY: always
> +$(srcdir)/../include/opensm/osm_svn_revision.h: always
> +	if \
> +		test '!' -d '$(srcdir)/.svn';\
> +	then\
> +		echo Exported svn revision;\
> +	else\
> +		echo -n "#define OSM_SVN_REVISION \"" >$(srcdir)/../include/opensm/osm_svn_revision_new.h ;\
> +		svnversion -n $(srcdir)/.. >> $(srcdir)/../include/opensm/osm_svn_revision_new.h ;\
> +		echo "\"" >> $(srcdir)/../include/opensm/osm_svn_revision_new.h ;\
> +		if cmp -s $(srcdir)/../include/opensm/osm_svn_revision_new.h \
> +			  $(srcdir)/../include/opensm/osm_svn_revision.h ;\
> +		then\
> +			rm $(srcdir)/../include/opensm/osm_svn_revision_new.h ;\
> +		else\
> +			mv $(srcdir)/../include/opensm/osm_svn_revision_new.h\
> +			   $(srcdir)/../include/opensm/osm_svn_revision.h ;\
> +		fi ;\
>  	fi
> -
> -$(srcdir)/../include/opensm/osm_svn_revision.h: $(srcdir)/../include/opensm/osm_svn_revision_new.h
> -	if cmp -s $(srcdir)/../include/opensm/osm_svn_revision_new.h \
> -		  $(srcdir)/../include/opensm/osm_svn_revision.h ; \
> -	then \
> -		rm $(srcdir)/../include/opensm/osm_svn_revision_new.h ; \
> -	else \
> -		mv $(srcdir)/../include/opensm/osm_svn_revision_new.h \
> -		   $(srcdir)/../include/opensm/osm_svn_revision.h ; \
> -	fi
>  endif
>  
>  libopensm_la_CFLAGS = -Wall $(OSMV_CFLAGS) -DVENDOR_RMPP_SUPPORT $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
> 




More information about the general mailing list