Make files
I have recently pushed all my files into sub directories. I wish to be able keep them there in an organised fashion. However I am having trouble getting a makefile to do this job, currently I have in each subdirectory the header file and .cpp file associated with that unit of functionality.
I have this type of arrangement here: all: Sim Sim: .Energy.o Sorts.o FileHandling.o MyMatrix.o BeadBead.o Cell.o Display.o Initialize.o Translation.o Clash.o MyRandom.o MC.o g++ -o Sim Energy.o Sorts.o FileHandling.o MyMatrix.o BeadBead.o Cell.o Display.o Initialize.o Translation.o Clash.o MyRandom.o MC.o Energy.o: Energy.cpp g++ -c -Wno-deprecated Energy.cpp I have tried the usual ../Energy/kjhkdh.cpp but this does not seem to work. How can I do this easily and simply. I dont mind where the object files end up, but would like the executable in the main directory. Thanks |
Maybe try to use -o option of g++.
Regards Janusz |
what do you do you have an example?
|
-o option gives name and location of executable file.
Janusz |
i am not sure what you mean?
|
Just remember that everything is relative to the current execution path of the makefile. If you have a dependency that is not in the same path, you need to specify the path in the dependency list. Maybe you need this?
Code:
Sim: Energy/Energy.o #... |
All times are GMT -5. The time now is 07:10 PM. |