summaryrefslogtreecommitdiffstats
path: root/rules/pcmcia-cs.make
blob: 81010396261414e41089e0ad4994c9e836ce76b3 (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
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2003 by Robert Schwebel <r.schwebel@pengutronix.de>
#
# 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.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_PCMCIA_TOOLS) += pcmcia-cs

#
# Paths and names
#
PCMCIA-CS_VERSION	= 3.2.8
PCMCIA-CS		= pcmcia-cs-$(PCMCIA-CS_VERSION)
PCMCIA-CS_SUFFIX	= tar.gz
PCMCIA-CS_URL		= $(PTXCONF_SETUP_SFMIRROR)/pcmcia-cs/$(PCMCIA-CS).$(PCMCIA-CS_SUFFIX)
PCMCIA-CS_SOURCE	= $(SRCDIR)/$(PCMCIA-CS).$(PCMCIA-CS_SUFFIX)
PCMCIA-CS_DIR		= $(BUILDDIR)/$(PCMCIA-CS)


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

pcmcia-cs_get: $(STATEDIR)/pcmcia-cs.get

$(STATEDIR)/pcmcia-cs.get: $(pcmcia-cs_get_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(PCMCIA-CS_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, PCMCIA-CS)

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

pcmcia-cs_extract: $(STATEDIR)/pcmcia-cs.extract

$(STATEDIR)/pcmcia-cs.extract: $(pcmcia-cs_extract_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(PCMCIA-CS_DIR))
	@$(call extract, PCMCIA-CS)
	@$(call patchin, PCMCIA-CS)
	@$(call touch, $@)

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

pcmcia-cs_prepare: $(STATEDIR)/pcmcia-cs.prepare

PCMCIA-CS_PATH	=  PATH=$(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET)/bin:$(CROSS_PATH)
PCMCIA-CS_ENV 	=  $(CROSS_ENV)

PCMCIA-CS_CONF	=  --noprompt \
	--kernel=$(KERNEL_DIR) \
	--target=$(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET) \
	--moddir=$(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET)/lib/modules/$(KERNEL_VERSION) \
	--arch=$(PTXCONF_ARCH) \
	--ucc=$(COMPILER_PREFIX)gcc \
	--kcc=$(COMPILER_PREFIX)gcc \
	--ld=$(COMPILER_PREFIX)ld

#PCMCIA-CS_CONF	+= --moddir=$(ROOTDIR)/lib/modules/$(KERNEL_VERSION)

# FIXME: We could make the following optional as well in rules/pcmcia-cs.in
PCMCIA-CS_CONF	+= --trust --nocardbus --nopnp --noapm --srctree --bsd

#PCMCIA-CS_CONF	+= --kflags=-I$(KERNEL_DIR)/include
#PCMCIA-CS_CONF	+= --uflags=-I$(KERNEL_DIR)/include

$(STATEDIR)/pcmcia-cs.prepare: $(pcmcia-cs_prepare_deps_default)
	@$(call targetinfo, $@)
	chmod u+w $(PCMCIA-CS_DIR)/man/*
	cd $(PCMCIA-CS_DIR) && \
		./Configure $(PCMCIA-CS_CONF)
	@$(call touch, $@)

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

pcmcia-cs_compile: $(STATEDIR)/pcmcia-cs.compile

pcmcia-cs_compile_deps =  $(STATEDIR)/pcmcia-cs.prepare

$(STATEDIR)/pcmcia-cs.compile: $(pcmcia-cs_compile_deps_default)
	@$(call targetinfo, $@)
	$(PCMCIA-CS_PATH) $(PCMCIA-CS_ENV)	\
	$(MAKE) -C $(PCMCIA-CS_DIR) all	
	@$(call touch, $@)

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

pcmcia-cs_install: $(STATEDIR)/pcmcia-cs.install

$(STATEDIR)/pcmcia-cs.install: $(pcmcia-cs_install_deps_default)
	@$(call targetinfo, $@)
	@$(call install, PCMCIA-CS)
	@$(call touch, $@)

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

pcmcia-cs_targetinstall: $(STATEDIR)/pcmcia-cs.targetinstall

$(STATEDIR)/pcmcia-cs.targetinstall: $(pcmcia-cs_targetinstall_deps_default)
	@$(call targetinfo, $@)

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

ifdef PTXCONF_PCMCIA_TOOLS_CARDMGR
	@$(call install_copy, pcmcia-cs, 0, 0, 0755, $(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET)/sbin/cardmgr, /sbin/cardmgr)
	@$(call install_copy, pcmcia-cs, 0, 0, 0755, $(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET)/sbin/cardctl, /sbin/cardctl)
endif

ifdef PTXCONF_PCMCIA_TOOLS_MISC
	# FIXME: There are more. Which ones are needed?
	@$(call install_copy, pcmcia-cs, 0, 0, 0755, $(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET)/sbin/ifport, /sbin/ifport)
	@$(call install_copy, pcmcia-cs, 0, 0, 0755, $(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET)/sbin/ifuser, /sbin/ifuser)
	@$(call install_copy, pcmcia-cs, 0, 0, 0755, $(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET)/sbin/ide_info, /sbin/ide_info)
endif

ifdef PTXCONF_PCMCIA_TOOLS_FTL
	@$(call install_copy, pcmcia-cs, 0, 0, 0755, $(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET)/sbin/ftl_format, /sbin/ftl_format)
	@$(call install_copy, pcmcia-cs, 0, 0, 0755, $(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET)/sbin/ftl_check, /sbin/ftl_check)
endif

ifdef PTXCONF_PCMCIA_TOOLS_DEBUG
	@$(call install_copy, pcmcia-cs, 0, 0, 0755, $(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET)/sbin/dump_cis, /sbin/dump_cis)
	@$(call install_copy, pcmcia-cs, 0, 0, 0755, $(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET)/sbin/pack_cis, /sbin/pack_cis)
endif

	# FIXME: Maybe we want to add an install option for  /etc/rc.d/rc.pcmcia
	#        and all the stuff that goes into /etc/pcmcia
	#        For now this is a task for vendortweaks.

	@$(call install_finish, pcmcia-cs)

	@$(call touch, $@)

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

pcmcia-cs_clean:
	rm -rf $(STATEDIR)/pcmcia-cs.*
	rm -rf $(IMAGEDIR)/pcmcia-cs_*
	rm -rf $(PCMCIA-CS_DIR)

# vim: syntax=make