Re: How to see the preprocessed output of a module source file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> On Mon, Nov 2, 2015 at 7:02 AM, Shiyao Ma <i@xxxxxxxxx> wrote:
>> Hi,
>> Say I am writing a module. Instead of directly compile it into a ko file, I'd like to see the preprocessed output of that file,
>> similarly the way it's done in gcc -E.

lets say you have a module named shiyao.c the makefile will look similar to:

-----------------------------------------------------------------------------
obj-m += shiyao.o

KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD       := $(shell pwd)

all:
    $(MAKE) -C $(KERNELDIR) M=$(PWD)

clean:
    $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
-----------------------------------------------------------------------------

change the target all to:

all:
    $(MAKE) -C $(KERNELDIR) M=$(PWD) shiyao.i

run make as usual then open shiyao.i in vi(m) or your preferred editor - done !

Thank's - Aruna





_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux