forked from seladb/PcapPlusPlus
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
71 lines (54 loc) · 1.82 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
ifeq ($(wildcard mk/platform.mk),)
$(error platform.mk not found! Please run configure script first)
endif
include mk/platform.mk
COMMONPP_HOME := Common++
PACKETPP_HOME := Packet++
PCAPPP_HOME := Pcap++
EXAMPLE_PROTOCOL_ANALYSIS := Examples/ProtocolAnalysis
UNAME := $(shell uname)
.SILENT:
all: libs
@cd $(EXAMPLE_PROTOCOL_ANALYSIS) && $(MAKE) ProtocolAnalysis
@$(MKDIR) -p Dist/examples
$(CP) $(EXAMPLE_PROTOCOL_ANALYSIS)/Bin/* ./Dist/examples
@echo Finished successfully building PcapPlusPlus
# PcapPlusPlus libs only
libs:
@$(RM) -rf Dist
@cd $(COMMONPP_HOME) && $(MAKE) all
@cd $(PACKETPP_HOME) && $(MAKE) all
@cd $(PCAPPP_HOME) && $(MAKE) all
@$(MKDIR) -p Dist
@$(MKDIR) -p Dist/header
@$(CP) $(COMMONPP_HOME)/Lib/Release/* ./Dist
@$(CP) $(PACKETPP_HOME)/Lib/* ./Dist
@$(CP) $(PCAPPP_HOME)/Lib/* ./Dist
@$(CP) $(COMMONPP_HOME)/header/* ./Dist/header
@$(CP) $(PACKETPP_HOME)/header/* ./Dist/header
@$(CP) $(PCAPPP_HOME)/header/* ./Dist/header
@$(MKDIR) -p Dist/mk
$(CP) mk/PcapPlusPlus.mk ./Dist/mk
@echo Finished successfully building PcapPlusPlus libs
@echo ' '
# Clean
clean:
@cd $(COMMONPP_HOME) && $(MAKE) clean
@cd $(PACKETPP_HOME) && $(MAKE) clean
@cd $(PCAPPP_HOME) && $(MAKE) clean
@cd $(EXAMPLE_PROTOCOL_ANALYSIS) && $(MAKE) clean
@$(RM) -rf Dist
@echo Finished successfully cleaning PcapPlusPlus
ifndef WIN32
INSTALL_DIR=Dist
# Install
install: | $(INSTALL_DIR)
@cd Dist && ../mk/$(INSTALL_SCRIPT)
@echo 'Installation complete!'
# Uninstall
uninstall: | $(INSTALL_DIR)
@cd Dist && ../mk/$(UNINSTALL_SCRIPT)
@echo 'Uninstallation complete!'
$(INSTALL_DIR):
@echo 'Please run make all first' && exit 1
endif