add work in progress asn2eth generated ldap dissector from AndersB's email of
[obnox/wireshark/wip.git] / asn1 / ldap / Makefile.nmake
diff --git a/asn1/ldap/Makefile.nmake b/asn1/ldap/Makefile.nmake
new file mode 100755 (executable)
index 0000000..b61dd63
--- /dev/null
@@ -0,0 +1,42 @@
+## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake\r
+#\r
+# $Id: Makefile.nmake 13077 2005-01-16 23:26:02Z lroland $\r
+\r
+include ../../config.nmake\r
+\r
+UNIX2DOS=$(PERL) ../../tools/unix2dos.pl\r
+\r
+PROTOCOL_NAME=ldap\r
+DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h\r
+\r
+all: generate_dissector\r
+\r
+generate_dissector: $(DISSECTOR_FILES)\r
+\r
+$(DISSECTOR_FILES): ../../tools/asn2eth.py Lightweight-Directory-Access-Protocol-V3.asn packet-ldap-template.c packet-ldap-template.h ldap.cnf\r
+!IFDEF PYTHON\r
+       $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c ldap.cnf -s packet-ldap-template Lightweight-Directory-Access-Protocol-V3.asn\r
+!ELSE\r
+       @echo Error: You need Python to use asn2eth.py\r
+       @exit 1\r
+!ENDIF\r
+\r
+clean:\r
+       rm -f parsetab.py $(DISSECTOR_FILES)\r
+\r
+# Fix EOL in generated dissectors. Cygwin's python generates files with \r
+# mixed EOL styles, which can't be commited to the SVN repository.\r
+# Stuff included from template and "cnf" files has "\r\n" on windows, while \r
+# the generated stuff has "\n".\r
+\r
+fix_eol: generate_dissector\r
+       move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp\r
+       move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp\r
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c\r
+       $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h\r
+       del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp\r
+\r
+copy_files: generate_dissector fix_eol\r
+       xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y\r
+       xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y\r
+\r