Fix compilation process
This commit is contained in:
parent
804031dc81
commit
7e3df70df6
3 changed files with 7 additions and 5 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -27,3 +27,4 @@
|
|||
*.out
|
||||
*.app
|
||||
|
||||
*.bin
|
||||
|
|
9
Makefile
9
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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue