new Q.932 and QSIG dissectors
[obnox/wireshark/wip.git] / asn1 / qsig / Makefile.nmake
1 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
2 #
3 # $Id$
4
5 include ../../config.nmake
6
7 UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
8
9 PROTOCOL_NAME=qsig
10 DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
11 QSIG_ASN=qsig-gf-ext.asn qsig-gf-gp.asn qsig-gf-ade.asn qsig-na.asn qsig-cf.asn
12
13 all: generate_dissector
14
15 generate_dissector: $(DISSECTOR_FILES)
16
17 $(DISSECTOR_FILES): ../../tools/asn2wrs.py $(QSIG_ASN) packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h $(PROTOCOL_NAME).cnf
18 !IFDEF PYTHON
19         $(PYTHON) "../../tools/asn2wrs.py" -b -T -e -p $(PROTOCOL_NAME) -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template $(QSIG_ASN)
20 !ELSE
21         @echo Error: You need Python to use asn2wrs.py
22         @exit 1
23 !ENDIF
24
25 clean:
26         rm -f parsetab.py parsetab.pyc $(DISSECTOR_FILES)
27
28 distclean: clean
29
30 maintainer-clean: distclean
31
32 # Fix EOL in generated dissectors. Cygwin's python generates files with 
33 # mixed EOL styles, which can't be commited to the SVN repository.
34 # Stuff included from template and "cnf" files has "\r\n" on windows, while 
35 # the generated stuff has "\n".
36
37 fix_eol: generate_dissector
38         move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
39         move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
40         $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
41         $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
42         del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
43
44 copy_files: generate_dissector fix_eol
45         xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
46         xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
47