File: Makefile

package info (click to toggle)
prads 0.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 2,400 kB
  • ctags: 1,564
  • sloc: ansic: 10,215; perl: 1,689; sql: 204; sh: 167; makefile: 152
file content (74 lines) | stat: -rw-r--r-- 3,287 bytes parent folder | download | duplicates (2)
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
PREFIX=/usr/local
BINDIR=${PREFIX}/bin
CONFDIR=${PREFIX}/etc/prads
MANDIR=${PREFIX}/share/man/man1
DOCUTIL=rst2man
INSTALLGROUP=root

ifeq ($(UNAME), FreeBSD)
DOCUTIL=rst2man.py
INSTALLGROUP=wheel
endif

build:
	@echo "You need libpcre-dev and libpcap-dev to compile this program."
	${MAKE} CONFDIR=${CONFDIR} -C src/

clean:
	${MAKE} -C src/ $@
	rm -f doc/prads.1 doc/prads.1.gz
	rm -f doc/prads-wirefuzz.1 doc/prads-wirefuzz.1.gz
	rm -f doc/prads-asset-report.1 doc/prads-asset-report.1.gz
	rm -f doc/prads2snort.1 doc/prads2snort.1.gz

.PHONY: man
man: doc/prads.1.gz doc/prads-asset-report.1.gz doc/prads-wirefuzz.1.gz doc/prads2snort.1.gz

doc/%.1.gz: doc/%.1
	@>$@<$< gzip -9

doc/%.1: doc/%.man
	${DOCUTIL} $< >$@

install: man
	# binaries
	install -d ${DESTDIR}${BINDIR}
	install -m 755 -o root -g ${INSTALLGROUP} src/prads ${DESTDIR}${BINDIR}/prads
	install -m 755 -o root -g ${INSTALLGROUP} tools/prads-asset-report ${DESTDIR}${BINDIR}/prads-asset-report
	install -m 755 -o root -g ${INSTALLGROUP} tools/prads2snort ${DESTDIR}${BINDIR}/prads2snort
	# config
	install -d ${DESTDIR}${CONFDIR}
	install -C -m 644 -o root -g ${INSTALLGROUP} etc/prads.conf ${DESTDIR}${CONFDIR}/
	# fingerprints
	#install -m 644 -o root -g ${INSTALLGROUP} etc/osi.fp ${DESTDIR}${CONFDIR}/
	#install -m 644 -o root -g ${INSTALLGROUP} etc/oso.fp ${DESTDIR}${CONFDIR}/
	#install -m 644 -o root -g ${INSTALLGROUP} etc/osu.fp ${DESTDIR}${CONFDIR}/
	install -m 644 -o root -g ${INSTALLGROUP} etc/tcp-syn.fp ${DESTDIR}${CONFDIR}/
	install -m 644 -o root -g ${INSTALLGROUP} etc/tcp-synack.fp ${DESTDIR}${CONFDIR}/
	install -m 644 -o root -g ${INSTALLGROUP} etc/tcp-fin.fp ${DESTDIR}${CONFDIR}/
	install -m 644 -o root -g ${INSTALLGROUP} etc/tcp-rst.fp ${DESTDIR}${CONFDIR}/
	install -m 644 -o root -g ${INSTALLGROUP} etc/tcp-stray-ack.fp ${DESTDIR}${CONFDIR}/
	# signatures
	install -C -m 644 -o root -g ${INSTALLGROUP} etc/eth.sig ${DESTDIR}${CONFDIR}/
	install -C -m 644 -o root -g ${INSTALLGROUP} etc/icmp-data.sig ${DESTDIR}${CONFDIR}/
	install -C -m 644 -o root -g ${INSTALLGROUP} etc/mac.sig ${DESTDIR}${CONFDIR}/
	install -C -m 644 -o root -g ${INSTALLGROUP} etc/mtu.sig ${DESTDIR}${CONFDIR}/
	install -C -m 644 -o root -g ${INSTALLGROUP} etc/os.sig ${DESTDIR}${CONFDIR}/
	install -C -m 644 -o root -g ${INSTALLGROUP} etc/tcp-clients.sig ${DESTDIR}${CONFDIR}/
	install -C -m 644 -o root -g ${INSTALLGROUP} etc/tcp-service.sig ${DESTDIR}${CONFDIR}/
	install -C -m 644 -o root -g ${INSTALLGROUP} etc/udp-service.sig ${DESTDIR}${CONFDIR}/
	install -C -m 644 -o root -g ${INSTALLGROUP} etc/service-string.sig ${DESTDIR}${CONFDIR}/
	install -C -m 644 -o root -g ${INSTALLGROUP} etc/web-application.sig ${DESTDIR}${CONFDIR}/
	# ports 
	install -d ${DESTDIR}${CONFDIR}
	install -C -m 644 -o root -g ${INSTALLGROUP} etc/udp.ports ${DESTDIR}${CONFDIR}/
	install -d ${DESTDIR}${CONFDIR}/init.d
	install -m 755 -o root -g ${INSTALLGROUP} doc/prads.rc ${DESTDIR}${CONFDIR}/init.d/
	# man pages
	install -d ${DESTDIR}${MANDIR}
	install -m 644 -o root -g ${INSTALLGROUP} doc/prads.1.gz ${DESTDIR}${MANDIR}/
	install -m 644 -o root -g ${INSTALLGROUP} doc/prads-asset-report.1.gz ${DESTDIR}${MANDIR}/
	install -m 644 -o root -g ${INSTALLGROUP} doc/prads2snort.1.gz ${DESTDIR}${MANDIR}/


.PHONY: build clean install