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