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