Makefile

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Examples 1-3 is C++11
# Example 4 is C++17
CC= g++
CCFLAGS= -std=c++17

SOURCES= example3_enum_classes.cpp\
		 example1_day_of_week.cpp\
		 example2_fall_through_behavior.cpp\
		 example4_switch_with_initialization.cpp
OBJECTS= $(SOURCES:.cpp=.o)
EXEC= $(SOURCES:.cpp=.x)
all: $(EXEC)

%.x: %.cpp
	$(CC) $(CCFLAGS) -o $@ $<

clean:
	rm -rf *.o *.x
Back to switch