a couple of Makefile issues
Posted
by
user1623249
on Stack Overflow
See other posts from Stack Overflow
or by user1623249
Published on 2012-09-16T03:36:09Z
Indexed on
2012/09/16
3:37 UTC
Read the original article
Hit count: 175
I've got this Makefile:
CFLAGS = -c -Wall
CC = g++
EXEC = main
SOURCES = main.cpp listpath.cpp Parser.cpp
OBJECTS = $(SOURCES: .cpp=.o)
EXECUTABLE = tp
DIR_SRC = /src/
DIR_OBJ = /obj/
all: $(SOURCES) $(OBJECTS)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(CFLAGS) $(OBJECTS) -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@
clean:
rm $(OBJECTS) $(EXECUTABLE)
Note this:
- I'm in the directory "." which contains the makefile
- The folder "./src" EXISTS, and has all the .h and .cpp files
- The folder "./obj" doesn't exist, I want makefile to create it and put all the .o there
The error I get is:
No rules to build "main.cpp", necessary for "all". Stopping.
Help!
© Stack Overflow or respective owner