CPP=g++ BUILD=obj TARGA=Targa GLUI=dependencies/glui GLI=dependencies/gli CPPFLAGS=-g -Wall -O3 -fopenmp -I$(TARGA) -I$(GLUI)/include -I$(GLI) -I../src/texture_tile_blend -DENABLE_JPEG -DENABLE_PNG -DENABLE_TIFF -DENABLE_DDS TARGET=$(BUILD)/3dworld OBJS=$(shell cat obj_list) TARGET2= OBJS2= VPATH=$(BUILD):src LIB_TARGET= LIB_OBJS= #LINK=g++ $(CPPFLAGS) -lz -lpng -lpthread -L/usr/X11R6/lib64 -lglut -lGL -lGLU LINK=g++ $(CPPFLAGS) -L$(GLUI)/lib LFLAGS=-lz -lpng -ljpeg -ltiff -lpthread $(shell pkg-config --libs xrender) -lglui -lglut -lGLEW -lGLU -lGL -lopenal -lalut $(LIB_TARGET) # In most cases, you should not change anything below this line. all : $(TARGET) # disable old-style .SUFFIXES rules. this may not be needed? .SUFFIXES: %.o : %.C $(BUILD)/%.d $(CPP) $(CPPFLAGS) -MMD -c $< -o $(abspath $(BUILD)/$@) %.o : %.cc $(BUILD)/%.d $(CPP) $(CPPFLAGS) -MMD -c $< -o $(abspath $(BUILD)/$@) %.o : %.cpp $(BUILD)/%.d $(CPP) $(CPPFLAGS) -MMD -c $< -o $(abspath $(BUILD)/$@) # DEPENDENCIES = $(OBJS2:.o=.d) $(OBJS:.o=.d) $(LIB_OBJS:.o=.d) # # Targets: # all : $(TARGET) $(TARGET2) ifneq ($(LIB_TARGET),"") $(LIB_TARGET): $(LIB_OBJS) $(LINK) $(FLAGS) -shared -o $(LIB_TARGET) $(LIB_OBJS) endif $(TARGET): $(OBJS) $(LIB_TARGET) $(LINK) $(FLAGS) -o $(TARGET) $(OBJS) $(LFLAGS) ifneq ($(TARGET2),"") $(TARGET2): $(OBJS2) $(LIB_TARGET) $(LINK) $(FLAGS) -o $(TARGET2) $(OBJS2) $(LFLAGS) endif .PHONY : clean clean: -rm -fr $(BUILD) $(OBJS): | $(BUILD) $(BUILD): @mkdir -p $(BUILD) $(BUILD)/%.d: ; .PRECIOUS: $(BUILD)/%.d -include $(patsubst %,$(BUILD)/%.d,$(basename $(OBJS)))