[guowenxue@localhost plat_driver]$ ls
dev_gprs.c dev_skelton.c gprs.cinclude Makefile
[guowenxue@localhost plat_driver]$ cat Makefile
ARCH = AT91SAM9260
PLAT ?= L300
CROSS_COMPILE ?= /opt/buildroot_350/build_arm/staging_dir/bin/arm-linux-uclibc-
LINUX_SRC ?= /home/guowenxue/l300/src/kernel/linux-2.6.33
INST_PATH=/tmp/tftp
PWD := $(shell pwd)
EXTRA_CFLAGS=-DPLAT_${PLAT}
EXTRA_CFLAGS=-DARCH_${ARCH}
obj-m += dev_skelton.o
obj-m += dev_gprs.o
dev_gprs-objs := dev_gprs.o gprs.o
modules:
@make -C $(LINUX_SRC) M=$(PWD) modules
@make clear
@make install
uninstall:
rm -f ${INST_PATH}/*.ko
install:
cp -af *.ko ${INST_PATH}
tag:
@ctags --c-kinds=+defglmnstuvx --langmap=c:.c.h.ho.hem.het.hec.hev.him.hit.hic.hiv -R .
@cscope -Rbq
clear:
@rm -f *.o *.cmd *.mod.c
@rm -rf *~ core .depend .tmp_versions Module.symvers modules.order -f
@rm -f .*ko.cmd .*.o.cmd
clean: clear
@rm -f *.ko
distclean: clear
@rm -f cscope* tags
@rm -f *.ko
原文链接:https://www.f2er.com/javaschema/286703.html