# Makefile

# CSE 333 C++ intro lecture code



CXX = g++

CPPFLAGS = -Wall -g -std=c++17

PROGS = hello helloworld helloworld2 concat manip helloworld3 echonum msg



# default target builds all executables

all: $(PROGS)



# hello world in C

hello: helloworld.c

	gcc -Wall -g -std=c17 -o $@ $<



# hello world in C++

helloworld: helloworld.cc

	$(CXX) $(CPPFLAGS) -o $@ $<



# hello world in C++ with namespace std

helloworld2: helloworld2.cc

	$(CXX) $(CPPFLAGS) -o $@ $<



# hello world with string concatenation

concat: concat.cc

	$(CXX) $(CPPFLAGS) -o $@ $<



# stream manipulators example

manip: manip.cc

	$(CXX) $(CPPFLAGS) -o $@ $<



# C++ example using printf

helloworld3: helloworld3.cc

	$(CXX) $(CPPFLAGS) -o $@ $<



# C++ example using cin for reading input

echonum: echonum.cc

	$(CXX) $(CPPFLAGS) -o $@ $<



# operator overloading peer instruction question code

msg: msg.cc

	$(CXX) $(CPPFLAGS) -o $@ $<



# phony target - remove generated files and backups

clean:

	rm -f *.o *~ $(PROGS)