From 7e3df70df6e2733f2a5391e979d148e5d8818154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Tue, 6 Feb 2018 19:09:02 +0100 Subject: [PATCH] Fix compilation process --- .gitignore | 1 + Makefile | 9 +++++---- common_structures.hpp | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 5206ef6..6769bd9 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ *.out *.app +*.bin diff --git a/Makefile b/Makefile index 6869ad7..51ce6f3 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ CXX=g++ CXXFLAGS=-Wall -Wextra -O2 -std=c++14 -CXXLIBS= +CXXLIBS=-lGL -lGLU -lglut # In `TARGET`, list the names of the `main_[stuff].cpp` you'd like to compile # into a `[stuff].bin`. @@ -8,11 +8,12 @@ TARGETS=glut OBJS=Implicit.o \ Mesh.o \ - util/ObjParser.o + util/ObjParser.o \ + render/GlutRender.o all: $(TARGETS:=.bin) -%.bin: main_%.cpp $(OBJS) +%.bin: main_%.o $(OBJS) $(CXX) $(CXXFLAGS) $(CXXLIBS) $(OBJS) $< -o $@ %.o: %.cpp @@ -23,4 +24,4 @@ all: $(TARGETS:=.bin) .PHONY: clean clean: - rm -rf $(OBJS) + rm -rf $(OBJS) $(TARGETS:=.bin) diff --git a/common_structures.hpp b/common_structures.hpp index fd6d841..8c88a13 100644 --- a/common_structures.hpp +++ b/common_structures.hpp @@ -13,7 +13,7 @@ struct Point { double x, y, z; double operator[](unsigned i) const { - assert(0 <= i && i < 3); + assert(i < 3); switch(i) { case 0: return x; case 1: return y;