fork download
  1. # The target
  2. TARGET = casa-1.1b
  3.  
  4. # The compiler options
  5. CC = g++
  6. CFLAGS = \
  7. -Wredundant-decls -Wall -Werror -g \
  8. -Icasa -Icommon -Icommon/utility -Iminisat/solver -Iminisat/include \
  9. -DSEARCH_PROGRESS
  10. LFLAGS =
  11. DFLAGS = -MM
  12.  
  13. #the .C files, without their extensions
  14. COMBINATORICS_SOURCES = PascalTriangle Combinadic CombinadicIterator
  15. MINISAT_SOURCES = Solver
  16. SAT_SOURCES = SAT
  17. IO_SOURCES = Usage SpecificationFile ConstraintFile OutputFile
  18. STATE_SOURCES = CoveringArray CoveringArrayEntry CoveringArrayRow CoveringArraySubRow
  19. SPACE_SOURCES = CoveringArraySpace SingleChangeSpace GraftSpace
  20. BOOKKEEPING_SOURCES = Options
  21. ANNEALING_SOURCES = Anneal AnnealingSuccess Bounds AnnealingPartitioner
  22. ALGORITHM_SOURCES = BinarySearch
  23. MAIN_SOURCES = Main
  24. SOURCES = \
  25. $(COMBINATORICS_SOURCES:%=common/utility/%) \
  26. $(MINISAT_SOURCES:%=minisat/solver/%) \
  27. $(SAT_SOURCES:%=casa/sat/%) \
  28. $(IO_SOURCES:%=casa/io/%) \
  29. $(STATE_SOURCES:%=casa/covering/state/%) \
  30. $(SPACE_SOURCES:%=casa/covering/space/%) \
  31. $(BOOKKEEPING_SOURCES:%=casa/covering/bookkeeping/%) \
  32. $(ANNEALING_SOURCES:%=casa/annealing/%) \
  33. $(ALGORITHM_SOURCES:%=casa/algorithms/%) \
  34. $(MAIN_SOURCES:%=casa/%)
  35.  
  36. # The rules
  37. all: $(TARGET) TAGS
  38.  
  39. $(TARGET): $(SOURCES:%=%.o)
  40. $(CC) -o $@ $(filter %.o,$^) $(LFLAGS)
  41.  
  42. $(SOURCES:%=%.o): Makefile
  43. $(CC) -c -o $@ $(@:%.o=%.C) $(CFLAGS)
  44.  
  45. $(SOURCES:%=%.d): %.d:%.C Makefile
  46. $(CC) $(DFLAGS) $(@:%.d=%.C) $(CFLAGS) | sed 's,.*\.o:,$(@:%.d=%.o) $@: ,g' > $@
  47. ifneq ($(MAKECMDGOALS),clean)
  48. ifneq ($(MAKECMDGOALS),distclean)
  49. -include $(SOURCES:%=%.d)
  50. endif
  51. endif
  52.  
  53. Dependencies: $(SOURCES:%=%.d)
  54. sed -e 's/://g' -e 's/[^ ][^ ]*\.d//g' -e 's/[^ ][^ ]*\.o//g' -e 's/[ \\][ \\]*/ /g' $(SOURCES:%=%.d) | tr ' ' "\n" | sort | uniq | tr "\n" ' ' | sed 's/^/ALL_INPUTS =/' > $@
  55. ifneq ($(MAKECMDGOALS),clean)
  56. ifneq ($(MAKECMDGOALS),distclean)
  57. -include Dependencies
  58. endif
  59. endif
  60.  
  61. TAGS: $(ALL_INPUTS)
  62. etags $^
  63.  
  64. clean:
  65. -$(RM) $(TARGET) $(SOURCES:%=%.o)
  66.  
  67. distclean: clean
  68. -$(RM) $(SOURCES:%=%.d) Dependencies TAGS
  69.  
  70. .PHONY: all clean distclean
  71.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty