| 1 |
# LEDs driver for PCEngines ALIX 2/3 series module Makefile |
| 2 |
# |
| 3 |
# This file is in the public domain. Permission to use, copy, modify, and |
| 4 |
# distribute this software and its documentation for any purpose and without |
| 5 |
# fee is hereby granted, without any conditions or restrictions. |
| 6 |
# This software is provided “as is” without express or implied warranty. |
| 7 |
# |
| 8 |
# Adam Cécile (Le_Vert) <[email protected]>, 2008-01-18 |
| 9 |
|
| 10 |
KERNEL_VERSION := `uname -r` |
| 11 |
KERNEL_DIR := /lib/modules/$(KERNEL_VERSION)/build |
| 12 |
INSTALL_MOD_DIR := kernel/drivers/leds |
| 13 |
PWD := $(shell pwd) |
| 14 |
|
| 15 |
obj-m := leds-alix.o |
| 16 |
SOURCE = $(subst .o,.c,$(obj-m)) |
| 17 |
MODULE = $(subst .o,.ko,$(obj-m)) |
| 18 |
|
| 19 |
all: $(MODULE) |
| 20 |
|
| 21 |
$(MODULE): $(SOURCE) |
| •22 |
$(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules |
| 23 |
|
| 24 |
install: $(MODULE) |
| •25 |
$(MAKE) -C $(KERNEL_DIR) M=$(PWD) INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) modules_install |
| 26 |
depmod -ae |
| 27 |
|
| 28 |
uninstall: |
| 29 |
rm -f /lib/modules/`uname -r`/$(INSTALL_MOD_DIR)/$(MODULE) |
| 30 |
depmod -ae |
| 31 |
|
| 32 |
distclean: clean |
| 33 |
|
| 34 |
clean: |
| 35 |
rm -f *.o *.ko .*.cmd .*.flags *.mod.c Module.symvers |
| 36 |
rm -rf .tmp_versions |