Makefile 1.9 KB
Newer Older
1 2 3 4 5 6
#
# Copyright 2016 Software Freedom Conservancy Inc.
#

# This Makefile is for developer convenience, and is optimised for
# development work, not production. Packagers should invoke meson and
7
# ninja directly. See INSTALL for further information.
8 9 10

CONFIGURE := meson \
	--buildtype debug \
11 12 13
	--warnlevel 3 \
	-Dvaladoc=true \
	-Dref_tracking=true
14 15 16 17 18
MAKE := ninja

BUILD_DIR := build
BINARIES := geary geary-console geary-mailer

19
BUILD_ARTIFACTS := \
20 21
	$(BUILD_DIR)/src/geary \
	$(BUILD_DIR)/src/console/geary-console \
22 23
	$(BUILD_DIR)/src/mailer/geary-mailer \
	$(BUILD_DIR)/src/valadoc
24 25 26 27

.DEFAULT: all

.PHONY: all
28 29 30 31 32 33 34
all: compile $(BINARIES)

.PHONY: verbose
verbose: compile-verbose $(BINARIES)

.PHONY: compile
compile: $(BUILD_DIR)
35 36
	@$(MAKE) -C $(BUILD_DIR)

37 38 39
.PHONY: compile-verbose
compile-verbose: $(BUILD_DIR)
	@$(MAKE) -C $(BUILD_DIR) -v
40 41

.PHONY: install
42
install: compile
43 44 45
	@$(MAKE) -C $(BUILD_DIR) $@

.PHONY: uninstall
46
uninstall: compile
47 48 49
	@$(MAKE) -C $(BUILD_DIR) $@

.PHONY: geary-pot
50
geary-pot: compile
51 52 53 54 55 56 57 58 59 60 61 62 63
	@$(MAKE) -C $(BUILD_DIR) $@

# Keep the olde rule For compatibility
.PHONY: pot_file
pot_file: geary-pot

.PHONY: clean
clean: $(BUILD_DIR)
	@-$(MAKE) -C $(BUILD_DIR) $@

.PHONY: distclean
distclean:
	@-rm -rf $(BUILD_DIR)
64
	@-rm -rf $(BINARIES)
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
	@-rm -rf valadoc
	@-rm -f po/geary.pot

.PHONY: test
test: $(BUILD_DIR)
	@$(MAKE) -C $(BUILD_DIR) $@

.PHONY: test-engine
test-engine: $(BUILD_DIR)
	cd $(BUILD_DIR) && meson test engine-tests

.PHONY: test-client
test-client: $(BUILD_DIR)
	cd $(BUILD_DIR) && meson test client-tests

.PHONY: dist
81
dist: test
82 83 84
	@$(MAKE) -C $(BUILD_DIR) $@
	@cp -v $(BUILD_DIR)/meson-dist/*.xz* ..

85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
# The rest of these are actual files

$(BUILD_DIR):
	@$(CONFIGURE) $@

valadoc: $(BUILD_DIR)/src/valadoc
	cp -r $< .

geary: $(BUILD_DIR)/src/geary
	cp $< .

geary-console: $(BUILD_DIR)/src/console/geary-console
	cp $< .

geary-mailer: $(BUILD_DIR)/src/mailer/geary-mailer
	cp $< .

$(BUILD_ARTIFACTS): compile