Hi,
I'm having a lot of trouble with a Makefile I am trying to make. I think it is a basic principles issue. When I try to make, I get the error a
buildfiles/bin/serial.o file not found error
And I have gone over this code multiple times. Based on the compiler, I believe the way I reference .cpp files into .o files is correct. Also the way I reference the dependencies is correct. I am trying to do this so that the gloab variables in global.cpp can be included in other files. They are externed in global.h. My makefile is as follows:
SRC_DIR = exospheres/src
INC_DIR = exospheres/include
BIN_OBJ_DIR = buildfiles/bin
CXX = QCC
CPPFLAGS += -Wno-deprecated
CXXFLAGS += -Wno-deprecated
INCLUDES += -I$(INC_DIR) \
-I.
SENSORS = $(SRC_DIR)/serial.cpp
CONTROL = $(SRC_DIR)/ABVCtrl.cpp \
$(SRC_DIR)/ABVstate.cpp \
$(SRC_DIR)/ABV.cpp \
$(SRC_DIR)/global.cpp \
$(SRC_DIR)/ABVControl.cpp
SOURCES_cpp = $(SENSORS) \
$(CONTROL) \
$(SRC_DIR)/main.cpp
OBJECTS_CONTROL = $(SOURCES_cpp:$(SRC_DIR)/%.cpp=$(BIN_OBJ_DIR)/%.o)
$(BIN_OBJ_DIR)/abv: $(OBJECTS_CONTROL)
$(CXX) -o $@ $(CXXFLAGS) $^
$(OBJECTS_CONTROL): $(INC_DIR)
.PHONY : clean
clean :
-rm $(BIN_OBJ_DIR)/abv $(OBJECTS_CONTROL)
I have been struggling with this and am really stumped. This is code for a PC104 board.
The QCC tag indicates a C++ compile for my OS. It should be identical to any makefile other than that.
Thanks much,
Connie
---------- Post updated 04-17-11 at 11:33 AM ---------- Previous update was 04-16-11 at 11:54 PM ----------
Sorry for the double post-I'm really trying to get this resolved. Does anyone have any ideas for this?