Hello, I have another gnu make question. I am using it to compile a C++ program and I want all generated files except the final executable to be placed in subdirectory build/. Apart from object files additional files are also generated by the compiler.
Given this Makefile, what needs to change to accomplish what I want: CXX = g++ CXXFLAGS = -Wall -W -ansi -pedantic -g -c -o LD = g++ LDFLAGS = -o $(EXEC) OBJECTS = my_recipes_database.o read_recipe_file.o EXEC = add_recipes SRC = src/ all: $(OBJECTS) $(LD) $(OBJECTS) $(LDFLAGS) %.o: $(SRC)%.cpp $(CXX) $(CXXFLAGS) $@ $< clean: rm -f $(OBJECTS) $(EXEC) *~ This Makefile makes gnu make look for the source files in the source directory (good, I want that), but it puts all generated files in the current directory and I want it to put all generated files except the executable produced when linking to be put in subdirectory called build. Thanks for reading and replying / Eric _______________________________________________ help-gnu-utils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gnu-utils
