Makefileの基本
#Fleeting_Notes
Makefileの基本(fundamental of makefile)
Makefileはターゲット(target)、必須項目(prerequisites)、レシピ(recipe)
code:Makefile
target: prereq1 prereq2
# コメント
# ←インデントはタブでないとエラーになる
commands
code:Makefile
hello:
echo "Hello, world
code:Makefile
# 変数定義
SRCS := test1.c file1.c
OBJS := test1.o file1.o
code:Makefile
# 変数定義
SRCS := test1.c file1.c
OBJS := test1.o file1.o
code:Makefile
CFLAGS := -Wall -Wextra -Wtrampolines -Wconversion -Wsign-conversion -Walloc-zero -Wformat-security
SRCS := test1.c file1.c
CFLAGS =
.PHONY: all
all:
扱いやすそうなMakefileテンプレート
確認用
参考
Make覚書 - Qiita
『CおよびC++のコンパイラ・オプション強化ガイド』 - The Linux Foundation
調査用
Google.icon Makefileの基本(日)
Google.icon Fundamental of makefile(英)