travishaberman
asked on
Help with a simple make file.
Hello experts. I need to create a simple make file for these files.
main.cpp
BTree.h
BTree.cpp
TreeNode.h
TreeNode.cpp
My instructor gave us this template for the file but I am having trouble understanding it. Could you please help me fill in the gaps? Also are there any lines I need to add to main for the file to work properly?
Thank you Experts,
-TH
========================== ========== ========== ========== ===
#compiler command
C++ = g++
# compiler flags
#-g for gdb
#-Wall to check errors and warnings
C++ FLAGS = -c -Wall
#linker command
LINKER = g++
#linker flags
LINKER-FLAGS = -o
# object files and main target
OBJS = <--------- What goes here?
TARGET = <--------- What goes here?
$(TARGET)= $(OBJS)
$(LINKER) $(LINKER-FLAGS) $(TARGET) $(OBJS)
clean:
rm *.o
main.cpp
BTree.h
BTree.cpp
TreeNode.h
TreeNode.cpp
My instructor gave us this template for the file but I am having trouble understanding it. Could you please help me fill in the gaps? Also are there any lines I need to add to main for the file to work properly?
Thank you Experts,
-TH
==========================
#compiler command
C++ = g++
# compiler flags
#-g for gdb
#-Wall to check errors and warnings
C++ FLAGS = -c -Wall
#linker command
LINKER = g++
#linker flags
LINKER-FLAGS = -o
# object files and main target
OBJS = <--------- What goes here?
TARGET = <--------- What goes here?
$(TARGET)= $(OBJS)
$(LINKER) $(LINKER-FLAGS) $(TARGET) $(OBJS)
clean:
rm *.o
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OOOps.. Didn't see your typo comment.. Let me try and fix that...
-TH
-TH
ASKER
I have to take a break for a few so I will get back to you..
Thank you,
-TH
Thank you,
-TH
ASKER
Tried again today and it worked great .. Thanks..
-TH
-TH
ASKER
Makefile:24: *** commands commence before first target. Stop.
Below is exactly what I have. What does this error mean?
#compiler command
C++ = g++
# compiler flags
# g- for gdb
# -Wall to check errors and warnings
C++ FLAGS = -c -Wall
#linker command
LINKER = g++
#linker flags
LINKER-FLAGS = -o
# object files and main target
OBJS = main.o BTree.o TreeNode.o
TARGET = main
$(TARGET) = $(OBJS)
$(LINKER-FLAGS) $(TARGET) $(OBJS)
clean:
rm *.o