Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

What coaching do you currently provide for your leaders?

Answered: 1 week ago