Reputation: 826
I'm attempting to run an echo command in a Makefile when my .cpp files are modified.
Makefile:
src/*.cpp:
echo 'file has changed'
Command line:
$ mingw32-make.exe
mingw32-make: 'src/main.cpp' is up to date.
I'm confused as to why this says main.cpp
is up to date, even after I modify it. Shouldn't it output file has changed
?
Version info:
$ mingw32-make.exe --version
GNU Make 4.1
Built for i686-w64-mingw32
Upvotes: 0
Views: 92
Reputation: 262
You can have a target that depends on your *.cpp files:
cpp_files_are_up_to_date: src/*.cpp
echo 'files have changed'
echo.>cpp_files_are_up_to_date
Upvotes: 3