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 \ Mesh.o \ util/ObjParser.o \ render/GlutRender.o all: $(TARGETS:=.bin) %.bin: main_%.o $(OBJS) $(CXX) $(CXXFLAGS) $(CXXLIBS) $(OBJS) $< -o $@ %.o: %.cpp $(CXX) $(CXXFLAGS) -c $< -o $@ ############################################################ .PHONY: clean clean: rm -rf $(OBJS) $(TARGETS:=.bin)