5b1e0fb5cd547cd167659f76a99280a9129cbc40
[obnox/wireshark/wip.git] / asn1 / pkixqualified / 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=pkixqualified
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 PKIXqualified.asn packet-pkixqualified-template.c packet-pkixqualified-template.h pkixqualified.cnf
17 !IFDEF PYTHON
18         $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c pkixqualified.cnf -s packet-pkixqualified-template PKIXqualified.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 $(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
41         xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d