2018-01-28 23:03:11 +01:00
|
|
|
CXX=g++
|
|
|
|
CXXFLAGS=-Wall -Wextra -O2 -std=c++14
|
2018-02-06 19:09:02 +01:00
|
|
|
CXXLIBS=-lGL -lGLU -lglut
|
2018-01-28 23:03:11 +01:00
|
|
|
|
|
|
|
# In `TARGET`, list the names of the `main_[stuff].cpp` you'd like to compile
|
|
|
|
# into a `[stuff].bin`.
|
2018-01-28 23:05:02 +01:00
|
|
|
TARGETS=glut
|
2018-01-28 23:03:11 +01:00
|
|
|
|
|
|
|
OBJS=Implicit.o \
|
2018-02-07 18:00:01 +01:00
|
|
|
common_structures.o \
|
2018-01-28 23:03:57 +01:00
|
|
|
Mesh.o \
|
2018-02-06 19:09:02 +01:00
|
|
|
util/ObjParser.o \
|
2018-02-07 18:00:01 +01:00
|
|
|
MarchingCubes.o \
|
2018-02-11 18:34:00 +01:00
|
|
|
_gen/marching_cubes_data.o \
|
2018-02-06 19:09:02 +01:00
|
|
|
render/GlutRender.o
|
2018-01-28 23:03:11 +01:00
|
|
|
|
|
|
|
all: $(TARGETS:=.bin)
|
|
|
|
|
2018-02-06 19:09:02 +01:00
|
|
|
%.bin: main_%.o $(OBJS)
|
2018-01-28 23:03:11 +01:00
|
|
|
$(CXX) $(CXXFLAGS) $(CXXLIBS) $(OBJS) $< -o $@
|
|
|
|
|
2018-02-11 18:34:00 +01:00
|
|
|
_gen/marching_cubes_data.cpp: tools/gen_marching_cubes_conf.py _gen
|
|
|
|
python3 $< > $@
|
|
|
|
|
2018-01-28 23:03:11 +01:00
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) -c $< -o $@
|
|
|
|
|
2018-02-11 18:34:00 +01:00
|
|
|
_gen:
|
|
|
|
mkdir -p _gen
|
|
|
|
|
2018-01-28 23:03:11 +01:00
|
|
|
############################################################
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
clean:
|
2018-02-11 18:34:00 +01:00
|
|
|
rm -rf $(OBJS) $(TARGETS:=.bin) _gen
|