new Q.932 and QSIG dissectors
[obnox/wireshark/wip.git] / asn1 / q932 / 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=q932
10 Q932_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h 
11 Q932_ROS_FILES=packet-$(PROTOCOL_NAME)-ros.c packet-$(PROTOCOL_NAME)-ros.h 
12 DISSECTOR_FILES=$(Q932_FILES) $(Q932_ROS_FILES)
13 Q932_ASN=Addressing-Data-Elements.asn Network-Facility-Extension.asn Network-Protocol-Profile-component.asn Interpretation-component.asn
14
15 all: generate_dissector
16
17 generate_dissector: $(DISSECTOR_FILES)
18
19 $(Q932_FILES): ../../tools/asn2wrs.py $(Q932_ASN) packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h $(PROTOCOL_NAME).cnf
20 !IFDEF PYTHON
21         $(PYTHON) "../../tools/asn2wrs.py" -b -T -e -p $(PROTOCOL_NAME) -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template $(Q932_ASN)
22 !ELSE
23         @echo Error: You need Python to use asn2wrs.py
24         @exit 1
25 !ENDIF
26
27 $(Q932_ROS_FILES): ../../tools/asn2wrs.py q932-ros.asn packet-$(PROTOCOL_NAME)-ros-template.c packet-$(PROTOCOL_NAME)-ros-template.h $(PROTOCOL_NAME)-ros.cnf
28 !IFDEF PYTHON
29         $(PYTHON) "../../tools/asn2wrs.py" -b -T -p $(PROTOCOL_NAME).ros -c $(PROTOCOL_NAME)-ros.cnf -o $(PROTOCOL_NAME)-ros -s packet-$(PROTOCOL_NAME)-ros-template q932-ros.asn
30 !ELSE
31         @echo Error: You need Python to use asn2wrs.py
32         @exit 1
33 !ENDIF
34
35 clean:
36         rm -f parsetab.py parsetab.pyc $(DISSECTOR_FILES)
37
38 distclean: clean
39
40 maintainer-clean: distclean
41
42 # Fix EOL in generated dissectors. Cygwin's python generates files with 
43 # mixed EOL styles, which can't be commited to the SVN repository.
44 # Stuff included from template and "cnf" files has "\r\n" on windows, while 
45 # the generated stuff has "\n".
46
47 fix_eol: generate_dissector
48         move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
49         move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
50         move packet-$(PROTOCOL_NAME)-ros.c packet-$(PROTOCOL_NAME)-ros.c.tmp
51         move packet-$(PROTOCOL_NAME)-ros.h packet-$(PROTOCOL_NAME)-ros.h.tmp
52         $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
53         $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
54         $(UNIX2DOS) < packet-$(PROTOCOL_NAME)-ros.c.tmp > packet-$(PROTOCOL_NAME)-ros.c
55         $(UNIX2DOS) < packet-$(PROTOCOL_NAME)-ros.h.tmp > packet-$(PROTOCOL_NAME)-ros.h
56         del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp  packet-$(PROTOCOL_NAME)-ros.c.tmp packet-$(PROTOCOL_NAME)-ros.h.tmp
57
58 copy_files: generate_dissector fix_eol
59         xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
60         xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
61         xcopy packet-$(PROTOCOL_NAME)-ros.c ..\..\epan\dissectors /d /y
62         xcopy packet-$(PROTOCOL_NAME)-ros.h ..\..\epan\dissectors /d /y