Question: Makefile help - I need a makefile that will build all of these files in the 'src' folder and release the .o files into the

Makefile help - I need a makefile that will build all of these files in the 'src' folder and release the .o files into the 'rel' folder; however, then I also need the makefile to create a debug build and put all of its files into the 'dbg' folder. The makefile also needs to create the folders dbg and rel beforehand/check if they are already made.

Makefile help - I need a makefile that will build all of

My current makefile:

CXX = g++

CXXFLAGS = -Wall

EXE = hw06

SRCDIR = src

RELDIR = rel

SRCS = main.cpp Critter.cpp Doodlebug.cpp Environment.cpp Ant.cpp

OBJS = $(SRCS:%.cpp=%.o)

OBJS := $(addprefix $(SRCDIR)/, $(OBJS))

.PHONY : all clean

all : $(OBJS)

$(CXX) $(CXXFLAGS) -o $(EXE) $^

$(SRCDIR)/%.o : $(SRCDIR)/%.cpp

$(CXX) $(CXXFLAGS) -c -o $@ $

clean :

rm -f $(OBJS) core $(EXE)

Program6 dbg rel src Ant.cpp ?Ant.hpp a Critter.cpp ?Critter.hpp ?Doodlebug.cpp Doodlebug.hpp ?Environment.cpp Environment.hpp main.cpp makefile Program6 dbg rel src Ant.cpp ?Ant.hpp a Critter.cpp ?Critter.hpp ?Doodlebug.cpp Doodlebug.hpp ?Environment.cpp Environment.hpp main.cpp makefile

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!