forked from kismetwireless/kismet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
332 lines (264 loc) · 12.1 KB
/
Makefile.in
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
include Makefile.inc
CONFIGFILES = \
kismet.conf \
kismet_httpd.conf \
kismet_alerts.conf \
kismet_memory.conf
# Common pure-c code for capturesource binaries
DATASOURCE_COMMON_C_O = \
msgpuck.c.o msgpuck_hints.c.o \
simple_ringbuf_c.c.o msgpuck_buffer.c.o \
simple_datasource_proto.c.o capture_framework.c.o
DATASOURCE_COMMON_A = libkismetdatasource.a
CAPTURE_PCAPFILE_O = \
capture_pcapfile.c.o
CAPTURE_PCAPFILE = kismet_cap_pcapfile
BUILD_CAPTURE_PCAPFILE = @BUILD_CAPTURE_PCAPFILE@
CAPTURE_LINUX_WIFI_O = \
interface_control.c.o linux_wireless_control.c.o linux_netlink_control.c.o \
wifi_ht_channels.c.o \
capture_linux_wifi.c.o
CAPTURE_LINUX_WIFI = kismet_cap_linux_wifi
BUILD_CAPTURE_LINUX_WIFI = @BUILD_CAPTURE_LINUX_WIFI@
CAPTURE_HACKRF_SWEEP_O = \
capture_hackrf_sweep.c.o
CAPTURE_HACKRF_SWEEP = kismet_cap_hackrf_sweep
BUILD_CAPTURE_HACKRF_SWEEP = @BUILD_CAPTURE_HACKRF_SWEEP@
# Capture binaries to build
DATASOURCE_BINS = @DATASOURCE_BINS@
KAITAI_PARSERS = \
kaitai_parsers/wpaeap.cc.o kaitai_parsers/ie221.cc.o
PSO = util.cc.o cygwin_utils.cc.o globalregistry.cc.o \
pollabletracker.cc.o ringbuf2.cc.o chainbuf.cc.o buffer_handler.cc.o \
packet.cc.o messagebus.cc.o configfile.cc.o getopt.cc.o filtercore.cc.o \
psutils.cc.o battery.cc.o kismet_json.cc.o \
tcpserver2.cc.o tcpclient2.cc.o serialclient2.cc.o pipeclient.cc.o ipc_remote2.cc.o \
datasourcetracker.cc.o kis_datasource.cc.o \
kis_net_microhttpd.cc.o system_monitor.cc.o base64.cc.o \
kis_httpd_websession.cc.o kis_httpd_registry.cc.o \
gpstracker.cc.o kis_gps.cc.o gpsserial2.cc.o gpsgpsd2.cc.o gpsfake.cc.o gpsweb.cc.o \
packetchain.cc.o \
trackedelement.cc.o entrytracker.cc.o \
tracked_location.cc.o devicetracker_component.cc.o \
msgpack_adapter.cc.o xmlserialize_adapter.cc.o json_adapter.cc.o \
plugintracker.cc.o alertracker.cc.o timetracker.cc.o channeltracker2.cc.o \
devicetracker.cc.o devicetracker_workers.cc.o devicetracker_httpd.cc.o \
statealert.cc.o \
kis_dlt.cc.o kis_dlt_ppi.cc.o kis_dlt_radiotap.cc.o \
kaitaistream.cc.o \
$(KAITAI_PARSERS) \
phy_80211.cc.o phy_80211_dissectors.cc.o phy_rtl433.cc.o phy_zwave.cc.o \
kis_dissector_ipdata.cc.o \
manuf.cc.o \
dumpfile.cc.o dumpfile_pcap.cc.o \
messagebus_restclient.cc.o \
streamtracker.cc.o \
pcapng_stream_ringbuf.cc.o streambuf_stream_buffer.cc.o \
devicetracker_httpd_pcap.cc.o phy_80211_httpd_pcap.cc.o \
kismet_server.cc.o
PS = kismet
ALL = Makefile $(PS) $(DATASOURCE_BINS)
INSTBINS = $(PS) $(DATASOURCE_BINS)
all: $(ALL)
all-with-plugins:
@make plugins-clean
@make all
@make plugins
$(PS): $(PSO) $(patsubst %c.o,%c.d,$(PSO))
$(LD) $(LDFLAGS) -o $(PS) $(PSO) $(LIBS) $(CXXLIBS) $(PCAPLIBS) $(KSLIBS)
$(DATASOURCE_COMMON_A): $(DATASOURCE_COMMON_C_O)
$(AR) rcs $(DATASOURCE_COMMON_A) $(DATASOURCE_COMMON_C_O)
$(CAPTURE_PCAPFILE): $(CAPTURE_PCAPFILE_O) $(DATASOURCE_COMMON_A)
$(CC) $(LDFLAGS) -o $(CAPTURE_PCAPFILE) $(CAPTURE_PCAPFILE_O) $(DATASOURCE_COMMON_A) $(PCAPLIBS) -lpthread
$(CAPTURE_LINUX_WIFI): $(CAPTURE_LINUX_WIFI_O) $(DATASOURCE_COMMON_A)
$(CC) $(LDFLAGS) -o $(CAPTURE_LINUX_WIFI) $(CAPTURE_LINUX_WIFI_O) $(DATASOURCE_COMMON_A) $(PCAPLIBS) -lpthread -lm $(NMLIBS) $(NETLINKLIBS)
$(CAPTURE_HACKRF_SWEEP): $(CAPTURE_HACKRF_SWEEP_O) $(DATASOURCE_COMMON_A)
$(CC) $(LDFLAGS) -o $(CAPTURE_HACKRF_SWEEP) $(CAPTURE_HACKRF_SWEEP_O) $(DATASOURCE_COMMON_A) -lhackrf -lfftw3 $(LIBMLIB) -lpthread -lm
datasources: $(DATASOURCE_BINS)
Makefile: Makefile.in configure
@-echo "'Makefile.in' or 'configure' are more current than this Makefile. You should re-run 'configure'."
binsuidinstall: $(DATASOURCE_BINS)
mkdir -p $(BIN)/kismet_capture_tools/
@if test "$(BUILD_CAPTURE_LINUX_WIFI)"x = "1"x; then \
$(INSTALL) -o $(INSTUSR) -g $(SUIDGROUP) -m 4550 $(CAPTURE_LINUX_WIFI) $(BIN)/kismet_capture_tools/$(CAPTURE_LINUX_WIFI); \
fi;
commoninstall: $(INSTBINS)
mkdir -p $(ETC)
mkdir -p $(BIN)
$(INSTALL) -o $(INSTUSR) -g $(INSTGRP) -m 555 $(PS) $(BIN)/$(PS);
# Symlink it to the old name
ln -s -f $(BIN)/$(PS) $(BIN)/kismet_server;
mkdir -p $(BIN)/kismet_capture_tools/
@if test "$(BUILD_CAPTURE_PCAPFILE)"x = "1"x; then \
$(INSTALL) -o $(INSTUSR) -g $(INSTGRP) $(CAPTURE_PCAPFILE) $(BIN)/kismet_capture_tools/$(CAPTURE_PCAPFILE); \
fi;
@if test "$(BUILD_CAPTURE_LINUX_WIFI)"x = "1"x; then \
$(INSTALL) -o $(INSTUSR) -g $(INSTGRP) $(CAPTURE_LINUX_WIFI) $(BIN)/kismet_capture_tools/$(CAPTURE_LINUX_WIFI); \
fi;
@if test "$(BUILD_CAPTURE_HACKRF_SWEEP)"x = "1"x; then \
$(INSTALL) -o $(INSTUSR) -g $(INSTGRP) $(CAPTURE_HACKRF_SWEEP) $(BIN)/kismet_capture_tools/$(CAPTURE_HACKRF_SWEEP); \
fi;
mkdir -p $(MAN)/man1
$(INSTALL) -o $(INSTUSR) -g $(MANGRP) -m 644 man/kismet.1 $(MAN)/man1/kismet.1
mkdir -p $(MAN)/man5
$(INSTALL) -o $(INSTUSR) -g $(MANGRP) -m 644 man/kismet.conf.5 $(MAN)/man5/kismet.conf.5
mkdir -p $(LIB)/pkgconfig
$(INSTALL) -o $(INSTUSR) -g $(INSTGRP) -m 644 packaging/kismet.pc $(LIB)/pkgconfig/kismet.pc
mkdir -p $(HTTPD)
cp -r http_data/* $(HTTPD)
CONFINSTTARGETS = $(addprefix install_conf_, $(CONFIGFILES))
${CONFINSTTARGETS}: install_conf_%:
@if test -f $(ETC)/$*; then \
echo "$(ETC)/$(f) already exists; it will not be automatically replaced."; \
echo "HOWEVER if there have been any changes you will need to manually"; \
echo "reconcile the differences in the config files!"; \
echo "You can update all config files with"; \
echo "make forceconfigs"; \
else \
$(INSTALL) -o $(INSTUSR) -g $(INSTGRP) -m 644 conf/$* $(ETC)/$*; \
echo install -o $(INSTUSR) -g $(INSTGRP) -m 644 conf/$* $(ETC)/$*; \
fi
FORCECONFINSTTARGETS = $(addprefix install_force_conf_, $(CONFIGFILES))
${FORCECONFINSTTARGETS}: install_force_conf_%:
$(INSTALL) -o $(INSTUSR) -g $(INSTGRP) -m 644 conf/$* $(ETC)/$*;
suidinstall: $(PS) $(DATASOURCE_BINS)
-groupadd -f $(SUIDGROUP)
@$(MAKE) -e commoninstall
@$(MAKE) -e binsuidinstall
@$(MAKE) install_conf_kismet.conf
@$(MAKE) install_conf_kismet_httpd.conf
@$(MAKE) install_conf_kismet_memory.conf
@$(MAKE) install_conf_kismet_alerts.conf
@echo
@echo
@echo "Installed kismet into $(BIN)/."
@echo "If you have not done so already, read the README file and the FAQ file. Additional"
@echo "documentation is in the docs/ directory. You MUST edit $(ETC)/kismet.conf "
@echo "and configure Kismet for your system, or it will NOT run properly!"
@echo
@echo "Kismet has been installed with a SUID ROOT CAPTURE HELPER executeable by "
@echo "users in the group '" $(SUIDGROUP) "'. This WILL ALLOW USERS IN THIS GROUP "
@echo "TO ALTER YOUR NETWORK INTERACE STATES, but is more secure than running "
@echo "all of Kismet as root. ONLY users in this group will be able to "
@echo "run Kismet and capture from physical network devices."
@echo
@echo "If you have just created this group, you will need to log out and back in"
@echo "before your user will have access. Check the output of the 'groups' "
@echo "command to make sure your user has the proper group!"
@echo
@echo "If you have installed Kismet in the past, you may need to UPDATE YOUR CONFIG"
@echo "FILES or Kismet may not work properly! You can manually reconcile differences"
@echo "or you can replace the previously installed config files entirely by running"
@echo "make forceconfigs"
install: $(INSTBINS)
@$(MAKE) -e commoninstall
@$(MAKE) install_conf_kismet.conf
@$(MAKE) install_conf_kismet_httpd.conf
@$(MAKE) install_conf_kismet_memory.conf
@$(MAKE) install_conf_kismet_alerts.conf
@echo
@echo
@echo "Installed kismet into $(BIN)/."
@echo "If you have not done so already, read the README file and the FAQ file. Additional"
@echo "documentation is in the docs/ directory. You MUST edit $(ETC)/kismet.conf "
@echo "and configure Kismet for your system, or it will NOT run properly!"
@echo
@echo "Kismet has NOT been installed suid-root. This means you will need to start "
@echo "it as root. If you add your user to the $(SUIDGROUP) group and install "
@echo "Kismet with 'make suidinstall', users in that group will be able to "
@echo "run Kismet directly."
@echo
@echo "READ THE KISMET DOCUMENTATION ABOUT THE KISMET SECURITY MODEL TO"
@echo "DECIDE IF YOU WANT TO INSTALL IT SUID-ROOT"
@echo
@echo "It is generally *MORE SECURE* to install Kismet with the suid-root "
@echo "option."
@echo
@echo "If you have installed Kismet in the past, you may need to UPDATE YOUR CONFIG"
@echo "FILES or Kismet may not work properly! You can manually reconcile differences"
@echo "or you can replace the previously installed config files entirely by running"
@echo "make forceconfigs"
forceconfigs:
@$(MAKE) install_force_conf_kismet.conf
@$(MAKE) install_force_conf_kismet_httpd.conf
@$(MAKE) install_force_conf_kismet_memory.conf
@$(MAKE) install_force_conf_kismet_alerts.conf
rpm:
@echo "Disabling SUID installation (RPM will handle setting the SUID bit.)"
@( export SUID="no"; export INSTGRP=`id -g`; export MANGRP=`id -g`; \
export INSTUSR=`id -u`; $(MAKE) -e install )
depclean:
@-rm -f *.d
clean:
@-rm -f *.o *.mo
@-rm -f *.d
@-rm -f kaitai_parsers/*.o
@-rm -f kaitai_parsers/*.d
@-$(MAKE) all-plugins-clean
@-rm -f $(PS)
@-rm -f $(DATASOURCE_BINS)
distclean:
@-$(MAKE) clean
@-$(MAKE) all-plugins-clean
@-rm -f *~
@-rm -f config.status
@-rm -f config.h
@-rm -f config.log
@-rm -rf packaging/ipkg/usr
@-rm -rf packaging/pak
@-rm -rf *.ipk
@-rm -f scripts/kismet
@-rm -f Makefile
plugins: Makefile
@( export KIS_SRC_DIR=`pwd`; for x in plugin-*/; do if [ ! -d "$$x" ]; then continue; fi; echo "PLUGIN: $$x"; ( cd "$$x"; make; ); done )
restricted-plugins: Makefile
@( export KIS_SRC_DIR=`pwd`; for x in restricted-plugin-*/; do if [ ! -d "$$x" ]; then continue; fi; echo "PLUGIN: $$x"; ( cd "$$x"; make; ); done )
plugins-clean:
@( export KIS_SRC_DIR=`pwd`; for x in plugin-*/; do if [ ! -d "$$x" ]; then continue; fi; echo "PLUGIN-CLEAN: $$x"; ( cd "$$x"; make clean; ); done )
restricted-plugins-clean:
@( export KIS_SRC_DIR=`pwd`; for x in restricted-plugin-*/; do if [ ! -d "$$x" ]; then continue; fi; echo "PLUGIN-CLEAN: $$x"; ( cd "$$x"; make clean; ); done )
plugins-install: Makefile
@( export KIS_SRC_DIR=`pwd`; for x in plugin-*/; do if [ ! -d "$$x" ]; then continue; fi; echo "PLUGIN-INSTALL: $$x"; ( cd "$$x"; make install; ); done )
restricted-plugins-install: Makefile
@( export KIS_SRC_DIR=`pwd`; for x in restricted-plugin-*/; do if [ ! -d "$$x" ]; then continue; fi; echo "PLUGIN-INSTALL: $$x"; ( cd "$$x"; make install; ); done )
plugins-userinstall: Makefile
@( export KIS_SRC_DIR=`pwd`; for x in plugin-*/; do if [ ! -d "$$x" ]; then continue; fi; echo "PLUGIN-USERINSTALL: $$x"; ( cd "$$x"; make userinstall; ); done )
restricted-plugins-userinstall: Makefile
@( export KIS_SRC_DIR=`pwd`; for x in restricted-plugin-*/; do if [ ! -d "$$x" ]; then continue; fi; echo "PLUGIN-USERINSTALL: $$x"; ( cd "$$x"; make userinstall; ); done )
all-plugins: Makefile
@$(MAKE) plugins
@$(MAKE) restricted-plugins
all-plugins-install: Makefile
@$(MAKE) plugins-install
@$(MAKE) restricted-plugins-install
all-plugins-userinstall: Makefile
@$(MAKE) plugins-userinstall
@$(MAKE) restricted-plugins-userinstall
all-plugins-clean: Makefile
@$(MAKE) plugins-clean
@$(MAKE) restricted-plugins-clean
kaitai-parsers:
@echo "Re-generating the kaitai_struct parsers requires the gpl3 licensed "
@echo "kaitai_struct compiler; see http://http://kaitai.io/ for more info!"
kaitai-struct-compiler --outdir kaitai_parsers/ -t cpp_stl -I kaitai_definitions/ kaitai_definitions/*.ksy
rename 's/\.cpp$$/\.cc/' kaitai_parsers/*.cpp -v -f
%.c.o: %.c
%.c.o : %.c %.c.d
$(CC) $(CFLAGS) $(CPPFLAGS) -c $*.c -o $@
%.cc.o: %.cc
%.cc.o: %.cc %.cc.d
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $*.cc -o $@
%.c.d: %.c
$(CC) -MM $(CFLAGS) $(CPPFLAGS) $*.c | sed -e "s/\.o/\.c.o/" > $*.c.d
%.cc.d: %.cc
$(CXX) -MM $(CXXFLAGS) $(CPPFLAGS) $*.cc | sed -e "s/\.o/\.cc.o/" > $*.cc.d
.PRECIOUS: %.Td %.c.d %.cc.d
include $(wildcard $(patsubst %c.o,%c.d,$(PSO)))
include $(wildcard $(patsubst %c.o,%c.d,$(DATASOURCE_COMMON_C_O)))
ifneq ($(BUILD_CAPTURE_PCAPFILE)x, "x")
include $(wildcard $(patsubst %c.o,%c.d,$(CAPTURE_PCAPFILE_O)))
endif
ifneq ($(BUILD_CAPTURE_LINUX_WIFI)x, "x")
include $(wildcard $(patsubst %c.o,%c.d,$(CAPTURE_LINUX_WIFI_O)))
endif
.SUFFIXES: .c .cc .o