root/floppyfw-3.0/makefiles/pcmcia.mk

Revision 76, 3.5 KB (checked in by root, 6 years ago)

I keep forgetting.

Line 
1#############################################################
2#
3# pcmcia card services
4#
5#############################################################
6# Copyright (C) 2001-2003 by Erik Andersen <andersen@codepoet.org>
7# Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
8#
9# This program is free software; you can redistribute it and/or modify
10# it under the terms of the GNU Library General Public License as
11# published by the Free Software Foundation; either version 2 of the
12# License, or (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful, but
15# WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17# Library General Public License for more details.
18#
19# You should have received a copy of the GNU Library General Public
20# License along with this program; if not, write to the Free Software
21# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22# USA
23PCMCIA_SITE:=http://pcmcia-cs.sourceforge.net/ftp/
24PCMCIA_SOURCE:=pcmcia-cs-3.2.8.tar.gz
25PCMCIA_DIR:=$(BUILD_DIR)/pcmcia-cs-3.2.8
26PCMCIA_PATCH:=$(SOURCE_DIR)/pcmcia.patch
27PCMCIA_CAT:=zcat
28
29PCMCIA_PKG_DIR=$(PACKAGES_DIR)/pcmcia-cs
30
31$(DL_DIR)/$(PCMCIA_SOURCE):
32        $(WGET) -P $(DL_DIR) $(PCMCIA_SITE)/$(PCMCIA_SOURCE)
33
34pcmcia-source: $(DL_DIR)/$(PCMCIA_SOURCE)
35
36$(PCMCIA_DIR)/.unpacked: $(DL_DIR)/$(PCMCIA_SOURCE)
37        $(PCMCIA_CAT) $(DL_DIR)/$(PCMCIA_SOURCE) | \
38                tar $(TAR_VERBOSE) -C $(BUILD_DIR) -xf -
39        -[ ! -d $(PCMCIA_PKG_DIR) ] && mkdir $(PCMCIA_PKG_DIR)
40        touch $(PCMCIA_DIR)/.unpacked
41
42$(PCMCIA_DIR)/.patched: $(PCMCIA_DIR)/.unpacked
43        cat $(PCMCIA_PATCH) | patch -d $(PCMCIA_DIR) -p1
44        touch $(PCMCIA_DIR)/.patched
45
46#  --moddir=$(MODULES_DIR)/lib/modules/$(LINUX_VERSION)/
47
48$(PCMCIA_DIR)/.configured: $(PCMCIA_DIR)/.patched
49        ( cd $(PCMCIA_DIR) ; ./Configure \
50                --kernel=$(LINUX_SOURCE_DIR) --noprompt \
51                --target=$(PACKAGES_DIR)/pcmcia-cs \
52                --pnp \
53                --ucc=$(TARGET_CC) \
54                --kcc=$(TARGET_CC) \
55                --pnp \
56                --srctree \
57                --moddir=$(PCMCIA_PKG_DIR)/lib/modules/$(LINUX_VERSION)/ \
58                --uflags="$(TARGET_CFLAGS)" \
59        );
60        $(SED) "s/pump/udhcpc/" $(PCMCIA_DIR)/etc/network
61        touch $(PCMCIA_DIR)/.configured
62
63$(PCMCIA_DIR)/cardmgr/cardmgr: $(PCMCIA_DIR)/.configured
64        $(MAKE) -C $(PCMCIA_DIR) -i all
65        touch -c $(PCMCIA_DIR)/cardmgr/cardmgr
66
67$(PCMCIA_PKG_DIR)/sbin/cardmgr: $(PCMCIA_DIR)/cardmgr/cardmgr
68        -$(RM) -r $(PCMCIA_PKG_DIR)/*
69        $(MAKE) -i -C $(PCMCIA_DIR) install
70        -$(SSTRIP) $(PCMCIA_PKG_DIR)/sbin/*
71        -$(SSTRIP) $(PCMCIA_PKG_DIR)/lib/*
72        -$(RM) -r $(PCMCIA_PKG_DIR)/usr/share
73        -$(RM) -r $(PCMCIA_PKG_DIR)/usr/man
74        -$(RM) -r $(PCMCIA_PKG_DIR)/include
75        -$(RM) -r $(PCMCIA_PKG_DIR)/man
76
77$(PACKAGES_DIR)/pcmcia-cs.ffw: $(PCMCIA_PKG_DIR)/sbin/cardmgr
78        (cd $(PACKAGES_DIR); sh mkpack pcmcia-cs)
79
80pcmcia: $(PACKAGES_DIR)/pcmcia-cs.ffw
81
82pcmcia-clean:
83        $(RM) -r $(PCMCIA_PKG_DIR)
84        -$(MAKE) -C $(PCMCIA_DIR) clean
85        $(RM) $(PCMCIA_DIR)/.configured $(PCMCIA_DIR)/config.out
86
87pcmcia-dirclean:
88        $(RM) -r $(PCMCIA_PKG_DIR)
89        $(RM) -r $(PCMCIA_DIR)
90
91# Probably not nessesary at all:
92# pcmcia: $(PCMCIA_PKG_DIR)/sbin/cardmgr $(PCMCIA_DIR)/.modules.dep
93
94# use busybox depmod.pl so we need the sources unpacked
95$(PCMCIA_DIR)/.modules.dep: $(BUSYBOX_DIR)/.configured $(PCMCIA_PKG_DIR)/lib/modules
96        [ -d $(PCMCIA_PKG_DIR)/lib/modules/$(LINUX_VERSION) ] && \
97        $(BUSYBOX_DIR)/examples/depmod.pl -n \
98                -b $(PCMCIA_PKG_DIR)/lib/modules/$(LINUX_VERSION)/ \
99                -k $(LINUX_DIR)/vmlinux \
100                -F $(LINUX_DIR)/System.map \
101                > $(PCMCIA_PKG_DIR)/lib/modules/$(LINUX_VERSION)/modules.dep
102        touch $(PCMCIA_DIR)/.modules.dep
Note: See TracBrowser for help on using the browser.