在一台機器上寫好這樣的Makefile用以編譯modules

obj-m:=hello.o

CURRENT_PATH:=$(shell pwd)
VERSION_NUM:=$(shell uname -r)
LINUX_PATH:=/usr/src/linux-$(VERSION_NUM)
all :
  make -C $(LINUX_PATH) M=$(CURRENT_PATH) modules
clean:
  make -C $(LINUX_PATH) M=$(CURRENT_PATH) clean

  

直接複製貼上,到新的機器上竟然不成功。

必須要自己把上面那兩個make用backspace拉到開頭再按一次tab

千萬別用space

[心得]編寫Linux kernel modules時惱人的Makefile的更多相关文章

  1. Linux Kernel basics

    Linux内核作用: The Linux kernel is the heart of the operating system. It is the layer between the user w ...

  2. How to compile and install Linux Kernel 5.1.2 from source code

    How to compile and install Linux Kernel 5.1.2 from source code Compiling a custom kernel has its adv ...

  3. Linux kernel 2.6下的modules编译与KBuild

    转载:http://blog.sina.com.cn/s/blog_602f87700100dq1u.html Sam之前在Linux kernel 2.4下写过一些driver.但自从转到kerne ...

  4. Linux Kernel 排程機制介紹

    http://loda.hala01.com/2011/12/linux-kernel-%E6%8E%92%E7%A8%8B%E6%A9%9F%E5%88%B6%E4%BB%8B%E7%B4%B9/ ...

  5. linux kernel笔记

    文章目录 关于linux内核中的__attribute__关键字 Linux kernel启动参数 gdt / ldt PCB 关于linux内核中的__attribute__关键字 part I: ...

  6. Linux kernel make 常用选项介绍

    Linux kernel 编译方法大全记录 一.这是一个我自己写的自动make脚本: #!/bin/sh export ARCH=arm export CROSS_COMPILE=arm-linux- ...

  7. archlinux 传统方法编译内核linux kernel 3.3.7

    From: http://hi.baidu.com/flashgive/item/eaef6326b5eb73d3a417b662 archlinux中传统方法编译内核 1)下载内核以及补丁并解压: ...

  8. Linux kernel develop -- Hello World

    hello.c: #include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h&g ...

  9. Linux LSM(Linux Security Modules) Hook Technology

    目录 . 引言 . Linux Security Module Framework Introduction . LSM Sourcecode Analysis . LSMs Hook Engine: ...

随机推荐

  1. Address already in use : connect

    Address already in use : connect 错误以及处理 项目中有过手写并发测试,在长时间的并发测试(超过20秒,美妙超过2000)的情况下出现了以上错误 处理方法如下(抄的) ...

  2. jquery+ajax获取本地json对应数据

    首先,记得导入jquery.js文件. json内容: var obj123=[        {"option":"2,3,9,14,19,24,32",&q ...

  3. Android 虚线实现绘制 - DashPathEffect

    前言: 通过view绘制虚实线,采用Android自带API--DashPathEffect.具体使用请参考更多的链接,这里只是讲解. 构造函数 DashPathEffect 的构造函数有两个参数: ...

  4. smbmnt - 装载 SMB 文件系统的协助工具

    总览 smbmnt mount-point [ -s share ] [ -r ] [ -u uid ] [ -g gid ] [ -f mask ] [ -d mask ] 描述 smbmnt 用于 ...

  5. 解析天启rk3288源码 /kernel/drivers/char/virtd

    virtd为编译后产生的中间文件,可使用ELF格式逆向 1.ELF文件内容解析readelf: 可解析ELF文件的所有内容;strings: 查看ELF文件中的字符串;file   : 查看ELF文件 ...

  6. Centos7 安装 clamav

    环境 CentOS: 7.x 下载 下载地址 :http://www.clamav.net/downloads,使用目前最新版本为:clamav-0.101.3 使用 wget 下载 wget htt ...

  7. ltp-ddt genload

    under folder tools\genload   genload.c             "`%s' imposes certain types of compute stres ...

  8. No enclosing instance of type TestGson is accessible. Must qualify the allocation with an enclosing instance of type TestGson (e.g. x.new A() where x is an instance of TestGson).

    main方法中实例化内部类报错: public class TestGson { public static void main(String[] args) { Gson gson=new Gson ...

  9. Hibernate 一对一(基于唯一外键的关联)

    主表 hbm.xml中 使用<one-to-one> 从表hbm.xml中使用<many-to-one> 并指定unique=true people.hbm.xml: < ...

  10. 第05章 AOP细节

    第05章 AOP细节 1.切入点表达式 1.1 作用 通过表达式的方式定位一个或多个具体的连接点. 1.2 语法细节 ①切入点表达式的语法格式 execution([权限修饰符] [返回值类型] [简 ...