forked from aresrpg/minecraft-dissector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (27 loc) · 878 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
34
CPPFLAGS ?= $(shell pkg-config --cflags wireshark)
CFLAGS ?= -fPIC
LIBDIR ?= $(HOME)/.local/lib
WIRESHARK_PLUGINDIR ?= $(shell pkg-config "--define-variable=libdir=$(LIBDIR)" --variable=plugindir wireshark)
ifeq ($(OS),Windows_NT)
.DEFAULT_GOAL := packet-minecraft.dll
else
.DEFAULT_GOAL := packet-minecraft.so
endif
generated.c: generate.js
node generate.js > $@
packet-minecraft.o: packet-minecraft.c generated.c
packet-minecraft.dll packet-minecraft.so: packet-minecraft.o
$(LINK.o) $^ -shared $(LOADLIBES) $(LDLIBS) -o $@
.PHONY: install-unix
install-unix: packet-minecraft.so
mkdir -p $(WIRESHARK_PLUGINDIR)/epan
cp -p packet-minecraft.so $(WIRESHARK_PLUGINDIR)/epan/minecraft.so
.PHONY: install
ifeq ($(OS),Windows_NT)
install:
else
install: install-unix
endif
.PHONY: clean
clean:
$(RM) generated.c packet-minecraft.o packet-minecraft.so packet-minecraft.dll