Answer the question
In order to leave comments, you need to log in
Why does the message "make: 'build' does not need to be updated" pop up?
I have this Makefile
PROJECT=GameOfLife
CXX=clang++-13
STD=c++2a
STDLIB=libstdc++
FLAGS=-Wall -Wextra
LINKARGS=-lsfml-graphics -lsfml-window -lsfml-system
SOURCES=src/main.cpp
OBJECTS=$(wildcard build/*.o)
build: $(SOURCES)
$(CXX) -c -std=$(STD) -stdlib=$(STDLIB) $(FLAGS) $(SOURCES)
mv *.o ./build
link: $(OBJECTS)
$(CXX) $(OBJECTS) -o bin/$(PROJECT) $(LINKARGS)
clean:
rm -rf bin/*
rm -rf build/*
compile:
make build
make link
run:
make compile
./bin/$(PROJECT)
.PHONY: clean compile run
make build
the first time, then everything works. When I run it a second time, I get this message:➜ make build
make: «build» не требует обновления.
GOL
┣ bin
┣ build
┣ include
┣ lib
┣ src
┃ ┗ main.cpp
┗ Makefile
Answer the question
In order to leave comments, you need to log in
Why does the message "make: 'build' does not need to be updated" pop up?
build: $(SOURCES)
mv *.o ./build
The and commands rm -rf build/*
make it newer than the source, so make thinks it doesn't need to be updated.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question