-
Notifications
You must be signed in to change notification settings - Fork 8
/
makefile
84 lines (65 loc) · 3.39 KB
/
makefile
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
###############################################################################
# #
# Call-Flow-Control #
# #
# Make File #
# #
# Copyright (C) 2012-, AdaHeads K/S #
# #
# This is free software; you can redistribute it and/or modify it #
# under terms of the GNU General Public License as published by the #
# Free Software Foundation; either version 3, or (at your option) any #
# later version. This software is distributed in the hope that it will #
# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty #
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
# General Public License for more details. #
# You should have received a copy of the GNU General Public License #
# distributed with this software; see file COPYING3. If not, go #
# to http://www.gnu.org/licenses for a complete copy of the license. #
# #
###############################################################################
PROJECT=call_flow_control
GENERATED_EXECUTABLES=exe/$(PROJECT)
GENERATED_SOURCES=ada_2012_extensions \
black \
gnat-sockets-extras
PREFIX?=/usr/local/call-flow
RELEASE=`git tag | tail -n1`
GIT_REV=`git rev-parse --short HEAD`
ifeq ($(PROCESSORS),)
PROCESSORS=`(test -f /proc/cpuinfo && grep -c ^processor /proc/cpuinfo) || echo 1`
endif
all: build
build: fix-whitespace $(GENERATED_SOURCES)
gnatmake -j$(PROCESSORS) -p -P $(PROJECT)
install:
@install --directory $(PREFIX)/bin
@install --target-directory=$(PREFIX)/bin $(GENERATED_EXECUTABLES)
install-default-config:
@install --directory $(PREFIX)/conf
@install --directory $(PREFIX)/session
@install exe/configuration/main.conf.dist $(PREFIX)/conf/main.conf
@install exe/configuration/config.ini.dist $(PREFIX)/conf/config.ini
@install exe/configuration/mime.types $(PREFIX)/conf/mime.types
@echo Default config deployed at $(PREFIX)/conf - go there and finish the config.
git-head: all
for exe in $(GENERATED_EXECUTABLES); do cp -p $${exe} $${exe}-$(RELEASE)-$(GIT_REV); done
echo $(PROJECT)-$(RELEASE)-$(GIT_REV) > release.latest
test: build
@./tests/build
@./tests/run
clean:
gnatclean -P $(PROJECT) || true
find . -type f \( -name "*~" -o -name "*.o" -o -name "*.ali" \) -print0 | xargs -0 -r /bin/rm
# if [ ! -z "$(GENERATED_SOURCES)" ]; then rm -rf $(GENERATED_SOURCES); fi
distclean: clean
rm -f $(GENERATED_EXECUTABLES)
rm -f obj/*.ad[sb].metrix
rmdir bin || true
rmdir obj || true
fix-whitespace:
@find . -name '*.ad?' | xargs --no-run-if-empty egrep -l ' | $$' | grep -v '^b[~]' | xargs --no-run-if-empty perl -i -lpe 's| | |g; s| +$$||g'
metrics:
@gnat metric -P $(PROJECT)
-include Makefile.project_rules
.PHONY: all build test install clean distclean fix-whitespace metrics