From c7fa2f0b6f8937799f97982e60a6260112bf5e3f Mon Sep 17 00:00:00 2001 From: Jeff Morriss Date: Tue, 18 Sep 2012 15:15:39 +0000 Subject: If we have PYTHON use make-tap-reg.py (in both autofoo and Windows): it's slightly faster than the old shell-script version on *NIX and it seems significantly faster on Windows. svn path=/trunk/; revision=44972 --- ui/cli/Makefile.am | 11 ++++++++--- ui/cli/Makefile.nmake | 17 ++++++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) (limited to 'ui/cli') diff --git a/ui/cli/Makefile.am b/ui/cli/Makefile.am index 13e0c00f3d..4fd3776efd 100644 --- a/ui/cli/Makefile.am +++ b/ui/cli/Makefile.am @@ -52,9 +52,14 @@ MAINTAINERCLEANFILES = \ # The first argument is the directory in which the source files live. # All subsequent arguments are the files to scan. # -tshark-tap-register.c: $(TSHARK_TAP_SRC) $(top_srcdir)/tools/make-tapreg-dotc - @echo Making tshark-tap-register.c - @$(top_srcdir)/tools/make-tapreg-dotc tshark-tap-register.c $(srcdir) $(TSHARK_TAP_SRC) +tshark-tap-register.c: $(TSHARK_TAP_SRC) $(top_srcdir)/tools/make-tapreg-dotc $(top_srcdir)/tools/make-tap-reg.py + @if test -n "$(PYTHON)"; then \ + echo Making tshark-tap-register.c with python; \ + $(PYTHON) $(top_srcdir)/tools/make-tap-reg.py $(srcdir) tshark-taps $(TSHARK_TAP_SRC); \ + else \ + echo Making tshark-tap-register.c; \ + $(top_srcdir)/tools/make-tapreg-dotc tshark-tap-register.c $(srcdir) $(TSHARK_TAP_SRC); \ + fi # All sources that should be put in the source distribution tarball libcliui_a_SOURCES = \ diff --git a/ui/cli/Makefile.nmake b/ui/cli/Makefile.nmake index 3264b08822..e32645b12f 100644 --- a/ui/cli/Makefile.nmake +++ b/ui/cli/Makefile.nmake @@ -41,21 +41,32 @@ libcliui.lib : ..\..\config.h $(TSHARK_TAP_OBJECTS) tshark-tap-register.obj # # We do this by grepping through sources. # +# The shell script runs slowly, as multiple greps and seds are run +# for each input file; this is especially slow on Windows. Therefore, +# if Python is present (as indicated by PYTHON being defined), we run +# a faster Python script to do that work instead. +# # Formatting conventions: The name of the tap_listener_register_* # routines must start in column zero, or must be preceded only by # "void " starting in column zero, and must not be inside #if. # +!IFDEF PYTHON +tshark-tap-register.c: $(TSHARK_TAP_SRC) ..\..\tools\make-tap-reg.py + @echo Making tshark-tap-register.c using python + @$(PYTHON) ..\..\tools\make-tap-reg.py . tshark-taps $(TSHARK_TAP_SRC) +!ELSE # The first argument is the name of the file to write. # The second argument is the directory in which the source files live. # All subsequent arguments are the files to scan. -# tshark-tap-register.c: $(TSHARK_TAP_SRC) ..\..\tools\make-tapreg-dotc @echo Making tshark-tap-register.c @$(SH) ../../tools/make-tapreg-dotc tshark-tap-register.c . $(TSHARK_TAP_SRC) +!ENDIF clean: - rm -f $(TSHARK_TAP_OBJECTS) tshark-tap-register.obj libcliui.lib *.pdb *.sbr \ - doxygen.cfg html/*.* wireshark-tap-register-cache.pkl + rm -f $(TSHARK_TAP_OBJECTS) tshark-tap-register.obj libcliui.lib *.pdb \ + *.sbr doxygen.cfg html/*.* tshark-tap-register-cache.pkl \ + tshark-tap-register.c-tmp if exist html rmdir html distclean: clean -- cgit v1.2.1