4845743b4c4fd8c8a4b200e8138e4c531054c414
[obnox/wireshark/wip.git] / asn1 / rtse / 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=rtse
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/asn2eth.py $(PROTOCOL_NAME).asn packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h $(PROTOCOL_NAME).cnf
17 !IFDEF PYTHON
18         $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template $(PROTOCOL_NAME).asn
19 !ELSE
20         @echo Error: You need Python to use asn2eth.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