Makefile

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

SOURCES= example1_use_with_single_object.cpp \
		 example2_use_with_array.cpp \
		 example3_avoiding_memory_leaks.cpp \
		 example4_double_delete_and_undefined_behavior.cpp \
		 example5_using_delete_in_a_class_with_destructor.cpp
OBJECTS= $(SOURCES:.cpp=.o)
EXEC= $(SOURCES:.cpp=.x)
all: $(EXEC)

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

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