简体   繁体   English

我想了解Makefile中的命令

[英]I want to know about command in makefile

FC= ifort

FCFLAGS=-O2 -r8 -openmp -mcmodel=large -extend-source -shared-intel -I$(HOME)/usr/include

LDFLAGS=-L$(HOME)/usr/lib -lfftw3 -lm

TARGET=Project

Project: a.o b.o c.o d.o 

#
all : $(TARGET)

%: %.o

    $(FC) $(FCFLAGS) -o $@ $^ $(LDFLAGS)

%.o: %.f90

    $(FC) $(FCFLAGS) -c $<

all : $(TARGET)

clean :

    rm *.o

when I studied makefile, there is no information for 当我学习makefile时,没有任何信息

#
all : $(TARGET) 

and function of % and $^ . %$^ I wanna check about these things. 我想检查一下这些事情。 Thanks for your help. 谢谢你的帮助。

all is a target (repeated twice in that makefile for no reason). all是目标(在该makefile中无故重复两次)。 So is clean . 所以很clean Targets are how make works. 目标是制造的方式。 See Rule Example . 请参阅规则示例

$^ is one of the Automatic Variables available for use in target recipes. $^是可用于目标配方的自动变量之一。

% is a wildcard used in some make functions and in Pattern Rules . %是在一些make 函数模式规则中使用的通配符。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM