Keep getting an error on this make file saying "No rule to make target '/Main.cpp', needed by 'Main.o'
HOME = /home/
CC = g++ -Wall -pedantic
PROJ = $(HOME)/Proj1
INCL = -I $(PROJ)
all: main.x
main.x: List.o Summary.o Main.o
< TAB >:$(CC) -o main.x List.o Summary.o Main.o
List.o: $(PROJ)/List.h $(PROJ)/List.cpp
< TAB >$(CC) -c $(INCL) $(PROJ)/List.cpp
Summary.o: $(PROJ)/Summary.h $(PROJ)/Summary.cpp
< TAB >$(CC) -c $(INCL) $(PROJ)/Summary.cpp
Main.o: $(PROJ)/Main.cpp
< TAB >$(CC) -c $(INCL) $(PROJ)/Main.cpp
clean:
< TAB >rm -rf *.o *~ *.x
thanks!
PROJ
variable somewhere, so that the prerequisite$(PROJ)/Main.cpp
is expanding to just/Main.cpp
. – MadScientist< TAB >
, is there anything else you have edited, or is this the exact same Makefile you're actually using ? – nosmain.x
target really start with a colon (i.e.:$(CC) -o main.x ...
)? Not sure what that's supposed to mean... Although that probably is unrelated to your question... – twalbergPROJ = $(HOME)/Proj1
part? – nos