/build/build.rules.mk

http://github.com/hbons/SparkleShare · Makefile · 77 lines · 52 code · 17 blank · 8 comment · 1 complexity · f9a29c5ef4587f144f03a477f0ae25f9 MD5 · raw file

  1. UNIQUE_FILTER_PIPE = tr [:space:] \\n | sort | uniq
  2. BUILD_DATA_DIR = $(top_builddir)/bin/share/$(PACKAGE)
  3. # Since all other attempts failed, we currently go this way:
  4. # This code adds the file specified in ASSEMBLY_INFO_SOURCE to SOURCES_BUILD.
  5. ASSEMBLY_INFO_SOURCE_REAL = \
  6. $(addprefix $(srcdir)/, $(ASSEMBLY_INFO_SOURCE))
  7. SOURCES_BUILD = $(addprefix $(srcdir)/, $(SOURCES))
  8. SOURCES_BUILD += $(ASSEMBLY_INFO_SOURCE_REAL)
  9. RESOURCES_EXPANDED = $(addprefix $(srcdir)/, $(RESOURCES))
  10. RESOURCES_BUILD = $(foreach resource, $(RESOURCES_EXPANDED), \
  11. -resource:$(resource),$(notdir $(resource)))
  12. ASSEMBLY_EXTENSION = $(strip $(patsubst library, dll, $(TARGET)))
  13. ASSEMBLY_FILE = $(top_builddir)/bin/$(ASSEMBLY).$(ASSEMBLY_EXTENSION)
  14. INSTALL_DIR_RESOLVED = $(firstword $(subst , $(DEFAULT_INSTALL_DIR), $(INSTALL_DIR)))
  15. if ENABLE_TESTS
  16. LINK = " $(NUNIT_LIBS)"
  17. ENABLE_TESTS_FLAG = "-define:ENABLE_TESTS"
  18. endif
  19. FILTERED_LINK = $(shell echo "$(LINK)" | $(UNIQUE_FILTER_PIPE))
  20. DEP_LINK = $(shell echo "$(LINK)" | $(UNIQUE_FILTER_PIPE) | sed s,-r:,,g | grep '$(top_builddir)/bin/')
  21. OUTPUT_FILES = \
  22. $(ASSEMBLY_FILE) \
  23. $(ASSEMBLY_FILE).mdb
  24. moduledir = $(INSTALL_DIR_RESOLVED)
  25. module_SCRIPTS = $(OUTPUT_FILES)
  26. all: $(ASSEMBLY_FILE)
  27. run:
  28. @pushd $(top_builddir); \
  29. make run; \
  30. popd;
  31. # uncommented for now.
  32. # tests are currently excuted from Makefile in $(top_builddir)
  33. #test:
  34. # @pushd $(top_builddir)/tests; \
  35. # make $(ASSEMBLY); \
  36. # popd;
  37. build-debug:
  38. @echo $(DEP_LINK)
  39. $(ASSEMBLY_FILE).mdb: $(ASSEMBLY_FILE)
  40. $(ASSEMBLY_FILE): $(SOURCES_BUILD) $(RESOURCES_EXPANDED) $(DEP_LINK)
  41. @mkdir -p $(top_builddir)/bin
  42. $(MCS) \
  43. $(GMCS_FLAGS) \
  44. $(ASSEMBLY_BUILD_FLAGS) \
  45. -codepage:utf8 \
  46. -nowarn:0278 -nowarn:0078 $$warn \
  47. -define:HAVE_GTK_2_10 -define:NET_2_0 \
  48. -debug -target:$(TARGET) -out:$@ \
  49. $(BUILD_DEFINES) $(ENABLE_TESTS_FLAG) $(ENABLE_ATK_FLAG) \
  50. $(FILTERED_LINK) $(RESOURCES_BUILD) $(SOURCES_BUILD)
  51. @if [ -e $(srcdir)/$(notdir $@.config) ]; then \
  52. cp $(srcdir)/$(notdir $@.config) $(top_builddir)/bin; \
  53. fi;
  54. @if [ ! -z "$(EXTRA_BUNDLE)" ]; then \
  55. cp $(EXTRA_BUNDLE) $(top_builddir)/bin; \
  56. fi;
  57. EXTRA_DIST = $(SOURCES_BUILD) $(RESOURCES_EXPANDED)
  58. CLEANFILES = $(OUTPUT_FILES) $(ASSEMBLY_FILE).config
  59. DISTCLEANFILES = *.pidb
  60. MAINTAINERCLEANFILES = Makefile.in