My Makefile was fine. However, now I want to have a folder named "Makefile" and a folder named "main", where the first will contain my Makefiles and the second will contain files that are meant to be the main()
of my my project, k-d GeRaF.
For now, the header files lie in the same folder. That folder also contains Makefile folder and main folder.
Here is my makefile (have tried many combinations, this is the last attempt):
OBJS = main_par_auto.o
SOURCE = ../main/main_par_auto.cpp
HEADER = ../Division_Euclidean_space.h ../Find_diameter.h ../Find_k_max.h ../Householder.h ../IO.h ../Mean_variance.h ../Point.h ../Random_generator.h ../Random_kd_forest.h ../Tree.h ../Auto_random_kd_forest.h
OUT = geraf
CXX = g++
FLAGS = -pthread -std=c++0x -DRKD_PAR -O3 -Wall
all: $(OBJS)
$(CXX) $(OBJS) -o $(OUT) $(FLAGS)
# create/compile the individual files >>separately<<
main_par_auto.o: main_par_auto.cpp
$(CXX) -c ../main/main_par_auto.cpp $(FLAGS)
.PHONY : all
# clean house
clean:
rm -f $(OBJS)
and I am getting this error:
make: *** No rule to make target `main_par_auto.cpp', needed by `main_par_auto.o'. Stop.
I am executing this command: make -f Makefile/Makefile_par_auto
in order to compile.
What am I missing please?
This is the big picture ( literally :) )
main_par_auto.o: ../main/main_par_auto.cpp
? – jadhachemmake: *** No rule to make target `../main/main_par_auto.cpp`, needed by
main_par_auto.o'. Stop.` – gsamaras