| 1 |
#!/usr/bin/make -f |
| 2 |
# written by Jan Wagner <[email protected]> |
| 3 |
# |
| 4 |
# Uncomment this to turn on verbose mode. |
| 5 |
#export DH_VERBOSE=1 |
| 6 |
|
| 7 |
include /usr/share/dpkg/buildtools.mk |
| 8 |
|
| 9 |
# hardening |
| 10 |
export DEB_BUILD_HARDENING=1 |
| 11 |
CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) |
| 12 |
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) |
| 13 |
CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) |
| 14 |
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) |
| 15 |
|
| 16 |
CFLAGS += -D_BSD_SOURCE -Wall -g |
| 17 |
LDLIBS += -lpcap -lpthread -lm |
| 18 |
|
| 19 |
build: build-arch build-indep |
| 20 |
build-arch: build-stamp |
| 21 |
build-indep: build-stamp |
| 22 |
build-stamp: |
| 23 |
dh_testdir |
| 24 |
# Add here commands to compile the package. |
| 25 |
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) dns_flood_detector.c $(LDLIBS) -o dns_flood_detector |
| 26 |
|
| 27 |
touch $@ |
| 28 |
|
| 29 |
clean: |
| 30 |
dh_testdir |
| 31 |
dh_testroot |
| 32 |
rm -f build-stamp |
| 33 |
|
| 34 |
# Add here commands to clean up after the build process. |
| 35 |
rm -rf dns_flood_detector *.o *~ |
| 36 |
|
| 37 |
dh_clean |
| 38 |
|
| 39 |
install: build |
| 40 |
dh_testdir |
| 41 |
dh_testroot |
| 42 |
dh_prep |
| 43 |
dh_installdirs |
| 44 |
|
| 45 |
# Add here commands to install the package into debian/dns-flood-detector. |
| 46 |
install -D -m 0755 dns_flood_detector debian/dns-flood-detector/usr/bin/dns-flood-detector |
| 47 |
install -D -m 0644 debian/default debian/dns-flood-detector/etc/default/dns-flood-detector |
| 48 |
install -D -m 0755 debian/init.d debian/dns-flood-detector/etc/init.d/dns-flood-detector |
| 49 |
|
| 50 |
# Build architecture-independent files here. |
| 51 |
binary-indep: build install |
| 52 |
# We have nothing to do by default. |
| 53 |
|
| 54 |
# Build architecture-dependent files here. |
| 55 |
binary-arch: build install |
| 56 |
dh_testdir |
| 57 |
dh_testroot |
| 58 |
dh_installchangelogs |
| 59 |
dh_installdocs |
| 60 |
dh_installman debian/dns-flood-detector.8 |
| 61 |
dh_installexamples |
| 62 |
dh_installinit -- defaults 40 |
| 63 |
dh_installsystemd --no-enable |
| 64 |
dh_lintian |
| 65 |
dh_link |
| 66 |
dh_strip |
| 67 |
dh_compress |
| 68 |
dh_fixperms |
| 69 |
dh_shlibdeps |
| 70 |
dh_installdeb |
| 71 |
dh_gencontrol |
| 72 |
dh_md5sums |
| 73 |
dh_builddeb |
| 74 |
|
| 75 |
binary: binary-indep binary-arch |
| 76 |
.PHONY: build clean binary-indep binary-arch binary install |