From b26346a45b0de191c618ca9bc427bc85639c444e Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 26 May 2003 16:50:34 +0000 Subject: Patch from Pavel Roskin (note: the part about changing INCLUDES was not applied): The attached patch exports PCMCIA_PATH and also introduces some basic checks to avoid common errors. If PCMCIA_PATH is set to an invalid or missing directory, exit with an error. If both CONFIG_PCMCIA and PCMCIA_PATH are set, it's an error too - you don't need to specify PCMCIA_PATH if kernel PCMCIA support is present. If neither CONFIG_PCMCIA nor PCMCIA_PATH are defined, it's a warning. Ideally, hostap_cs shouldn't be built and installed in this case, but let's leave it for another patch. Since depmod is run after every installed modules, make can fail because of unresolved symbols if the already installed modules that are about to be replaced. I see two ways to avoid this problem. One is to create private targets like _install_pcard without depmod and make sure that public targets only call depmod at the end. Another approach is to introduce "uninstall" target that would remove old modules before depmod is run the first time. The patch implements the second approach. --- Makefile | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index adedb2f..1d954db 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,19 @@ ifdef PCMCIA_PATH ifndef CONFIG_PCMCIA INCLUDES=-I$(PCMCIA_PATH)/include -I$(KERNEL_PATH)/include endif +ifeq (,$(wildcard $(PCMCIA_PATH)/include/pcmcia/version.h)) +$(error PCMCIA_PATH doesn't contain valid pcmcia-cs source) +endif +ifdef CONFIG_PCMCIA +$(error Kernel supports PCMCIA - PCMCIA_PATH shouldn't be defined) +endif +export PCMCIA_PATH +endif + +ifndef PCMCIA_PATH +ifndef CONFIG_PCMCIA +$(warning WARNING: No kernel PCMCIA support found and PCMCIA_PATH is not defined) +endif endif VERFILE := $(KERNEL_PATH)/include/linux/version.h @@ -79,6 +92,11 @@ CFLAGS += -fomit-frame-pointer endif +# Old compilation using this Makefile and not the build system in the kernel +# tree. This is used when compiling for Linux 2.2.x (or Linux 2.4.x with +# 'make pccard'). Both Linux 2.5.x and 2.4.x can use kernel tree build system +# with 'make'. + ifdef CONFIG_MODVERSIONS VERFILES=$(MSRC)/hostap.ver $(MSRC)/hostap_crypt.ver @@ -107,6 +125,9 @@ endif .c.o: $(CC) $(INCLUDES) $(INCLUDES_MODVER) $(CFLAGS) -o $@ $< +# end of old compilation + + 2.4: @if ! echo "$(KERNELRELEASE)" | grep -q "^2\.4"; then \ echo "*** Can't build for 2.4 with a non-2.4 source!"; \ @@ -179,7 +200,7 @@ install_check: exit 1; \ fi -install_2.4: install_pccard install_pci install_plx +install_2.4: uninstall install_pccard install_pci install_plx install_2.5: install_conf $(MAKE) install_check @@ -232,6 +253,9 @@ install_pci: install_check install_crypt install_hostap cp -f $(MSRC)/$(MODULE_PCI) $(MODPATH_PCI) /sbin/depmod -ae +uninstall: + find $(MODPATH) -name "hostap*" | xargs rm -f + clean: rm -f $(MSRC)/{$(MODULE_CS),$(MODULE_PLX),$(MODULE_PCI)} -- cgit v0.12