Simplified Makefile for 2.5.x kernels

Pavel Roskin proski
Thu Apr 24 15:03:37 PDT 2003


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

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.

Pavel Roskin
-------------- next part --------------
--- Makefile
+++ Makefile
@@ -34,7 +34,14 @@
+# 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
 	@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"
 include $(KERNEL_PATH)/.config
-ifdef CONFIG_X86
-MACHINE        := mach-visws
-MACHINE_       := mach-visws
-MACHINE        := mach-generic
-MACHINE_       := mach-default
-CFLAGS += -I$(KERNEL_PATH)/arch/i386/$(MACHINE)
-CFLAGS += -I$(KERNEL_PATH)/include/asm/$(MACHINE_)
 CFLAGS += -mno-fp-regs -ffixed-8
@@ -155,10 +149,14 @@
-	@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
 install: install_info
 	@if [ ! -d "$(MODPATH)" ]; then \

More information about the Hostap mailing list