mpri-graphics-project/Makefile
Théophile Bastian 52ca47cde6 Marching: add test implicit surface and main
The test surface is the sphere TestImplicitSphere
2018-02-11 20:23:21 +01:00

37 lines
738 B
Makefile

CXX=g++
CXXFLAGS=-Wall -Wextra -O2 -std=c++14
CXXLIBS=-lGL -lGLU -lglut
# In `TARGET`, list the names of the `main_[stuff].cpp` you'd like to compile
# into a `[stuff].bin`.
TARGETS=glut
OBJS=Implicit.o \
common_structures.o \
Mesh.o \
util/ObjParser.o \
MarchingCubes.o \
_gen/marching_cubes_data.o \
tests/TestImplicitSphere.o \
render/GlutRender.o
all: $(TARGETS:=.bin)
%.bin: main_%.o $(OBJS)
$(CXX) $(CXXFLAGS) $(CXXLIBS) $(OBJS) $< -o $@
_gen/marching_cubes_data.cpp: tools/gen_marching_cubes_conf.py _gen
python3 $< > $@
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
_gen:
mkdir -p _gen
############################################################
.PHONY: clean
clean:
rm -rf $(OBJS) $(TARGETS:=.bin) _gen