Makefile
上传用户:beauty0755
上传日期:2022-02-24
资源大小:7k
文件大小:2k
源码类别:

驱动编程

开发平台:

Unix_Linux

  1. ifneq ($(KERNELRELEASE),)
  2. mymodule-objs := gpio.o
  3. obj-m := gpio.o 
  4. else
  5. TOOL_CHAIN_DIR = /opt/toolchains/atheros_ap71/tools/buildroot/build_armeb/bin
  6. export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:$(TOOL_CHAIN_DIR)
  7. PWD  := $(shell pwd)
  8. TOOLPREFIX :=armeb-linux-
  9. CROSS_COMPILE   :=  armeb-linux-
  10. CC              :=  $(CROSS_COMPILE)gcc
  11. STRIP :=  $(CROSS_COMPILE)strip
  12. KERNELPATH = ../../kernel/linux/
  13. CFLAGS := -mbig-endian -D__KERNEL__ -I../../kernel/linux/include -Wall -D__LINUX_ARM_ARCH__=5 -mcpu=xscale -mtune=xscale -DMODULE -D__linux -DCPU=XSCALE -DXSCALE=33 -Wno-trigraphs -malignment-traps -msoft-float -mapcs-32 -fno-common -pipe 
  14. #CFLAGS := -mbig-endian -D__KERNEL__ -I../../kernel/linux/include  -Wall -D__LINUX_ARM_ARCH__=5 -mcpu=xscale -mtune=xscale -DMODULE -D__linux -DCPU=XSCALE -DXSCALE=33 -Wno-trigraphs -malignment-traps -msoft-float -mapcs-32 -fno-common -pipe -Wstrict-prototypes -fno-strict-aliasing -ffreestanding -Os  -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mno-thumb-interwork -Wa -Uarm -Wdeclaration-after-statement -D__ixp42X
  15. CFLAGS += -I ../ixp400_xscale_sw/src/include/ -I ../ixp_osal/include/ -I ../ixp_osal/os/linux/include/core/ 
  16.   -I ../ixp_osal/include/modules/ioMem/ -I ../ixp_osal/include/modules/bufferMgt/ 
  17.   -I ../ixp_osal/os/linux/include/modules/bufferMgt/ -I ../ixp_osal/include/platforms/ixp400/ 
  18.   -I ../ixp_osal/os/linux/include/platforms/ixp400/ 
  19.   -I ../ixp_osal/os/linux/include/platforms/ixp400/ixp425/
  20. TARGET = gpio.o
  21. OBJS = gpio.o
  22. all:  $(TARGET)
  23. $(MAKE) ARCH=arm CROSS_COMPILE=$(TOOLPREFIX) -C $(KERNELPATH) M=$(PWD)
  24. gpio.o: gpio.c
  25. $(CC) $(CFLAGS) -c $<
  26. clean:
  27. rm -rf .*.cmd *.o *.mod.c *.ko .tmp_versions $(TARGET)
  28. install:
  29. cp gpio.ko  ../../target/lib/ 
  30. endif