b61f437fdba47992f6cd2d45c63428d0ccd85695
[obnox/wireshark/wip.git] / plugins / v5ua / Makefile.nmake
1 # Makefile.nmake
2 # nmake file for V5UA plugin
3 #
4 # $Id$
5 #
6
7 include ..\..\config.nmake
8
9 ############### no need to modify below this line #########
10
11 include Makefile.common
12
13 CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) \
14         /I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
15
16 LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)
17
18 !IFDEF ENABLE_LIBETHEREAL
19 LINK_PLUGIN_WITH=..\..\epan\libethereal.lib
20 CFLAGS=/DHAVE_WIN32_LIBETHEREAL_LIB /D_NEED_VAR_IMPORT_ $(CFLAGS)
21
22 DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
23
24 OBJECTS=$(DISSECTOR_OBJECTS) plugin.obj
25
26 v5ua.dll v5ua.exp v5ua.lib : $(OBJECTS) $(LINK_PLUGIN_WITH) 
27         link -dll /out:v5ua.dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH)  \
28         $(GLIB_LIBS)
29
30 #
31 # Build plugin.c, which contains the plugin version[] string, a
32 # function plugin_register() that calls the register routines for all
33 # protocols, and a function plugin_reg_handoff() that calls the handoff
34 # registration routines for all protocols.
35 #
36 # We do this by scanning sources.  If that turns out to be too slow,
37 # maybe we could just require every .o file to have an register routine
38 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
39 #
40 # Formatting conventions:  The name of the proto_register_* routines an
41 # proto_reg_handoff_* routines must start in column zero, or must be
42 # preceded only by "void " starting in column zero, and must not be
43 # inside #if.
44 #
45 # DISSECTOR_SRC is assumed to have all the files that need to be scanned.
46 #
47 # For some unknown reason, having a big "for" loop in the Makefile
48 # to scan all the files doesn't work with some "make"s; they seem to
49 # pass only the first few names in the list to the shell, for some
50 # reason.
51 #
52 # Therefore, we have a script to generate the plugin.c file.
53 # The shell script runs slowly, as multiple greps and seds are run
54 # for each input file; this is especially slow on Windows.  Therefore,
55 # if Python is present (as indicated by PYTHON being defined), we run
56 # a faster Python script to do that work instead.
57 #
58 # The first argument is the directory in which the source files live.
59 # The second argument is "plugin", to indicate that we should build
60 # a plugin.c file for a plugin.
61 # All subsequent arguments are the files to scan.
62 #
63 plugin.c: $(DISSECTOR_SRC)
64 !IFDEF PYTHON
65         @echo Making plugin.c (using python)
66         @$(PYTHON) ../../tools/make-dissector-reg.py . plugin $(DISSECTOR_SRC)
67 !ELSE
68         @echo Making plugin.c (using sh)
69         @$(SH) ../../tools/make-dissector-reg . plugin $(DISSECTOR_SRC)
70 !ENDIF
71
72 !ENDIF
73
74 clean:
75         rm -f $(OBJECTS) v5ua.dll v5ua.exp v5ua.lib *.pdb
76
77 distclean: clean
78
79 maintainer-clean: distclean