makefile - How do you automate a make file? -
how make makefile go through list of .cpp files , compile separately, statically?
test: test.o g++ -o test test.o test.o: test.cc test.hh g++ -c test.cc
but dynamically this?
sources = main.cpp someclass.cpp otherfile.cpp
objects = main.o someclass.o otherfile.o all: $objects %.o: %.cc g++ $< -c -o $@
if want enforce like-named headers each module, too, can:
objects = main.o someclass.o otherfile.o all: $objects %.o: %.cc %.hh g++ $< -c -o $@
Comments
Post a Comment