CSCI 261 - Programming Concepts - Spring 2022

Assignment 3 Makefile

TARGET = A3
SRC_FILES = main.cpp word_functions.cpp

CXX = g++
CFLAGS = -Wall -g 

OBJECTS = $(SRC_FILES:.cpp=.o)

ifeq ($(shell echo "Windows"), "Windows")
	TARGET := $(TARGET).exe
	DEL = del
else
	DEL = rm
endif

all: $(TARGET)

$(TARGET): $(OBJECTS)
	$(CXX) -o $@ $^

.cpp.o:
	$(CXX) $(CFLAGS) -o $@ -c $<

clean:
	$(DEL) $(TARGET) $(OBJECTS)