Makefile
上传用户:beauty0755
上传日期:2022-02-24
资源大小:7k
文件大小:1k
- ifneq ($(KERNELRELEASE),)
- mymodule-objs := spi.o
- obj-m := spi.o
- else
- TOOL_CHAIN_DIR = /opt/toolchains/atheros_ap71/tools/buildroot/build_armeb/bin
- export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:$(TOOL_CHAIN_DIR)
- PWD := $(shell pwd)
- TOOLPREFIX :=armeb-linux-
- CROSS_COMPILE := armeb-linux-
- CC := $(CROSS_COMPILE)gcc
- STRIP := $(CROSS_COMPILE)strip
- KERNELPATH = ../../kernel/linux/
- 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
- #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
- TARGET = spi.o
- OBJS = spi.o
- all: $(TARGET)
- $(MAKE) ARCH=arm CROSS_COMPILE=$(TOOLPREFIX) -C $(KERNELPATH) M=$(PWD)
- spi.o: spi.c
- $(CC) $(CFLAGS) -c $<
- clean:
- rm -rf .*.cmd *.o *.mod.c *.ko .tmp_versions $(TARGET)
-
- install:
- cp spi.ko ../../target/lib/
-
- endif