Skip to content

Instantly share code, notes, and snippets.

@lironsade
Created September 1, 2017 20:15
Show Gist options
  • Save lironsade/150865156f880a98b4de860bc988a157 to your computer and use it in GitHub Desktop.
Save lironsade/150865156f880a98b4de860bc988a157 to your computer and use it in GitHub Desktop.
CC=g++
LDLIBS=-lm
CFLAGS= -Wextra -g -Wall -Wvla -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: README Makefile Point.h Point.cpp PointSet.h PointSet.cpp ConvexHull.cpp PointSetBinaryOperations.cpp
tar $(TARFLAGS) ex1.tar README Makefile Point.h Point.cpp PointSet.h PointSet.cpp ConvexHull.cpp PointSetBinaryOperations.cpp
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
$(CC) $(cflags) 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 *.a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment