When using Cygwin's python asn2eth.py
authorlroland <lroland@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 16 Jan 2005 23:26:02 +0000 (23:26 +0000)
committerlroland <lroland@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 16 Jan 2005 23:26:02 +0000 (23:26 +0000)
generates dissectors with mixed EOL! SVN doesn't allow you to commit such files.
Add a target to all nmake makefiles in asn1 subdirectory which will fix these files.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13077 f5534014-38df-0310-8fa8-9805f1628bb7

27 files changed:
asn1/MAP_Dialogue/Makefile.nmake
asn1/cmip/Makefile.nmake
asn1/cms/Makefile.nmake
asn1/ess/Makefile.nmake
asn1/gsmmap/Makefile.nmake
asn1/h225/Makefile.nmake
asn1/h235/Makefile.nmake
asn1/h245/Makefile.nmake
asn1/h248/Makefile.nmake
asn1/h450/Makefile.nmake
asn1/logotype-cert-extn/Makefile.nmake
asn1/ns-cert-exts/Makefile.nmake
asn1/ocsp/Makefile.nmake
asn1/pkcs1/Makefile.nmake
asn1/pkinit/Makefile.nmake
asn1/pkix1explicit/Makefile.nmake
asn1/pkix1implicit/Makefile.nmake
asn1/pkixcmp/Makefile.nmake
asn1/pkixcrmf/Makefile.nmake
asn1/pkixproxy/Makefile.nmake
asn1/pkixqualified/Makefile.nmake
asn1/pkixtsp/Makefile.nmake
asn1/smrse/Makefile.nmake
asn1/x509af/Makefile.nmake
asn1/x509ce/Makefile.nmake
asn1/x509if/Makefile.nmake
asn1/x509sat/Makefile.nmake

index 9d55fba1d36ddc9fd1954933d1515ef546f7f00a..7dae1f33377e9d826a012cf37c391cef354f9c7b 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-MAP_DialoguePDU.c packet-MAP_DialoguePDU.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=MAP_DialoguePDU
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,28 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py MAP_DialoguePDU.asn packet-MAP-DialoguePDU-template.c packet-MAP-DialoguePDU-template.h MAP_DialoguePDU.cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p MAP_DialoguePDU -c MAP_DialoguePDU.cnf -s packet-MAP-DialoguePDU-template MAP_DialoguePDU.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c MAP_DialoguePDU.cnf -s packet-MAP-DialoguePDU-template MAP_DialoguePDU.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-MAP_DialoguePDU.c ..\..\epan\dissectors /d /y
-       xcopy packet-MAP_DialoguePDU.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
+
index 80708b4b2f898e69bea078f6888146a6ea1f6d1d..a1a7cef509910647c531987774eb916070d71726 100644 (file)
@@ -4,20 +4,38 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-cmip.c packet-cmip.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=cmip
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
 generate_dissector: $(DISSECTOR_FILES)
 
-$(DISSECTOR_FILES): ../../tools/asn2eth.py CMIP.asn packet-cmip-template.c packet-cmip-template.h cmip.cnf 
+$(DISSECTOR_FILES): ../../tools/asn2eth.py CMIP.asn packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h $(PROTOCOL_NAME).cnf 
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p cmip -c cmip.cnf -s packet-cmip-template CMIP.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template CMIP.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
-       rm -f cmip-exp.cnf parsetab.py $(DISSECTOR_FILES)
+       rm -f $(PROTOCOL_NAME)-exp.cnf parsetab.py $(DISSECTOR_FILES)
+
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
 
-copy_files: generate_dissector
-       xcopy packet-cmip.c ..\..\epan\dissectors /d /y
-       xcopy packet-cmip.h ..\..\epan\dissectors /d /y
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
index 8f159a034eaa4d9ca1a91418128b5aa9b10072ff..4bbaef8195a5cd059678d6256b01018068949a7c 100644 (file)
@@ -4,20 +4,39 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-cms.c packet-cms.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=cms
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
 generate_dissector: $(DISSECTOR_FILES)
 
-$(DISSECTOR_FILES): ../../tools/asn2eth.py CryptographicMessageSyntax.asn packet-cms-template.c packet-cms-template.h cms.cnf
+$(DISSECTOR_FILES): ../../tools/asn2eth.py CryptographicMessageSyntax.asn packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h $(PROTOCOL_NAME).cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p cms -c cms.cnf -s packet-cms-template CryptographicMessageSyntax.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template CryptographicMessageSyntax.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-cms.c ..\..\epan\dissectors /d /y
-       xcopy packet-cms.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
+
index c4b08582a42c93055f78c00a1e2a9027d016f1fc..acc6e626bfecffefe4f5fb2e57451e94cb049719 100644 (file)
@@ -4,15 +4,21 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-ess.c packet-ess.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=ess
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
 generate_dissector: $(DISSECTOR_FILES)
 
-$(DISSECTOR_FILES): ../../tools/asn2eth.py ExtendedSecurityServices.asn packet-ess-template.c packet-ess-template.h ess.cnf
+$(DISSECTOR_FILES): ../../tools/asn2eth.py ExtendedSecurityServices.asn packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h $(PROTOCOL_NAME).cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -k -e -p ess -c ess.cnf -s packet-ess-template ExtendedSecurityServices.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -k -e -p $(PROTOCOL_NAME) -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template ExtendedSecurityServices.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
@@ -24,6 +30,19 @@ clean:
                packet-ess-ett.c        \
                packet-ess-hf.c
 
-copy_files: generate_dissector
-       xcopy packet-ess.c ..\..\epan\dissectors /d /y
-       xcopy packet-ess.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
+
index e77368dfb99daa1cf89555aad8a3106044613cb2..bb8acd22e935d9a5464b6606ea819cee93ef218d 100644 (file)
@@ -4,20 +4,38 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-gsm_map.c packet-gsm_map.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=gsm_map
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
 generate_dissector: $(DISSECTOR_FILES)
 
-$(DISSECTOR_FILES): ../../tools/asn2eth.py GSMMAP.asn packet-gsm_map-template.c packet-gsm_map-template.h gsmmap.cnf 
+$(DISSECTOR_FILES): ../../tools/asn2eth.py GSMMAP.asn packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h gsmmap.cnf 
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p gsm_map -c gsmmap.cnf -s packet-gsm_map-template GSMMAP.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c gsmmap.cnf -s packet-$(PROTOCOL_NAME)-template GSMMAP.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-gsm_map.c ..\..\epan\dissectors /d /y
-       xcopy packet-gsm_map.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
index 9f9fd428e7b31fd3b0f974e9e0202e414973afc4..1e114438dae723a7c17ac8919ce219b0f70f8ef7 100644 (file)
@@ -4,20 +4,39 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-h225.c packet-h225.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=h225
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
 generate_dissector: $(DISSECTOR_FILES)
 
-$(DISSECTOR_FILES): ../../tools/asn2eth.py h225.asn h225.cnf packet-h225-template.c packet-h225-template.h
+$(DISSECTOR_FILES): ../../tools/asn2eth.py $(PROTOCOL_NAME).asn $(PROTOCOL_NAME).cnf packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -e -p h225 -c h225.cnf -s packet-h225-template h225.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -e -p $(PROTOCOL_NAME) -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template $(PROTOCOL_NAME).asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-h225.c ..\..\epan\dissectors /d /y
-       xcopy packet-h225.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
+
index 267ec64aea7bd11b41d662c40baaa80b96e590be..ffe13fabd9c31dfe81cb64347885b11128b6894c 100644 (file)
@@ -4,20 +4,38 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-h235.c packet-h235.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=h235
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
 generate_dissector: $(DISSECTOR_FILES)
 
-$(DISSECTOR_FILES): ../../tools/asn2eth.py packet-h235-template.c packet-h235-template.h h235.cnf
+$(DISSECTOR_FILES): ../../tools/asn2eth.py H235-SECURITY-MESSAGES.asn packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h $(PROTOCOL_NAME).cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -p h235 -c h235.cnf -s packet-h235-template H235-SECURITY-MESSAGES.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -p $(PROTOCOL_NAME) -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template H235-SECURITY-MESSAGES.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-h235.c ..\..\epan\dissectors /d /y
-       xcopy packet-h235.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
index d7dfb3c4b396bad7032325968a6d91777d613c13..400f472d6c492e3cdd85b075d3e5c1e65cabbb2c 100644 (file)
@@ -4,20 +4,39 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-h245.c packet-h245.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=h245
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
 generate_dissector: $(DISSECTOR_FILES)
 
-$(DISSECTOR_FILES): ../../tools/asn2eth.py packet-h245-template.c packet-h245-template.h h245.cnf
+$(DISSECTOR_FILES): ../../tools/asn2eth.py $(PROTOCOL_NAME).asn $(PROTOCOL_NAME).cnf packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -e -p h245 -c h245.cnf -s packet-h245-template h245.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -e -p $(PROTOCOL_NAME) -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template $(PROTOCOL_NAME).asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-h245.c ..\..\epan\dissectors /d /y
-       xcopy packet-h245.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
+
index f98043df7b5935e9d0c5fa1dfc48e468bc68725a..42e34f8a687a155fb157062eadfc90ce107309af 100644 (file)
@@ -4,20 +4,38 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-h248.c packet-h248.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=h248
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
 generate_dissector: $(DISSECTOR_FILES)
 
