【问题标题】:I want to know about command in makefile我想知道makefile中的命令
【发布时间】:2015-02-06 11:17:49
【问题描述】:
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

我学习makefile的时候,没有资料

#
all : $(TARGET) 

% 和 $^ 的功能。我想检查一下这些东西。感谢您的帮助。

【问题讨论】:

    标签: linux makefile command fortran


    【解决方案1】:

    all 是一个目标(在该 makefile 中无缘无故地重复了两次)。 clean 也是如此。目标是 make 的工作方式。见Rule Example。

    $^ 是可用于目标配方的Automatic Variables 之一。

    % 是在某些 make functions 和 Pattern Rules 中使用的通配符。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-04
      • 2018-08-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多