summaryrefslogtreecommitdiffstats
path: root/rules/madwifi.make
blob: d34d494412952caa3ce6c86170ad8a1762f9ca1a (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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# -*-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
#
#

PACKAGES-$(PTXCONF_MADWIFI) += madwifi

#
# Paths and names
#
MADWIFI_VERSION		= 20040504
MADWIFI			= madwifi-$(MADWIFI_VERSION)
MADWIFI_SUFFIX		= tar.gz
MADWIFI_URL		= file://tmp/$(MADWIFI).$(MADWIFI_SUFFIX)
MADWIFI_SOURCE		= $(SRCDIR)/$(MADWIFI).$(MADWIFI_SUFFIX)
MADWIFI_DIR		= $(BUILDDIR)/$(MADWIFI)

-include $(call package_depfile)

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

madwifi_get: $(STATEDIR)/madwifi.get

madwifi_get_deps = $(MADWIFI_SOURCE)

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

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

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

madwifi_extract: $(STATEDIR)/madwifi.extract

madwifi_extract_deps = $(STATEDIR)/madwifi.get

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

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

madwifi_prepare: $(STATEDIR)/madwifi.prepare

#
# dependencies
#
madwifi_prepare_deps = \
	$(STATEDIR)/madwifi.extract \
	$(STATEDIR)/virtual-xchain.install

MADWIFI_PATH	=  PATH=$(CROSS_PATH)
MADWIFI_ENV 	=  $(CROSS_ENV)
#MADWIFI_ENV	+= PKG_CONFIG_PATH=$(SYSROOT)/lib/pkgconfig
MADWIFI_ENV    += KERNELRELEASE=$(KERNEL_VERSION)
MADWIFI_ENV    += KERNELPATH=$(KERNEL_DIR)
MADWIFI_ENV    += DESTDIR=$(ROOTDIR)
MADWIFI_ENV    += TARGET=i386-elf

#
# autoconf
#
MADWIFI_AUTOCONF =  $(CROSS_AUTOCONF_USR)

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

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

madwifi_compile: $(STATEDIR)/madwifi.compile

madwifi_compile_deps = $(STATEDIR)/madwifi.prepare

$(STATEDIR)/madwifi.compile: $(madwifi_compile_deps)
	@$(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: $(STATEDIR)/madwifi.compile
	@$(call targetinfo, $@)
	@$(call touch, $@)

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

madwifi_targetinstall: $(STATEDIR)/madwifi.targetinstall

madwifi_targetinstall_deps = $(STATEDIR)/madwifi.compile

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

	@$(call install_init,default)
	@$(call install_fixup,PACKAGE,madwifi)
	@$(call install_fixup,PRIORITY,optional)
	@$(call install_fixup,VERSION,$(MADWIFI_VERSION))
	@$(call install_fixup,SECTION,base)
	@$(call install_fixup,AUTHOR,"Robert Schwebel <r.schwebel\@pengutronix.de>")
	@$(call install_fixup,DEPENDS,)
	@$(call install_fixup,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, 0, 0, 0555, $(MADWIFI_DIR)/tools/athstats, /usr/bin/athstats)
endif
ifdef PTXCONF_MADWIFI_TOOLS_80211_STATS
	@$(call install_copy, 0, 0, 0555, $(MADWIFI_DIR)/tools/80211stats, /usr/bin/80211stats)
endif
	@$(call install_finish)

	@$(call touch, $@)

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

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

# vim: syntax=make