Makefile syntax problems

Source: Internet
Author: User
Makefile syntax-General Linux technology-Linux programming and kernel information. For more information, see the following section. Below is a simple driver for printing characters
# Include
# Include

MODULE_LICENSE ("Dual BSD/GPL ");

Static int hello_init (void)
{
Printk ("hello, linux \ n ");
}

Static void hello_exit (void)
{
Printk ("goodbye linux \ n ");
}

Module_init (hello_init );
Module_exit (hello_exit );

Its Makefile is

1 EXEC = hello
2 OBJS = hello. o
3 SRC = hello. c

4 INCLUDE =/usr/src/linux-2.6.10/include
5 CC = arm-linux-gcc
6 LD = arm-linux-ld
7 MODCFLAGS =-O2-Wall-d1_kernel _-DMODULE-I $ (INCLUDE)-march = armv4t-c-o
8 LDFLAGS =-r

9 all: $ (EXEC)

10 $ (EXEC): $ (OBJS)
$ (LD) $ (LDFLAGS)-o $ @ $ (OBJS)

11%. o: %. c
$ (CC) $ (MODCFLAGS)-mapcs-c $ <-o $ @

12 clean:
-Rm-f $ (EXEC) *. o *~ Core

Question 1:
In row 3, what do the parameters-d1_kernel _-DMODULE and-march = armv4t mean?
Question 2:
What does the parameter-r of row 3 mean?
Question 3:
What does the parameter-mapcs in line 3 mean?
Question 4:
Line 1 parameters *~ And core
Question 5:
What should I do if I want to query the parameters related to arm-linux-gcc? # Info arm-linux-gcc. I tried it and it seems that I have no clue at all.
What if I want to query the Makefile related syntax?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.