Skip to content

Instantly share code, notes, and snippets.

@lironsade
Created September 2, 2017 20:06
Show Gist options
  • Save lironsade/33544681773f96eefb8e0f3d315753b0 to your computer and use it in GitHub Desktop.
Save lironsade/33544681773f96eefb8e0f3d315753b0 to your computer and use it in GitHub Desktop.
CC=g++
LDLIBS=-lm
CFLAGS= -Wextra -Wall -Wvla -pthread -std=c++17
TARFLAGS= -cvf
TARARGS=README Makefile Point.h Point.cpp PointSet.h PointSet.cpp ConvexHull.cpp PointSetBinaryOperations.cpp
all: ConvexHull PointSetBinaryOperations
./PointSetBinaryOperations
tar: $(TARARGS)
tar $(TARFLAGS) ex1.tar $(TARARGS)
PointSet.o: PointSet.h PointSet.cpp
$(CC) $(CFLAGS) -c PointSet.cpp
Point.o: Point.h Point.cpp
$(CC) $(CFLAGS) -c Point.cpp
PointSetBinaryOperations: PointSetBinaryOperations.cpp PointSet.o Point.o
$(CC) $(cflags) PointSet.o Point.o PointSetBinaryOperations.cpp -o PointSetBinaryOperations
ConvexHull: Point.o PointSet.o ConvexHull.cpp
$(CC) $(cflags) Point.o PointSet.o ConvexHull.cpp -o ConvexHull
valgrind: ConvexHull
valgrind --leak-check=full --show-possibly-lost=yes --show-reachable=yes --undef-value-errors=yes ConvexHull
# should it remove tar, and exec too?
clean:
rm -f *.o ConvexHull PointSetBinaryOperations ex1.tar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment