2018-01-28 23:03:11 +01:00
|
|
|
CXX=g++
|
2018-02-13 14:47:34 +01:00
|
|
|
CXXFLAGS=$(ADD_FLAGS) -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-02-13 16:41:10 +01:00
|
|
|
TARGETS=glut ball bounce
|
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-12 01:27:16 +01:00
|
|
|
spheroid.o \
|
|
|
|
Ball.o \
|
2018-02-12 17:40:21 +01:00
|
|
|
PerlinNoise.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-12 18:40:05 +01:00
|
|
|
periodic_updates.o \
|
2018-02-11 20:23:07 +01:00
|
|
|
tests/TestImplicitSphere.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-13 15:08:04 +01:00
|
|
|
_gen/marching_cubes_data.cpp: tools/gen_marching_cubes_conf.py
|
|
|
|
mkdir -p _gen
|
2018-02-11 18:34:00 +01:00
|
|
|
python3 $< > $@
|
|
|
|
|
2018-01-28 23:03:11 +01:00
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
############################################################
|
|
|
|
|
2018-02-13 15:08:04 +01:00
|
|
|
.PRECIOUS: %.o
|
|
|
|
|
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
|
2018-02-13 16:41:10 +01:00
|
|
|
|
|
|
|
clean_render:
|
|
|
|
rm -rf render/*.o $(TARGETS:=.bin)
|