From: Mathieu Bérard Date: Sat, 24 Mar 2007 23:05:54 +0000 (+0000) Subject: * Cleanup Makefile: X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=b6e824a8ed521c495145d276e0f26f22f99d56a2;p=omnibook.git * Cleanup Makefile: module confguration is now done editing Makefile and not omnibook.h anymore --- diff --git a/Makefile b/Makefile index 14c2b7d..7aeafa6 100644 --- a/Makefile +++ b/Makefile @@ -12,11 +12,35 @@ # General Public License for more details. # # Written by Soós Péter , 2002-2004 +# Modified by Mathieu Bérard , 2006-2007 # -MODULE_NAME = omnibook +#Module informations + +MODULE_NAME = omnibook +MODULE_VERSION = 2.20070211 +MODULE_BRANCH = trunk + +# Out-of-tree configuration +ifndef CONFIG_OMNIBOOK +OMNIBOOK_STANDALONE=y +CONFIG_OMNIBOOK=m + +#Uncomment and set to force debug behavior +#NOTE: Default (commented) behavior is to enable debug in trunk or branch svn +# snapshot and to disable it for release +#OMNIBOOK_WANT_DEBUG=n + +#comment to disable backlight device support +OMNIBOOK_WANT_BACKLIGHT=y + +#Uncomment to force legacy (pre-ACPI system) features support +#OMNIBOOK_WANT_LEGACY=y + +endif ifeq ($(KERNELRELEASE),) +# Support for direct Makefile invocation DESTDIR = MODDIR = $(DESTDIR)/lib/modules @@ -30,8 +54,6 @@ KMODDIR = $(KSRC)/drivers/misc/omnibook KDOCDIR = $(KSRC)/Documentation/omnibook PWD = $(shell pwd) TODAY = $(shell date +%Y%m%d) -KERNEL = $(shell echo $(KVER) | cut -d . -f 1-2) - DEPMOD = /sbin/depmod -a RMMOD = /sbin/modprobe -r INSMOD = /sbin/modprobe @@ -39,21 +61,6 @@ INSTALL = install -m 644 MKDIR = mkdir -p RM = rm -f FIND = find -endif - -DEBUG = -D OMNIBOOK_DEBUG # -g -O0 - -EXTRA_CFLAGS += -D OMNIBOOK_STANDALONE $(DEBUG) -EXTRA_LDFLAGS += $(src)/sections.lds - - -OBJS = init.o lib.o ec.o kbc.o pio.o compal.o acpi.o nbsmi.o \ - ac.o battery.o blank.o bluetooth.o cooling.o display.o dock.o \ - dump.o fan.o fan_policy.o hotkeys.o info.o lcd.o muteled.o \ - polling.o temperature.o touchpad.o wireless.o throttling.o - -obj-m += $(MODULE_NAME).o -omnibook-objs := $(OBJS) all: $(MODULE_NAME).ko @@ -80,10 +87,6 @@ uninstall: unload $(FIND) $(VMODDIR) -name "$(MODULE_NAME).ko" -exec $(RM) {} \; $(DEPMOD) -uninstall-all: unload - $(FIND) $(MODDIR) -name "$(MODULE_NAME).ko" -exec $(RM) {} \; - $(DEPMOD) - $(MODULE_NAME).ko: $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) modules @@ -98,8 +101,10 @@ kpatch: kinstall (cd $(KSRC); patch -p1 < $(PWD)/misc/omnibook-integration.patch) version: - sed -i "s|^\(#define OMNIBOOK_MODULE_VERSION.*\)\".*\"|\1\"2.$(TODAY)\"|" omnibook.h + sed -i "s|^\(MODULE_VERSION = \).*|\1 2.$(TODAY)|" Makefile + sed -i "s|^\(MODULE_BRANCH = \).*|\1 release|" Makefile sed -i "s|^\(2\.\)X\{8\}|\1$(TODAY)|" doc/ChangeLog + release: clean version mkdir -p ../$(MODULE_NAME)-2.$(TODAY) @@ -107,4 +112,59 @@ release: clean version rm -f ../$(MODULE_NAME)-2.$(TODAY).tar ../$(MODULE_NAME)-2.$(TODAY).tar.gz (cd ..; tar cvf $(MODULE_NAME)-2.$(TODAY).tar $(MODULE_NAME)-2.$(TODAY); gzip -9 $(MODULE_NAME)-2.$(TODAY).tar) +else +# Support for kernel build system invocation + +ifneq ($(MODULE_BRANCH), release) +EXTRA_CFLAGS += -DOMNIBOOK_MODULE_VERSION='"$(MODULE_VERSION)-$(MODULE_BRANCH)"' +else +EXTRA_CFLAGS += -DOMNIBOOK_MODULE_VERSION='"$(MODULE_VERSION)"' +endif + +ifeq ($(OMNIBOOK_STANDALONE),y) + +ifeq ($(OMNIBOOK_WANT_BACKLIGHT),y) +ifdef CONFIG_BACKLIGHT_CLASS_DEVICE +# we support backlight interface only after 2.6.16 +ifeq ($(shell if [ $(SUBLEVEL) -gt 16 ] ; then echo -n 'y'; fi),y) +EXTRA_CFLAGS += -DCONFIG_OMNIBOOK_BACKLIGHT +else +$(warning "Backlight support in only supported for kernel version newer than 2.6.16") +$(warning "Disabling backlight sysfs interface") +endif +endif +endif + +ifeq ($(OMNIBOOK_WANT_LEGACY),y) +EXTRA_CFLAGS += -DCONFIG_OMNIBOOK_LEGACY +endif + +ifndef CONFIG_ACPI_EC +EXTRA_CFLAGS += -DCONFIG_OMNIBOOK_LEGACY +endif + +ifneq ($(MODULE_BRANCH), release) +ifneq ($(OMNIBOOK_WANT_DEBUG),n) +EXTRA_CFLAGS += -DCONFIG_OMNIBOOK_DEBUG # -Wa -g0 +endif +else +ifeq ($(OMNIBOOK_WANT_DEBUG),y) +EXTRA_CFLAGS += -DCONFIG_OMNIBOOK_DEBUG # -Wa -g0 +endif + +endif + +endif + +EXTRA_CFLAGS += -DOMNIBOOK_MODULE_NAME='"$(MODULE_NAME)"' +EXTRA_LDFLAGS += $(src)/sections.lds + +obj-$(CONFIG_OMNIBOOK) += $(MODULE_NAME).o +omnibook-objs := init.o lib.o ec.o kbc.o pio.o compal.o acpi.o nbsmi.o \ + ac.o battery.o blank.o bluetooth.o cooling.o display.o dock.o \ + dump.o fan.o fan_policy.o hotkeys.o info.o lcd.o muteled.o \ + polling.o temperature.o touchpad.o wireless.o throttling.o + +endif # End of kernel build system part + # End of file diff --git a/init.c b/init.c index 500ddfd..13998bb 100644 --- a/init.c +++ b/init.c @@ -517,6 +517,7 @@ module_init(omnibook_module_init); module_exit(omnibook_module_cleanup); MODULE_AUTHOR("Soós Péter, Mathieu Bérard"); +MODULE_VERSION(OMNIBOOK_MODULE_VERSION); MODULE_DESCRIPTION ("Kernel interface for HP OmniBook, HP Pavilion, Toshiba Satellite and Compal ACL00 laptops"); MODULE_LICENSE("GPL"); diff --git a/omnibook.h b/omnibook.h index 7c8cac2..9f05275 100644 --- a/omnibook.h +++ b/omnibook.h @@ -13,7 +13,7 @@ * General Public License for more details. * * Written by Soós Péter , 2002-2004 - * Modified by Mathieu Bérard , 2006 + * Modified by Mathieu Bérard , 2006-2007 */ #include @@ -21,13 +21,6 @@ #include #include -/* - * Module informations - */ - -#define OMNIBOOK_MODULE_NAME "omnibook" -#define OMNIBOOK_MODULE_VERSION "2.20070211-trunk" - /* * EC types */ @@ -141,26 +134,4 @@ void omnibook_report_key(struct input_dev *dev, unsigned int keycode); #define dprintk_simple(fmt, args...) do { } while(0) #endif - - - -/* - * Configuration for standalone compilation: - * -Register as backlight depends on kernel config (requires 2.6.17+ interface) - * -Legacy features disabled for ACPI enabled system - */ - -#ifdef OMNIBOOK_STANDALONE -#if (defined (CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE)) && (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16)) -#define CONFIG_OMNIBOOK_BACKLIGHT -#else -#undef CONFIG_OMNIBOOK_BACKLIGHT -#endif /* BACKLIGHT_CLASS_DEVICE */ -#ifdef CONFIG_ACPI_EC -#undef CONFIG_OMNIBOOK_LEGACY -#else -#define CONFIG_OMNIBOOK_LEGACY -#endif /* CONFIG_ACPI_EC */ -#endif /* OMNIBOOK_STANDALONE */ - /* End of file */