Simplify Makefile.nmake so that adding a new plugin to Makefile.nmake
authorBill Meier <wmeier@newsguy.com>
Mon, 19 Apr 2010 14:38:20 +0000 (14:38 -0000)
committerBill Meier <wmeier@newsguy.com>
Mon, 19 Apr 2010 14:38:20 +0000 (14:38 -0000)
requires only adding the plugin (directory) name to a list of plugins.

svn path=/trunk/; revision=32516

doc/README.plugins
plugins/Makefile.nmake

index ece47891c3962ff34c1820fae46fbb8564ab8fc2..e9df1858bf113ff795d0fdd4829b24f4160e7acd 100644 (file)
@@ -89,7 +89,6 @@ You will also need to change the following files:
        CMakeLists.txt
        epan/Makefile.am
        Makefile.am
-       Makefile.nmake
        packaging/nsis/Makefile.nmake
        packaging/nsis/wireshark.nsi
        plugins/Makefile.am
@@ -116,19 +115,9 @@ SUBDIRS = $(_CUSTOM_SUBDIRS_) \
 
 3.2 Changes to plugins/Makefile.nmake
 
-To the Makefile.nmake you need to add the following (in
-alphabetical order) for your plugin to the process-plugins: rule
-
-       cd xxx
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
-       cd ..
-
-Then add a copy command to the install-plugins rule:
-
-       ...
-       xcopy plugins\xxx\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
-       cd plugins
-       if exist Custom.nmake $(MAKE) /$(MAKEFLAGS) -f Custom.nmake install-plugins
+In plugins/Makefile.nmake you need to add to the PLUGINS_LIST  
+(in alphabetical order) the name of your dissector (actually:
+the name of the plugins sub-directory which contains your dissector).
 
 3.3 Changes to the top level Makefile.am
 
index 28afef9984d7c6a036f5aeca8b62f2bad128923f..c11868b54203507ac5eb3ddd4a01289c84f7352f 100644 (file)
@@ -4,7 +4,26 @@
 
 include ..\config.nmake
 
-## To add a plugin: Add entry to process-plugins and to install-plugins
+## To add a plugin: Add entry to PLUGIN_LIST
+
+PLUGIN_LIST = \
+       asn1        \
+       docsis      \
+       ethercat    \
+       giop        \
+       gryphon     \
+       interlink   \
+       irda        \
+       m2m         \
+       mate        \
+       opcua       \
+       profinet    \
+       sercosiii   \
+       stats_tree  \
+       unistim     \
+       wimax       \
+       wimaxasncp
+
 
 all:
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake PLUGIN_TARGET= process-plugins
@@ -29,57 +48,19 @@ maintainer-clean-local: distclean-local
 checkapi: 
         $(MAKE) -f Makefile.nmake PLUGIN_TARGET=checkapi process-plugins 
 
-process-plugins:
-       cd asn1
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
-       cd ..
-       cd docsis
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
-       cd ..
-       cd ethercat
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
-       cd ..
-       cd giop
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
-       cd ..
-       cd gryphon
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
-       cd ..
-       cd interlink
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
-       cd ..
-       cd irda
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
-       cd ..
-       cd m2m
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
-       cd ..
-       cd mate
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
-       cd ..
-       cd opcua
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
-       cd ..
-       cd profinet
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
-       cd ..
-       cd sercosiii
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
-       cd ..
-       cd stats_tree
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
-       cd ..
-       cd unistim
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
-       cd ..
-       cd wimax
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
-       cd ..
-       cd wimaxasncp
+
+
+process-plugins : $(PLUGIN_LIST) custom
+
+$(PLUGIN_LIST) : _FORCE_   # _FORCE_ req'd since each target actually exists
+       cd $@
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake $(PLUGIN_TARGET)
        cd ..
+
+custom :
        if exist Custom.nmake $(MAKE) /$(MAKEFLAGS) -f Custom.nmake $(PLUGIN_TARGET)
 
+
 ################################################################################
 # copy all plugins to $(INSTALL_DIR)/plugins/$(VERSION), so Wireshark will load them, when
 # started from $(INSTALL_DIR).
@@ -87,26 +68,14 @@ process-plugins:
 
 install-plugins:
 !IFDEF ENABLE_LIBWIRESHARK
-       cd..
-       xcopy plugins\asn1\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
-       xcopy plugins\docsis\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
-       xcopy plugins\ethercat\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
-       xcopy plugins\giop\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
-       xcopy plugins\gryphon\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
-       xcopy plugins\interlink\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
-       xcopy plugins\irda\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
-       xcopy plugins\m2m\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
-       xcopy plugins\mate\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
-       xcopy plugins\opcua\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
-       xcopy plugins\profinet\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
-       xcopy plugins\sercosiii\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
-       xcopy plugins\stats_tree\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
-       xcopy plugins\unistim\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
-       xcopy plugins\wimax\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
-       xcopy plugins\wimaxasncp\*.dll $(INSTALL_DIR)\plugins\$(VERSION) /d
+       cd ..
+       @for %f in ( $(PLUGIN_LIST) ) do xcopy plugins\%f\*.dll  $(INSTALL_DIR)\plugins\$(VERSION) /d
        cd plugins
        if exist Custom.nmake $(MAKE) /$(MAKEFLAGS) -f Custom.nmake install-plugins
 !ENDIF
 
 clean-deps:
        
+####
+_FORCE_:  ## Assumption: no file named _FORCE_ exists in the current directory
+