Makefile 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. KERNEL_INPUT_FILES = physics time geometry initial_state source input_data
  10. QT_OUTPUT_FILES = main_window solver output_view output
  11. QT_OUTPUT_MOC_FILES = main_window solver output
  12. MATH_OUTPUT_FILES = algo
  13. KERNEL_OUTPUT_FILES = physics time geometry initial_state source input_data solution solver piccard horizontal_problem overland all_vertical_richards richards_evolutive_time richards
  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. KERNEL_INPUT_OBJS = $(addprefix obj/kernel/,$(addsuffix .o,$(KERNEL_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. KERNEL_OUTPUT_OBJS = $(addprefix obj/kernel/,$(addsuffix .o,$(KERNEL_OUTPUT_FILES)))
  22. MATH_SOLVER_OBJS = $(addprefix obj/math/,$(addsuffix .o,$(MATH_OUTPUT_FILES)))
  23. KERNEL_SOLVER_OBJS = $(addprefix obj/kernel/,$(addsuffix .o,$(KERNEL_OUTPUT_FILES)))
  24. EXE_INPUT = RichardsFastSlowInput
  25. EXE_OUTPUT = RichardsFastSlowOutput
  26. EXE_SOLVER = RichardsFastSlowSolver
  27. all: $(EXE_OUTPUT)
  28. input: $(EXE_INPUT)
  29. output: $(EXE_OUTPUT)
  30. solver: $(EXE_SOLVER)
  31. $(EXE_INPUT) : src/main_input.cpp $(KERNEL_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/debug.cpp $(KERNEL_OUTPUT_OBJS) $(MATH_OUTPUT_OBJS) $(QT_OUTPUT_MOCS) $(QT_OUTPUT_OBJS)
  34. $(GPP) $(FLAGS) $(QT_FLAGS) $^ $(QT_LIB) -o $@
  35. $(EXE_SOLVER) : src/main_solver.cpp $(KERNEL_SOLVER_OBJS) $(MATH_SOLVER_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) -r $(EXE) $(EXE_OUTPUT) moc/input/*.cpp moc/output/*.cpp moc/*.cpp obj/*.o obj/kernel/*.o obj/math/*.o obj/qt/input/*.o obj/qt/output/*.o obj/qt/*.o src/*~ src/qt/*~ src/math/*~ doc/*