Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. QT_FLAGS =-fPIC `pkg-config --cflags --libs Qt5OpenGL`
  2. QT_LIB =`pkg-config --libs Qt5OpenGL` -lGL -lGLU
  3. QT_MOC = moc
  4. GPP = g++
  5. FLAGS = -g -O3 -Isrc -Wfatal-errors
  6. QT_INPUT_FILES = main_window data input physics time geometry initial_state view tank pump pump_tab cloud clouds_tab
  7. QT_INPUT_MOC_FILES = main_window physics input view geometry initial_state tank pump_tab pump cloud clouds_tab
  8. MATH_INPUT_FILES = poly3 algo spline
  9. SRC_INPUT_FILES = physics time geometry initial_state source input_data
  10. QT_OUTPUT_FILES = main_window kernel output_view output
  11. QT_OUTPUT_MOC_FILES = main_window kernel output
  12. MATH_OUTPUT_FILES = algo
  13. SRC_OUTPUT_FILES = physics time geometry initial_state source input_data solution kernel
  14. QT_INPUT_OBJS = $(addprefix obj/qt/input/,$(addsuffix .o,$(QT_INPUT_FILES)))
  15. QT_INPUT_MOCS = $(addprefix moc/input/,$(addsuffix .cpp,$(QT_INPUT_MOC_FILES)))
  16. MATH_INPUT_OBJS = $(addprefix obj/math/,$(addsuffix .o,$(MATH_INPUT_FILES)))
  17. SRC_INPUT_OBJS = $(addprefix obj/,$(addsuffix .o,$(SRC_INPUT_FILES)))
  18. QT_OUTPUT_OBJS = $(addprefix obj/qt/output/,$(addsuffix .o,$(QT_OUTPUT_FILES)))
  19. QT_OUTPUT_MOCS = $(addprefix moc/output/,$(addsuffix .cpp,$(QT_OUTPUT_MOC_FILES)))
  20. MATH_OUTPUT_OBJS = $(addprefix obj/math/,$(addsuffix .o,$(MATH_OUTPUT_FILES)))
  21. SRC_OUTPUT_OBJS = $(addprefix obj/,$(addsuffix .o,$(SRC_OUTPUT_FILES)))
  22. MATH_KERNEL_OBJS = $(addprefix obj/math/,$(addsuffix .o,$(MATH_OUTPUT_FILES)))
  23. SRC_KERNEL_OBJS = $(addprefix obj/,$(addsuffix .o,$(SRC_OUTPUT_FILES)))
  24. EXE_INPUT = RichardsFastSlowInput
  25. EXE_OUTPUT = RichardsFastSlowOutput
  26. EXE_KERNEL = RichardsFastSlowKernel
  27. all: $(EXE_OUTPUT)
  28. input: $(EXE_INPUT)
  29. output: $(EXE_OUTPUT)
  30. kernel: $(EXE_KERNEL)
  31. $(EXE_INPUT) : src/main_input.cpp $(SRC_INPUT_OBJS) $(MATH_INPUT_OBJS) $(QT_INPUT_MOCS) $(QT_INPUT_OBJS)
  32. $(GPP) $(FLAGS) $(QT_FLAGS) $^ $(QT_LIB) -o $@
  33. $(EXE_OUTPUT) : src/main_output.cpp $(SRC_OUTPUT_OBJS) $(MATH_OUTPUT_OBJS) $(QT_OUTPUT_MOCS) $(QT_OUTPUT_OBJS)
  34. $(GPP) $(FLAGS) $(QT_FLAGS) $^ $(QT_LIB) -o $@
  35. $(EXE_KERNEL) : src/main_kernel.cpp $(SRC_KERNEL_OBJS) $(MATH_KERNEL_OBJS)
  36. $(GPP) $(FLAGS) $^ -o $@
  37. obj/qt/%.o : src/qt/%.cpp src/qt/%.hpp
  38. $(GPP) $(FLAGS) $(QT_FLAGS) -c $< -o $@
  39. obj/math/%.o : src/math/%.cpp src/math/%.hpp
  40. $(GPP) $(FLAGS) -c $< -o $@
  41. obj/%.o : src/%.cpp src/%.hpp
  42. $(GPP) $(FLAGS) -c $< -o $@
  43. moc/%.cpp : src/qt/%.hpp
  44. $(QT_MOC) $< -o $@
  45. clean:
  46. -$(RM) $(EXE) moc/input/*.cpp moc/output/*.cpp moc/*.cpp obj/*.o obj/math/*.o obj/qt/input/*.o obj/qt/output/*.o obj/qt/*.o src/*~ src/qt/*~ src/math/*~