Simplified Makefile for 2.5.x kernels
Pavel Roskin
proski
Thu Apr 24 15:03:37 PDT 2003
Hello!
The code in the top-level Makefile to add machine-specific includes is not
needed anymore. Apparently it was added in the revision 1.27 to enable
building the driver for 2.5.x kernels, but was later superseded by a more
generic solution.
Also, I would like to hide from the user the name "2.5" in the targets.
It could become 2.6 some day, after all. If we have to build all targets,
then lets make "make all" do it, and "make install" would install all
modules.
There is a simple way to figure out the build system, used in the Orinoco
driver. If Rules.make is in the kernel tree, we assume the old build
system and ask the user what he wants. If Rules.make is not in the kernel
tree, there is no point in asking - we just build everything and ask the
user to run "make install".
Additional sanity checks for the kernel version have been left, but they
can be trivially killed later.
The patch is attached.
--
Regards,
Pavel Roskin
-------------- next part --------------
--- Makefile
+++ Makefile
@@ -34,7 +34,14 @@
MSRC=driver/modules
+# if Rules.make exists in the kernel tree, we assume 2.4 style modules
+# if it doesn't assume 2.5 style
+OLDMAKE = $(wildcard $(KERNEL_SRC)/Rules.make)
+
+ifeq (,$(OLDMAKE))
+all: 2.5
+else
all:
@echo "Select the version to be build:"
@echo "make pccard PC Card (PCMCIA) driver (Prism2 or Prism2.5)"
@@ -42,23 +49,10 @@
@echo "make pci Prism 2.5 PCI Card"
@echo "make crypt Make hostap_crypt*.o"
@echo "make hostap Make hostap.o"
- @echo "make 2.5 Make all modules for Linux kernel 2.5.x"
-
+endif
include $(KERNEL_PATH)/.config
-ifdef CONFIG_X86
-ifdef CONFIG_VISWS
-MACHINE := mach-visws
-MACHINE_ := mach-visws
-else
-MACHINE := mach-generic
-MACHINE_ := mach-default
-endif
-CFLAGS += -I$(KERNEL_PATH)/arch/i386/$(MACHINE)
-CFLAGS += -I$(KERNEL_PATH)/include/asm/$(MACHINE_)
-endif
-
ifdef CONFIG_ALPHA
CFLAGS += -mno-fp-regs -ffixed-8
endif
@@ -155,10 +149,14 @@
@echo
2.5_install_info:
- @echo "*** Become superuser and 'make install_2.5' to install the modules. ***"
+ @echo "*** Become superuser and 'make install' to install the modules. ***"
+ifeq (,$(OLDMAKE))
+install: install_2.5
+else
install: install_info
+endif
install_check:
@if [ ! -d "$(MODPATH)" ]; then \
More information about the Hostap
mailing list