Makefile
author Damiano Boppart <damiano.boppart@pep.security>
Tue, 14 May 2019 18:40:26 +0200
branchENGINE-544
changeset 3677 51c4944d6257
parent 3651 f22ed667bb0d
permissions -rw-r--r--
Make semantics of Makefile targets match GNU Build System semantics
damiano@1960
     1
# Copyright 2017, pEp Foundation
damiano@1958
     2
# This file is part of pEpEngine
damiano@1958
     3
# This file may be used under the terms of the GNU General Public License version 3
vb@1517
     4
# see LICENSE.txt
vb@1517
     5
damiano@1963
     6
HERE_REL := $(notdir $(CURDIR))
damiano@1963
     7
damiano@3201
     8
include Makefile.conf
vb@1
     9
damiano@2213
    10
ifneq ($(wildcard local.conf),)
damiano@2213
    11
    $(info ================================================)
vb@3452
    12
    $(info Overrides in `local.conf` are used.)
damiano@2213
    13
    $(info ================================================)
damiano@2213
    14
endif
damiano@2213
    15
damiano@2213
    16
ifdef BUILD_CONFIG
damiano@2213
    17
    $(info ================================================)
vb@3452
    18
    $(info Overrides in `$(BUILD_CONFIG)` are used.)
damiano@2213
    19
    $(info ================================================)
damiano@2213
    20
endif
damiano@2213
    21
vb@3452
    22
damiano@3677
    23
# Build programs, libraries, documentation, etc..
damiano@3677
    24
.PHONY: all
damiano@3677
    25
all: allnodb db
vb@3452
    26
damiano@3677
    27
# Like `all`, but without building the db
damiano@3677
    28
.PHONY: allnodb
damiano@3677
    29
allnodb: asn1 src sync
vb@3452
    30
damiano@3677
    31
# Install what needs to be installed, copying the files from the package’s tree to system-wide directories.
damiano@3677
    32
.PHONY: install
damiano@3677
    33
install: all installnodb
damiano@3207
    34
	$(MAKE) -C db install
damiano@3207
    35
damiano@3677
    36
# Like `install`, but does install the db
damiano@3677
    37
.PHONY: installnodb
damiano@3677
    38
installnodb: allnodb
damiano@3677
    39
	$(MAKE) -C asn.1 install
damiano@3677
    40
	$(MAKE) -C src install
damiano@3677
    41
damiano@3677
    42
# The opposite of make install: erase the installed files. (This needs to be run from the same build tree that was installed.)
damiano@3677
    43
.PHONY: uninstall
damiano@2213
    44
uninstall:
damiano@1950
    45
	$(MAKE) -C asn.1 uninstall
damiano@3677
    46
	$(MAKE) -C db uninstall
damiano@3677
    47
	$(MAKE) -C src uninstall
vb@1
    48
damiano@3677
    49
# Erase from the build tree the files built by make all.
damiano@3677
    50
.PHONY: clean
damiano@2213
    51
clean:
damiano@3677
    52
	$(MAKE) -C asn.1 clean
damiano@3677
    53
	$(MAKE) -C db clean
vb@1
    54
	$(MAKE) -C src clean
damiano@3677
    55
	$(MAKE) -C sync clean
vb@1
    56
	$(MAKE) -C test clean
damiano@3677
    57
damiano@3677
    58
# Run the test suite.
damiano@3677
    59
.PHONY: check test
damiano@3677
    60
check test: all
damiano@3677
    61
	$(MAKE) -C test test
vb@1
    62
damiano@3677
    63
.PHONY: package
damiano@3677
    64
package: clean
damiano@3677
    65
	cd .. ; COPYFILE_DISABLE=true tar cjf pEpEngine.tar.bz2 "$(HERE_REL)"
damiano@3677
    66
damiano@3677
    67
.PHONY: tags
vb@2872
    68
tags:
vb@2872
    69
	$(MAKE) -C asn.1 tags
vb@2872
    70
	$(MAKE) -C src tags
vb@2872
    71
damiano@3677
    72
# You probably don't want to call any of the the targets below directly
damiano@3677
    73
damiano@3677
    74
.PHONY: asn1
damiano@3677
    75
asn1: sync
damiano@3677
    76
	$(MAKE) -C asn.1
vb@1
    77
damiano@3677
    78
.PHONY: db
damiano@3677
    79
db:
damiano@3677
    80
	$(MAKE) -C db
vb@1
    81
damiano@3677
    82
.PHONY: src
damiano@3677
    83
src: asn1 sync
damiano@3677
    84
	$(MAKE) -C src
damiano@3677
    85
damiano@3677
    86
.PHONY: sync
damiano@3677
    87
sync:
damiano@3677
    88
	$(MAKE) -C sync
damiano@3677
    89