summaryrefslogtreecommitdiffstats
path: root/GNUmakefile
blob: 8cb5d3e486ccc5ca6d1c42933f4621036f48640c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#
# Copyright 2008-2023 the Pacemaker project contributors
#
# The version control history for this file may have further details.
#
# This source code is licensed under the GNU General Public License version 2
# or later (GPLv2+) WITHOUT ANY WARRANTY.
#

default: build
.PHONY: default

-include Makefile

# The main purpose of this GNUmakefile is that its targets can be invoked
# without having to call autogen.sh and configure first. That means automake
# variables may or may not be defined. Here, we use the current working
# directory if a relevant variable hasn't been defined.
abs_srcdir	?= $(shell pwd)

GLIB_CFLAGS	?= $(pkg-config --cflags glib-2.0)

PACKAGE		?= pacemaker

.PHONY: init
init:
	test -e configure && test -e libltdl || ./autogen.sh
	test -e Makefile || ./configure

.PHONY: build
build: init
	$(MAKE) $(AM_MAKEFLAGS) core

## RPM-related targets (deprecated; use targets in rpm subdirectory instead)

# Pass option depending on whether automake has been run or not
USE_FILE = $(shell test -e rpm/Makefile || echo "-f Makefile.am")

.PHONY: $(PACKAGE).spec chroot dirty export mock rc release rpm rpmlint srpm
$(PACKAGE).spec chroot dirty export mock rc release rpm rpmlint srpm:
	$(MAKE) $(AM_MAKEFLAGS) -C rpm $(USE_FILE) "$@"

.PHONY: mock-% rpm-% spec-% srpm-%
mock-% rpm-% spec-% srpm-%:
	$(MAKE) $(AM_MAKEFLAGS) -C rpm $(USE_FILE) "$@"

## Development-related targets
## (deprecated; use targets in devel subdirectory instead)

COVLEVEL        	?= low
COVERAGE_TARGETS	= coverage coverage-cts coverage-clean
COVERITY_TARGETS	= coverity coverity-analyze coverity-clean coverity-corp

.PHONY: clang $(COVERAGE_TARGETS) $(COVERITY_TARGETS) cppcheck indent
clang $(COVERAGE_TARGETS) $(COVERITY_TARGETS) cppcheck indent:
	@echo 'Deprecated: Use "make -C devel $@" instead'
	$(MAKE) $(AM_MAKEFLAGS)				\
		CLANG_checkers=$(CLANG_checkers)	\
		COVLEVEL=$(COVLEVEL)			\
		CPPCHECK_ARGS=$(CPPCHECK_ARGS)		\
		-C devel "$@"