Allocate correct size of range.
[obnox/wireshark/wip.git] / plugins / Makefile.nmake
index 257920c3272a452b8293245c99c3b180990af738..d90971f4594b0e01b10f0d991bcdef1c118e0b30 100644 (file)
@@ -1,72 +1,79 @@
 #
-# $Id: Makefile.nmake,v 1.19 2003/06/14 20:35:58 guy Exp $
+# $Id$
 #
 
 include ..\config.nmake
 
-############### no need to modify below this line #########
+## To add a plugin: Add entry to PLUGIN_LIST
 
-CFLAGS=/DHAVE_CONFIG_H /I.. /I../wiretap /I. $(GLIB_CFLAGS) \
-       /I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
+PLUGIN_LIST = \
+       asn1        \
+       docsis      \
+       ethercat    \
+       giop        \
+       gryphon     \
+       interlink   \
+       irda        \
+       m2m         \
+       mate        \
+       opcua       \
+       profinet    \
+       sercosiii   \
+       stats_tree  \
+       unistim     \
+       wimax       \
+       wimaxasncp
 
-OBJECTS=plugin_api.obj 
 
-all: plugin_api.obj artnet docsis giop gryphon megaco mgcp pcli rtnet
+all:
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake PLUGIN_TARGET= process-plugins
 
-artnet:: 
-       cd artnet
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
-       cd ..
+clean: clean-local
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake PLUGIN_TARGET=clean process-plugins
 
-docsis::
-       cd docsis
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
-       cd .. 
+distclean: distclean-local
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake PLUGIN_TARGET=distclean process-plugins
 
-giop::
-       cd giop
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
-       cd .. 
+maintainer-clean: maintainer-clean-local
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake PLUGIN_TARGET=maintainer-clean process-plugins
 
-gryphon::
-       cd gryphon
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
-       cd ..
 
-megaco::
-       cd megaco
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
-       cd .. 
+clean-local:
+       rm -rf $(VERSION)
+
+distclean-local: clean-local
+
+maintainer-clean-local: distclean-local
+
+checkapi:
+       $(MAKE) -f Makefile.nmake PLUGIN_TARGET=checkapi process-plugins 
 
-mgcp::
-       cd mgcp
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
-       cd .. 
 
-pcli:: 
-       cd pcli
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
-       cd ..
 
-rtnet:: 
-       cd rtnet
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
+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 ..
 
-clean:
-       rm -f plugin_api.obj $(PDB_FILE)
-       cd artnet
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
-       cd ../docsis
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
-       cd ../giop
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
-       cd ../gryphon
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
-       cd ../megaco
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
-       cd ../mgcp
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
-       cd ../pcli
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
+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).
+################################################################################
+
+install-plugins:
+!IFDEF ENABLE_LIBWIRESHARK
        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
+
+####
+_FORCE_:  ## Assumption: no file named _FORCE_ exists in the current directory
+