| 1 | #!/usr/bin/make -f |
|---|
| 2 | # -*- makefile -*- |
|---|
| 3 | # Sample debian/rules that uses debhelper. |
|---|
| 4 | # This file was originally written by Joey Hess and Craig Small. |
|---|
| 5 | # As a special exception, when this file is copied by dh-make into a |
|---|
| 6 | # dh-make output file, you may use that output file without restriction. |
|---|
| 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. |
|---|
| 8 | |
|---|
| 9 | # Uncomment this to turn on verbose mode. |
|---|
| 10 | export DH_VERBOSE=1 |
|---|
| 11 | |
|---|
| 12 | # These are used for cross-compiling and for saving the configure script |
|---|
| 13 | # from having to guess our platform (since we know it already) |
|---|
| 14 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
|---|
| 15 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
|---|
| 16 | ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) |
|---|
| 17 | CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) |
|---|
| 18 | else |
|---|
| 19 | CROSS= --build $(DEB_BUILD_GNU_TYPE) |
|---|
| 20 | endif |
|---|
| 21 | |
|---|
| 22 | CC=$(DEB_HOST_GNU_TYPE)-gcc |
|---|
| 23 | export CC |
|---|
| 24 | |
|---|
| 25 | # CFLAGS as suggested by hostapd Makefile |
|---|
| 26 | CFLAGS = -MMD -O2 -Wall -g |
|---|
| 27 | CFLAGS += -I../src |
|---|
| 28 | CFLAGS += -I../src/utils |
|---|
| 29 | |
|---|
| 30 | # support madwifi |
|---|
| 31 | CFLAGS += -I../../src/madwifi |
|---|
| 32 | |
|---|
| 33 | # Make sure DebWrt linux kernel headers are used ( emdebian contains somewhat older headers files ) |
|---|
| 34 | CFLAGS+=-I/usr/$(DEB_HOST_GNU_TYPE)/src/linux/include |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | %: |
|---|
| 38 | dh $@ |
|---|
| 39 | |
|---|
| 40 | build: |
|---|
| 41 | dh_testdir |
|---|
| 42 | dh_auto_configure |
|---|
| 43 | |
|---|
| 44 | $(MAKE) -C src/hostapd |
|---|
| 45 | |
|---|
| 46 | dh_auto_test |
|---|
| 47 | |
|---|
| 48 | override_dh_auto_install: |
|---|
| 49 | install -d debian/hostapd/usr/sbin |
|---|
| 50 | install -d debian/hostapd/etc/init.d |
|---|
| 51 | install -d debian/hostapd/etc/hostapd |
|---|
| 52 | install -d debian/hostapd/etc/default |
|---|
| 53 | install -o root -g root -m 755 src/hostapd/hostapd debian/hostapd/usr/sbin/hostapd |
|---|
| 54 | install -o root -g root -m 755 src/hostapd/hostapd_cli debian/hostapd/usr/sbin/hostapd_cli |
|---|
| 55 | install -o root -g root -m 644 debian/hostapd-nokey.conf debian/hostapd/etc/hostapd/hostapd-nokey.conf |
|---|
| 56 | install -o root -g root -m 644 debian/hostapd-wpa.conf debian/hostapd/etc/hostapd/hostapd-wpa.conf |
|---|
| 57 | install -o root -g root -m 644 debian/hostapd-wep.conf debian/hostapd/etc/hostapd/hostapd-wep.conf |
|---|
| 58 | install -o root -g root -m 644 debian/hostapd.default debian/hostapd/etc/default/hostapd |
|---|
| 59 | install -o root -g root -m 644 debian/hostapd.init debian/hostapd/etc/init.d/hostapd |
|---|
| 60 | |
|---|
| 61 | override_dh_installinit: |
|---|
| 62 | # do nothing, we want hostapd not to be started at system boot time, but from /etc/network/interfaces on demand |
|---|
| 63 | |
|---|
| 64 | override_dh_auto_clean: |
|---|
| 65 | $(MAKE) -C src/hostapd clean |
|---|
| 66 | |
|---|