makefile編寫例項

2021-07-05 17:25:37 字數 962 閱讀 3425

本文記述了乙個簡單的makefile編寫測試例項,第一步很重要,有了這個原始的例子,我們可以走得更遠,也是本人在學完《檔案清單如下:

created by sf.kaka 090329

main.c:

#include "func1.h"

#include "func2.h"

int main()

func1.c:

void func1_print(char *print_str)

func1.h

#ifndef __func1_h_h__

#define __func1_h_h__

void func1_print(char *print_str);

#endif //__func1_h_h__

func2.c

void func2_print(char *print_str)

func2.h

#ifndef __func2_h_h__

#define __func2_h_h__

void func2_print(char *print_str);

#endif //__func2_h_h__

makefile檔案:test.mak

main:main.o func1.o func2.o

armcc -o main main.o func1.o func2.o

main.o:main.c func1.h func2.h

armcc -c main.c

func1.o:func1.c 

armcc -c func1.c

func2.o:func2.c

armcc -c func2.c

clean:

rm -f *.o main

執行命令: **\make.exe -f test.mak即可

執行條件:gnu的make工具,armcc編譯器

Spring Cache編寫例項

首先我們來看一下如何使用spring3.1自己的cache,需要在命名空間中增加cache的配置 然後加入申明處理 然後在dao類中加入快取方法 andcache是儲存的地方 eventi是key值用於尋找儲存例項 cacheable value andcache key eventid publi...

例項學習編寫Makefile

1.test1.c包含主函式main的檔案 include int main 2a.test2 test2.c目錄下子檔案 include include test2.h int test2 func void 2b.test2 test2.h define test num 3 3a.test t...

shell指令碼編寫例項一

練習一 寫乙個指令碼 1.設定變數file的值為 etc passwd 2.依次向 etc passwd中的每個使用者問好,並且說出對方的id是什麼 hello,root,your uid is 0.3.統計乙個有多少個使用者 答案一 bin bash file etc passwd lines w...