Whamcloud - gitweb
LU-1434 utils: Update Makefile to work out of the box
[fs/lustre-release.git] / lustre / contrib / wireshark / Makefile
1 # Modify to point to your Wireshark and glib include directories
2 #INCS = -I$(HOME)/wireshark-1.6.8 `pkg-config --libs --cflags glib-2.0`
3 INCS = `pkg-config --libs --cflags wireshark`
4
5 SRCS_LNET = packet-lnet.c
6 SRCS_LUSTRE = packet-lustre.c
7
8 CC   = gcc
9
10 OBJS_LNET = $(foreach src, $(SRCS_LNET), $(src:.c=.o))
11 OBJS_LUSTRE = $(foreach src, $(SRCS_LUSTRE), $(src:.c=.o))
12
13 PLUGINS=lnet.so lustre.so
14
15 ifeq ($(shell id -u), 0)
16 WS_CONFIG=$(shell pkg-config --variable=includedir wireshark)/wireshark/config.h
17 WS_VERSION:=$(shell sed "s/^.define VERSION //p;d" ${WS_CONFIG})
18 PLUGIN_DIR = /usr/local/lib/wireshark/plugins/$(WS_VERSION)
19 else
20 PLUGIN_DIR = ${HOME}/.wireshark/plugins
21 endif
22
23 CFLAGS = -DHAVE_CONFIG_H $(INCS) -DINET6 -D_U_=__attribute__\(\(unused\)\) -Wall -Wpointer-arith -g -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -fPIC -DPIC
24
25 all: $(PLUGINS)
26
27 lustre.so: $(OBJS_LUSTRE)
28         $(CC) -shared $(OBJS_LUSTRE) -o $@
29
30 lnet.so: $(OBJS_LNET)
31         $(CC) -shared $(OBJS_LNET) -o $@
32
33 install: $(PLUGINS)
34         mkdir -p $(PLUGIN_DIR)
35         install $(PLUGINS) $(PLUGIN_DIR)/
36
37 clean:
38         rm -f $(PLUGINS) $(OBJS_LNET) $(OBJS_LUSTRE)
39
40 extraclean: clean
41         (cd $(PLUGIN_DIR)/; rm -f $(PLUGINS))