PageRenderTime 21ms CodeModel.GetById 10ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/build/build.rules.mk

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