驱动模块之Makefile

ifeq ($(KERNELRELEASE),)
KERNELDIR ?= /home/arm/kernel_2.6.32
PWD := $(shell pwd)
modules:
  $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
modules_install:
  $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
cp:
  cp i2c_led.ko /mnt/test
clean:
  rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions

.PHONY: modules modules_install clean

else
  obj-m := i2c_led.o
endif

你可能感兴趣的:(职场,makefile,驱动,休闲)