Fix compilation process

This commit is contained in:
Théophile Bastian 2018-02-06 19:09:02 +01:00
parent 804031dc81
commit 7e3df70df6
3 changed files with 7 additions and 5 deletions

1
.gitignore vendored
View file

@ -27,3 +27,4 @@
*.out *.out
*.app *.app
*.bin

View file

@ -1,6 +1,6 @@
CXX=g++ CXX=g++
CXXFLAGS=-Wall -Wextra -O2 -std=c++14 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 # In `TARGET`, list the names of the `main_[stuff].cpp` you'd like to compile
# into a `[stuff].bin`. # into a `[stuff].bin`.
@ -8,11 +8,12 @@ TARGETS=glut
OBJS=Implicit.o \ OBJS=Implicit.o \
Mesh.o \ Mesh.o \
util/ObjParser.o util/ObjParser.o \
render/GlutRender.o
all: $(TARGETS:=.bin) all: $(TARGETS:=.bin)
%.bin: main_%.cpp $(OBJS) %.bin: main_%.o $(OBJS)
$(CXX) $(CXXFLAGS) $(CXXLIBS) $(OBJS) $< -o $@ $(CXX) $(CXXFLAGS) $(CXXLIBS) $(OBJS) $< -o $@
%.o: %.cpp %.o: %.cpp
@ -23,4 +24,4 @@ all: $(TARGETS:=.bin)
.PHONY: clean .PHONY: clean
clean: clean:
rm -rf $(OBJS) rm -rf $(OBJS) $(TARGETS:=.bin)

View file

@ -13,7 +13,7 @@ struct Point {
double x, y, z; double x, y, z;
double operator[](unsigned i) const { double operator[](unsigned i) const {
assert(0 <= i && i < 3); assert(i < 3);
switch(i) { switch(i) {
case 0: return x; case 0: return x;
case 1: return y; case 1: return y;