- no need to define external dependencies
- use default compiler / linker settings.
Why is the script then? If all the project source files are *.cpp and in the current directory:
all: $(notdir $(CURDIR)) $(notdir $(CURDIR)): $(subst .cpp,.o,$(wildcard *.cpp)) $(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@
The Makefile will create all source files with default compiler / linker settings in an executable file with a name after the name of the current directory.
Otherwise, I usually recommend that people try SCons instead of doing where it is much simpler and more intuitive. Added bonus that there is no need to manually encode clean targets, source and header dependency checking is built-in, it is recursive and supports libraries properly.
Dummy00001
source share