-$(DISSECTOR_FILES): ../../tools/asn2eth.py MEGACO.asn packet-h248-template.c packet-h248-template.h h248.cnf 
+$(DISSECTOR_FILES): ../../tools/asn2eth.py MEGACO.asn packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h $(PROTOCOL_NAME).cnf 
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p h248 -c h248.cnf -s packet-h248-template MEGACO.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template MEGACO.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-h248.c ..\..\epan\dissectors /d /y
-       xcopy packet-h248.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
index da194d937947e9c517b9dcfae5a38aba3e44555c..4fb66bf24f8e52b9e85eb8ed04e219f40b220cb0 100644 (file)
@@ -4,20 +4,38 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-h450.c packet-h450.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=h450
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
 generate_dissector: $(DISSECTOR_FILES)
 
-$(DISSECTOR_FILES): ../../tools/asn2eth.py h4501.asn packet-h450-template.c packet-h450-template.h h450.cnf
+$(DISSECTOR_FILES): ../../tools/asn2eth.py h4501.asn packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h $(PROTOCOL_NAME).cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p h450 -c h450.cnf -s packet-h450-template h4501.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template h4501.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-h450.c ..\..\epan\dissectors /d /y
-       xcopy packet-h450.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
index faf3259d46131c0240b4ef6f53ba5f6022252b45..ffc4e31a024984b3057532882cb72ef72a01a832 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-logotypecertextn.c packet-logotypecertextn.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=logotypecertextn
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,27 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py LogotypeCertExtn.asn packet-logotype-cert-extn-template.c packet-logotype-cert-extn-template.h logotype-cert-extn.cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p logotypecertextn -c logotype-cert-extn.cnf -s packet-logotype-cert-extn-template LogotypeCertExtn.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c logotype-cert-extn.cnf -s packet-logotype-cert-extn-template LogotypeCertExtn.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-logotypecertextn.c ..\..\epan\dissectors /d /y
-       xcopy packet-logotypecertextn.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
index 10446c8ee72b0c7deb3ab531d05fcc6d0a14e120..ae05400ad9817bd52062e838ccc8a05b35395736 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-ns_cert_exts.c packet-ns_cert_exts.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=ns_cert_exts
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,27 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py NETSCAPE-CERT-EXTS.asn packet-ns_cert_exts-template.c packet-ns_cert_exts-template.h ns_cert_exts.cnf 
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p ns_cert_exts -c ns_cert_exts.cnf -s packet-ns_cert_exts-template NETSCAPE-CERT-EXTS.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c ns_cert_exts.cnf -s packet-ns_cert_exts-template NETSCAPE-CERT-EXTS.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-ns_cert_exts.c ..\..\epan\dissectors /d /y
-       xcopy packet-ns_cert_exts.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
index 074085770f0e4a3081ff00c02dfdae1226a2d48a..c50053a05e75a3ed2f3b658d8d3385d6f48923a5 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-ocsp.c packet-ocsp.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=ocsp
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,27 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py OCSP.asn packet-ocsp-template.c packet-ocsp-template.h ocsp.cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p ocsp -c ocsp.cnf -s packet-ocsp-template OCSP.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c ocsp.cnf -s packet-ocsp-template OCSP.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-ocsp.c ..\..\epan\dissectors /d /y
-       xcopy packet-ocsp.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
index 9283c6ee2f020c60f71344f478af1c271b621c77..d10630d8785b9d0db9d5840594ac631d9566c475 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-pkcs1.c packet-pkcs1.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=pkcs1
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,28 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py PKCS1.asn packet-pkcs1-template.c packet-pkcs1-template.h pkcs1.cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -p pkcs1 -c pkcs1.cnf -s packet-pkcs1-template PKCS1.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -p $(PROTOCOL_NAME) -c pkcs1.cnf -s packet-pkcs1-template PKCS1.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-pkcs1.c ..\..\epan\dissectors /d /y
-       xcopy packet-pkcs1.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
+
index 8d6106ebdb8e6c77ea8cc9bd779e7fced4517938..c3f55d86382c490d9c76325708151659a03430ee 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-pkinit.c packet-pkinit.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=pkinit
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,27 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py PKINIT.asn packet-pkinit-template.c packet-pkinit-template.h pkinit.cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -e -X -b -p pkinit -c pkinit.cnf -s packet-pkinit-template PKINIT.asn
+       $(PYTHON) ../../tools/asn2eth.py -e -X -b -p $(PROTOCOL_NAME) -c pkinit.cnf -s packet-pkinit-template PKINIT.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-pkinit.c ..\..\epan\dissectors /d /y
-       xcopy packet-pkinit.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
index 9d4ca6f483df5bb0402dc64a917d110ccd4caaab..19e15b6de2786b1d2ecaab29d49281609c7e8e98 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-pkix1explicit.c packet-pkix1explicit.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=pkix1explicit
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,27 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py PKIX1EXPLICIT93.asn packet-pkix1explicit-template.c packet-pkix1explicit-template.h pkix1explicit.cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -e -X -b -p pkix1explicit -c pkix1explicit.cnf -s packet-pkix1explicit-template PKIX1EXPLICIT93.asn 
+       $(PYTHON) ../../tools/asn2eth.py -e -X -b -p $(PROTOCOL_NAME) -c pkix1explicit.cnf -s packet-pkix1explicit-template PKIX1EXPLICIT93.asn 
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-pkix1explicit.c ..\..\epan\dissectors /d /y
-       xcopy packet-pkix1explicit.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
index 09822cbadb117e9dac62a5729a90319d6fc68b03..9320168abefdd81269b1577baae34e5d8b9f8370 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-pkix1implicit.c packet-pkix1implicit.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=pkix1implicit
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,28 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py PKIX1IMPLICIT93.asn packet-pkix1implicit-template.c packet-pkix1implicit-template.h pkix1implicit.cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -e -X -b -p pkix1implicit -c pkix1implicit.cnf -s packet-pkix1implicit-template PKIX1IMPLICIT93.asn 
+       $(PYTHON) ../../tools/asn2eth.py -e -X -b -p $(PROTOCOL_NAME) -c pkix1implicit.cnf -s packet-pkix1implicit-template PKIX1IMPLICIT93.asn 
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-pkix1implicit.c ..\..\epan\dissectors /d /y
-       xcopy packet-pkix1implicit.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
+
index 2c924d00614f320b3b8c5888d95a6efcee404904..fc5970ec6b55016988e91560105601b752686f22 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-cmp.c packet-cmp.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=cmp
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,28 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py CMP.asn packet-cmp-template.c packet-cmp-template.h cmp.cnf 
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p cmp -c cmp.cnf -s packet-cmp-template CMP.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c cmp.cnf -s packet-cmp-template CMP.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-cmp.c ..\..\epan\dissectors /d /y
-       xcopy packet-cmp.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
+
index 6780cfa83fd608e325fd9aced4b9640a663eeda9..d0b3c4b4f4fa3761dde499f6a2ba8e28f112fabc 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-crmf.c packet-crmf.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=crmf
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,28 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py CRMF.asn packet-crmf-template.c packet-crmf-template.h crmf.cnf 
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p crmf -c crmf.cnf -s packet-crmf-template CRMF.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c crmf.cnf -s packet-crmf-template CRMF.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-crmf.c ..\..\epan\dissectors /d /y
-       xcopy packet-crmf.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
+
index fde7294aa2cb3c9901cc61de76450d1c9ef50fed..642f8525a2e67acd5886e073e53e1f74963e1146 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-pkixproxy.c packet-pkixproxy.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=pkixproxy
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,27 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py PKIXProxy.asn packet-pkixproxy-template.c packet-pkixproxy-template.h pkixproxy.cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p pkixproxy -c pkixproxy.cnf -s packet-pkixproxy-template PKIXProxy.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c pkixproxy.cnf -s packet-pkixproxy-template PKIXProxy.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-pkixproxy.c ..\..\epan\dissectors /d /y
-       xcopy packet-pkixproxy.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
index 3cfa578ee837bc8a98d2383a12b13854b232b43d..c26ec28919d6dd4d24c502af3c9e50b682ff7b62 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-pkixqualified.c packet-pkixqualified.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=pkixqualified
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,27 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py PKIXqualified.asn packet-pkixqualified-template.c packet-pkixqualified-template.h pkixqualified.cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p pkixqualified -c pkixqualified.cnf -s packet-pkixqualified-template PKIXqualified.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c pkixqualified.cnf -s packet-pkixqualified-template PKIXqualified.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-pkixqualified.c ..\..\epan\dissectors /d /y
-       xcopy packet-pkixqualified.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
index f99021f00f3e22b8d83e79f4c29f7a7953635e32..1f50c6edcb43a94bcb06358cd835464d38e007db 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-pkixtsp.c packet-pkixtsp.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=pkixtsp
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,27 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py PKIXTSP.asn packet-pkixtsp-template.c packet-pkixtsp-template.h pkixtsp.cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p pkixtsp -c pkixtsp.cnf -s packet-pkixtsp-template PKIXTSP.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c pkixtsp.cnf -s packet-pkixtsp-template PKIXTSP.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-pkixtsp.c ..\..\epan\dissectors /d /y
-       xcopy packet-pkixtsp.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
index 5f518296f15bf6822d9bc740ccd377bb2c792321..6e60e65b4e666e1da46f1c6d12a6fb4d4c682783 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-smrse.c packet-smrse.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=smrse
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,27 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py SMRSE.asn packet-smrse-template.c packet-smrse-template.h smrse.cnf 
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p smrse -c smrse.cnf -s packet-smrse-template SMRSE.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c smrse.cnf -s packet-smrse-template SMRSE.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-smrse.c ..\..\epan\dissectors /d /y
-       xcopy packet-smrse.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
index a9d551246cc551958971270f287bd661563f82d9..1e14d4f63d54d1df5c195430dbde957d1a7d1c31 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-x509af.c packet-x509af.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=x509af
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,27 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py AuthenticationFramework.asn packet-x509af-template.c packet-x509af-template.h x509af.cnf ../x509if/x509if-exp.cnf ../x509sat/x509sat-exp.cnf ../x509ce/x509ce-exp.cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p x509af -c x509af.cnf -s packet-x509af-template AuthenticationFramework.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c x509af.cnf -s packet-x509af-template AuthenticationFramework.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-x509af.c ..\..\epan\dissectors /d /y
-       xcopy packet-x509af.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
index aa7ef73506e5b1f3d9ac566c2a2506aa5c3f328f..4887b45b363fd85fe0f2b6ec4ba24c2e70ad9431 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-x509ce.c packet-x509ce.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=x509ce
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,28 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py CertificateExtensions.asn packet-x509ce-template.c packet-x509ce-template.h x509ce.cnf ../x509if/x509if-exp.cnf ../x509sat/x509sat-exp.cnf ../x509af/x509af-exp.cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p x509ce -c x509ce.cnf -s packet-x509ce-template CertificateExtensions.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c x509ce.cnf -s packet-x509ce-template CertificateExtensions.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-x509ce.c ..\..\epan\dissectors /d /y
-       xcopy packet-x509ce.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
+
index 262f4657b3bbf6418d4fbaf7b46597650bcd68ad..2d562986b4c2f9c7947c2b52fb3a9e7f5c41e2b2 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-x509if.c packet-x509if.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=x509if
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,27 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py InformationFramework.asn packet-x509if-template.c packet-x509if-template.h x509if.cnf ../x509sat/x509sat-exp.cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p x509if -c x509if.cnf -s packet-x509if-template InformationFramework.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c x509if.cnf -s packet-x509if-template InformationFramework.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-x509if.c ..\..\epan\dissectors /d /y
-       xcopy packet-x509if.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
index d9260a35f515a16a3fa05e7797ce66629a1ef2e5..25d633f0f147e1175bd6b8d6ab8fccd695fc9c2e 100644 (file)
@@ -4,7 +4,10 @@
 
 include ../../config.nmake
 
-DISSECTOR_FILES=packet-x509sat.c packet-x509sat.h
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
+
+PROTOCOL_NAME=x509sat
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
 
 all: generate_dissector
 
@@ -12,12 +15,28 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py SelectedAttributeTypes.asn packet-x509sat-template.c packet-x509sat-template.h x509sat.cnf ../x509if/x509if-exp.cnf
 !IFDEF PYTHON
-       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p x509sat -c x509sat.cnf -s packet-x509sat-template SelectedAttributeTypes.asn
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c x509sat.cnf -s packet-x509sat-template SelectedAttributeTypes.asn
+!ELSE
+       @echo Error: You need Python to use asn2eth.py
+       @exit 1
 !ENDIF
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
 
-copy_files: generate_dissector
-       xcopy packet-x509sat.c ..\..\epan\dissectors /d /y
-       xcopy packet-x509sat.h ..\..\epan\dissectors /d /y
+# Fix EOL in generated dissectors. Cygwin's python generates files with 
+# mixed EOL styles, which can't be commited to the SVN repository.
+# Stuff included from template and "cnf" files has "\r\n" on windows, while 
+# the generated stuff has "\n".
+
+fix_eol: generate_dissector
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
+
+copy_files: generate_dissector fix_eol
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
+