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