How to use Make

xiaoxiao2021-03-06  41

Under the shell's prompt symbol, if you type "make", it will find the Makefile file in the current directory. Then follow the steps recorded in the Makefile step by step. When we write, if you write the steps you need in advance in advance, you want the Compiler program, you want the Compiler program to enter the Make instruction. As long as the program is correct, you can get the required results! Makefile format: (1) Note: In Makefile, any text starting with "#" is annotated, and make it will ignore it when interpreting makefile. (2) Renew the down: In Makefile, if you are not enough to accommodate the order. The last addition of the line in the line () indicates that the next behavior is continued, and the two lines should be considered as a line. (3) Macro (Macro) The format is: string = value, for example: cflags = -o -systype BSD43 In fact, Make itself has many Default Macro, if you want to view these Macro, you can go to make -p command. (4) The rule format is as follows: : depend .... : depend .... (5) one Very simple Makefile assumes that we have a program to partially divided into parts: Menu.c The main program part of the Menu.h menu.c provides some Function Calls Utils for Menu.c Call. H utils.c's include file simultaneously this application is also used with ncurses' Function Calls. Menu.c and utils.c are placed under / usr / src / menu. But menu.h and utils.h are placed under / usr / src / menu / include. After the program is finished, the file is implemented as MENU and is put below / usr / bin.

转载请注明原文地址:https://www.9cbs.com/read-56008.html

New Post(0)