Fix for bug 1614:
[obnox/wireshark/wip.git] / asn1 / umts_rrc_ies / 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=umts_rrc_ies
10 DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
11
12 all: generate_dissector
13
14 generate_dissector: $(DISSECTOR_FILES)
15
16 $(DISSECTOR_FILES): ../../tools/asn2wrs.py umts_rrc_InformationElements.asn packet-umts_rrc_ies-template.c packet-umts_rrc_ies-template.h umts_rrc_ies.cnf
17 !IFDEF PYTHON
18         $(PYTHON) "../../tools/asn2wrs.py" -u -e -p $(PROTOCOL_NAME) -c umts_rrc_ies.cnf -s packet-umts_rrc_ies-template umts_rrc_InformationElements.asn
19 !ELSE
20         @echo Error: You need Python to use asn2wrs.py
21         @exit 1
22 !ENDIF
23
24 clean:
25         rm -f parsetab.py parsetab.pyc $(DISSECTOR_FILES)
26
27 # Fix EOL in generated dissectors. Cygwin's python generates files with 
28 # mixed EOL styles, which can't be commited to the SVN repository.
29 # Stuff included from template and "cnf" files has "\r\n" on windows, while 
30 # the generated stuff has "\n".
31
32 fix_eol: generate_dissector
33         move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
34         move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
35         $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
36         $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
37         del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
38
39 copy_files: generate_dissector fix_eol
40         xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
41         xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y
42