-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
34 lines (22 loc) · 856 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
CFILES=$(wildcard src/*.c)
OFILES=$(patsubst src/%.c,target/%.o,$(CFILES))
GLIB_INCLUDE=/usr/include/glib-2.0
WIRESHARK_INCLUDE=/usr/include/wireshark
GLIBCONFIG_INCLUDE=/usr/lib64/glib-2.0/include
WS_VERSION=$(shell wireshark --version | head -n 1 | egrep -o '[0-9.]+')
INSTALL=/usr/lib64/wireshark/plugins/$(WS_VERSION)
#OPT=-O2
CFLAGS=$(OPT) -g -std=gnu99 -fPIC -D_GNU_SOURCE -Wall -Wno-parentheses -Wno-unused-function -DWITH_TRACE -I$(WIRESHARK_INCLUDE) -I$(GLIB_INCLUDE) -I$(GLIBCONFIG_INCLUDE)
LDFLAGS=-shared -lwiretap
CP=cp
SUDO=sudo
TARGET=remoting.so
all: $(TARGET)
install: all
$(SUDO) $(CP) $(TARGET) $(INSTALL)/$(TARGET)
clean:
$(RM) $(TARGET) target/*.o target/*.c target/*.h
$(TARGET): $(OFILES)
$(CC) $(LDFLAGS) -o $(TARGET) $(OFILES)
target/%.o: src/%.c Makefile
$(CC) -c $(CFLAGS) $(CPPFLAGS) -Iinclude -Itarget $< -o $@