summaryrefslogtreecommitdiffstats
path: root/rules/madwifi.make
blob: 885078f7e92819d3f2853d01bc6fb13b3bed7fc9 (plain)
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
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2004 by Greg Brackley
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#
#
# The MADWIFI project doesn't have regular releases (yet). The easiest thing to do
# is to get a CVS release. I found some release here
# http://debian.isg.ee.ethz.ch/public/pool/madwifi/
#
# The FAQ http://www.mattfoster.clara.co.uk/madwifi-faq.htm is useful.
#
#  > cd /tmp
#  > cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/madwifi co madwifi
#  > mv madwifi madwifi-20040504
#  > tar -czf madwifi-20040504.tar.gz madwifi-20040504 --exclude=CVS
#
#

ifdef PTXCONF_ARCH_X86
PACKAGES-$(PTXCONF_MADWIFI) += madwifi
endif

#
# Paths and names
#
MADWIFI_VERSION		= 0.9.3.3
MADWIFI			= madwifi-$(MADWIFI_VERSION)
MADWIFI_SUFFIX		= tar.gz
MADWIFI_URL		= $(PTXCONF_SETUP_SFMIRROR)/madwifi/$(MADWIFI).$(MADWIFI_SUFFIX)
MADWIFI_SOURCE		= $(SRCDIR)/$(MADWIFI).$(MADWIFI_SUFFIX)
MADWIFI_DIR		= $(BUILDDIR)/$(MADWIFI)


# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

madwifi_get: $(STATEDIR)/madwifi.get

$(STATEDIR)/madwifi.get: $(madwifi_get_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(MADWIFI_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, MADWIFI)

# ----------------------------------------------------------------------------
# Extract
# ----------------------------------------------------------------------------

madwifi_extract: $(STATEDIR)/madwifi.extract

$(STATEDIR)/madwifi.extract: $(madwifi_extract_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(MADWIFI_DIR))
	@$(call extract, MADWIFI)
	@$(call patchin, MADWIFI)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

madwifi_prepare: $(STATEDIR)/madwifi.prepare

MADWIFI_PATH	=  PATH=$(CROSS_PATH)
MADWIFI_ENV = \
	$(CROSS_ENV) \
	KERNELRELEASE=$(KERNEL_VERSION) \
	KERNELPATH=$(KERNEL_DIR) \
	DESTDIR=$(ROOTDIR) \
	TARGET=i386-elf

#
# autoconf
#
MADWIFI_AUTOCONF =  $(CROSS_AUTOCONF_USR)

$(STATEDIR)/madwifi.prepare: $(madwifi_prepare_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------

madwifi_compile: $(STATEDIR)/madwifi.compile

$(STATEDIR)/madwifi.compile: $(madwifi_compile_deps_default)
	@$(call targetinfo, $@)
	cd $(MADWIFI_DIR) && $(MADWIFI_ENV) $(MADWIFI_PATH) $(MAKE)
ifdef PTXCONF_MADWIFI_TOOLS_ATHEROS_STATS
	cd $(MADWIFI_DIR)/tools && $(MADWIFI_ENV) $(MADWIFI_PATH) $(MAKE) athstats
endif
ifdef PTXCONF_MADWIFI_TOOLS_80211_STATS
	cd $(MADWIFI_DIR)/tools && $(MADWIFI_ENV) $(MADWIFI_PATH) $(MAKE) 80211stats
endif
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

madwifi_install: $(STATEDIR)/madwifi.install

$(STATEDIR)/madwifi.install: $(madwifi_install_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

madwifi_targetinstall: $(STATEDIR)/madwifi.targetinstall

# requires uudecode, which is part of sharutils
$(STATEDIR)/madwifi.targetinstall: $(madwifi_targetinstall_deps_default)
	@$(call targetinfo, $@)

	@$(call install_init, madwifi)
	@$(call install_fixup, madwifi,PACKAGE,madwifi)
	@$(call install_fixup, madwifi,PRIORITY,optional)
	@$(call install_fixup, madwifi,VERSION,$(MADWIFI_VERSION))
	@$(call install_fixup, madwifi,SECTION,base)
	@$(call install_fixup, madwifi,AUTHOR,"Robert Schwebel <r.schwebel\@pengutronix.de>")
	@$(call install_fixup, madwifi,DEPENDS,)
	@$(call install_fixup, madwifi,DESCRIPTION,missing)

	# FIXME: ipkgize
ifdef PTXCONF_KERNEL_INSTALL
	cd $(MADWIFI_DIR) && $(MADWIFI_ENV) $(MADWIFI_PATH) $(MAKE) install
endif
ifdef PTXCONF_MADWIFI_TOOLS_ATHEROS_STATS
	@$(call install_copy, madwifi, 0, 0, 0555, $(MADWIFI_DIR)/tools/athstats, /usr/bin/athstats)
endif
ifdef PTXCONF_MADWIFI_TOOLS_80211_STATS
	@$(call install_copy, madwifi, 0, 0, 0555, $(MADWIFI_DIR)/tools/80211stats, /usr/bin/80211stats)
endif
	@$(call install_finish, madwifi)

	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------

madwifi_clean:
	rm -rf $(STATEDIR)/madwifi.*
	rm -rf $(PKGDIR)/madwifi_*
	rm -rf $(MADWIFI_DIR)

# vim: syntax=make