LinuxÏÂCÓïÑÔ±à³Ì»ù´¡(Makefile)
LinuxÏÂCÓïÑÔ±à³Ì»ù´¡(Makefile)
2005-01-18 10:28:23 À´×Ô£ºÈüµÏÍø
¼ÙÉèÎÒÃÇÓÐÏÂÃæÕâÑùµÄÒ»¸ö³ÌÐò£¬Ô´´úÂëÈçÏ£º
/* main.c */
#include "mytool1.h"
#include "mytool2.h"
int main(int argc£¬char **argv)
{
mytool1_print("hello")£»
mytool2_print("hello")£»
}
/* mytool1.h */
#ifndef _MYTOOL_1_H
#define _MYTOOL_1_H
void mytool1_print(char *print_str)£»
#endif
/* mytool1.c */
#include "mytool1.h"
void mytool1_print(char *print_str)
{
printf("This is mytool1 print %s "£¬print_str)£»
}
/* mytool2.h */
#ifndef _MYTOOL_2_H
#define _MYTOOL_2_H
void mytool2_print(char *print_str)£»
#endif
/* mytool2.c */
#include "mytool2.h"
void mytool2_print(char *print_str)
{
printf("This is mytool2 print %s "£¬print_str)£»
}
µ±È»ÓÉÓÚÕâ¸ö³ÌÐòºÜ¶Ì£¬ÎÒÃÇ¿ÉÒÔÕâÑùÀ´±àÒë:
gcc -c main.c
gcc -c mytool1.c
gcc -c mytool2.c
gcc -o main main.o mytool1.o mytool2.o
Õâ
ÑùµÄ»°ÎÒÃÇÒ²¿ÉÒÔ²úÉúmain³ÌÐò£¬¶øÇÒÒ²²»ÊǺÜÂé·³¡£µ«ÊÇÈç¹ûÎÒÃÇ¿¼ÂÇÒ»ÏÂÈç¹ûÓÐÒ»ÌìÎÒÃÇÐÞ¸ÄÁËÆäÖеÄÒ»¸öÎļþ(±ÈÈç˵mytool1.c)ÄÇôÎÒÃÇÄÑ
µÀ»¹ÒªÖØÐÂÊäÈëÉÏÃæµÄÃüÁî?Ò²ÐíÄã»á˵£¬Õâ¸öºÜÈÝÒ×½â¾ö°¡£¬ÎÒдһ¸ö
SHELL½Å±¾£¬ÈÃËü°ïÎÒÈ¥Íê³É²»¾Í¿ÉÒÔÁË¡£ÊǵĶÔÓÚÕâ¸ö³ÌÐòÀ´Ëµ£¬ÊÇ¿ÉÒÔÆðµ½×÷Óõġ£µ«Êǵ±ÎÒÃǰÑÊÂÇéÏëµÄ¸ü¸´ÔÓÒ»µã£¬Èç¹ûÎÒÃǵijÌÐòÓм¸°Ù¸öÔ´³ÌÐòµÄ
ʱºò£¬ÄѵÀÒ²Òª±àÒëÆ÷ÖØÐÂÒ»¸öÒ»¸öµÄÈ¥±àÒë?
Ϊ´Ë£¬´ÏÃ÷µÄ³ÌÐòÔ±ÃÇÏë³öÁËÒ»¸öºÜºÃµÄ¹¤¾ßÀ´×öÕâ¼þÊÂÇ飬Õâ¾ÍÊÇmake¡£ÎÒÃÇÖ»ÒªÖ´ÐÐ
ÒÔÏÂmake£¬¾Í¿ÉÒÔ°ÑÉÏÃæµÄÎÊÌâ½â¾öµô¡£ÔÚÎÒÃÇÖ´ÐÐmake֮ǰ£¬ÎÒÃÇÒªÏȱàдһ¸ö·Ç³£ÖØÒªµÄÎļþ¡£--Makefile¡£¶ÔÓÚÉÏÃæµÄÄǸö³ÌÐòÀ´Ëµ£¬¿É
ÄܵÄÒ»¸öMakefileµÄÎļþÊÇ£º
# ÕâÊÇÉÏÃæÄǸö³ÌÐòµÄMakefileÎļþ:
main£ºmain.o mytool1.o mytool2.o
gcc -o main main.o mytool1.o mytool2.o
main.o£ºmain.c mytool1.h mytool2.h
gcc -c main.c
mytool1.o£ºmytool1.c mytool1.h
gcc -c mytool1.c
mytool2.o£ºmytool2.c mytool2.h
gcc -c mytool2.c
ÓÐÁËÕâ¸öMakefileÎļþ£¬²»ÂÛÎÒÃÇʲôʱºòÐÞ¸ÄÁËÔ´³ÌÐòµ±ÖеÄʲôÎļþ£¬ÎÒÃÇÖ»ÒªÖ´ÐÐmakeÃüÁÎÒÃǵıà
Ïà¹ØÎĵµ£º
QT
http://www.trolltech.com
http://www.qiliang.net/qt.html
QtÊÇTrolltech¹«Ë¾µÄÒ»¸ö¶àƽ̨µÄC++ͼÐÎÓû§½çÃæÓ¦ÓóÌÐò¿ò¼Ü¡£ËüÌṩ¸øÓ¦ÓóÌÐò¿ª·¢Õß½¨Á¢ÒÕÊõ¼¶µÄͼÐÎÓû§½çÃæËùÐèµÄËùÓù¦ÄÜ¡£QtÊÇÍêÈ«ÃæÏò¶ÔÏóµÄºÜÈÝÒ×À©Õ¹£¬²¢ÇÒÔÊÐíÕæÕýµØ×é¼þ±à³Ì¡£×Ô´Ó1996ÄêÔçЩʱºò£¬Qt½øÈëÉÌÒµÁìÓò£¬ËüÒѾ³ÉΪȫÊÀ½ç·¶ ......
1 ½ø³Ì¹ÜÀíÏà¹Ø´úÂë
1.1 thread_info½á¹¹£¬ÔÚÎļþ<asm/thread_info.h>Öж¨Òå
struct thread_info {
struct task_struct *task;
struct exec ......
1. ·þÎñÆ÷nfsµÄÅäÖÃ
2. ¿Í»§¶ËnfsµÄÅäÖÃ
3. ʹÓÃnfs
3.1 ×÷Ϊ¹²ÏíÎļþϵͳmount
3.2 ×÷Ϊ¸ùÎļþϵͳmount
4.±¸ ×¢
nfsÊÇNetwork File System£¬»ùÓÚRPC(Remote Procedure Call ProtocolÔ¶³Ì¹ý³Ìµ ......
1 cron
ÒÔÏ£¬ÊÇctontabµÄ¸ñʽ£º
·Ö<>ʱ<>ÈÕ<>ÔÂ<>ÐÇÆÚ<>ÒªÔËÐеÄÃüÁî
ÆäÖÐ<>±íʾ¿Õ¸ñ¡£
ÕâÀïÓÐc r o n t a bÎļþÌõÄ¿µÄһЩÀý×Ó£º
30 21* * * /apps/bin/cleanup.sh
ÉÏÃæµÄÀý×Ó±íʾÿÍíµÄ2 1 : 3 0ÔËÐÐ/ a p p s / b i nĿ¼ÏµÄc l e a n u p . s h¡£
45 4 1,10,22 * ......