forked from fossology/fossology
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.conf
184 lines (142 loc) · 5.24 KB
/
Makefile.conf
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# FOSSology Makefile configuration
# Copyright (C) 2009-2014 Hewlett-Packard Development Company, L.P.
# Copyright (C) 2015, 2018 Siemens AG
#
# This file contains the default values for variables used in the
# Makefiles and other locations in the source tree.
# If you want different values, you can override them on
# the make command line. For example
# 'make VERSION=0.8.0.beta3 all'
# changing them here is probably a bad idea, try to use the above
#####################################################################
# Project info
#####################################################################
# the name of our project
PROJECT = fossology
# user for the project in system
PROJECTUSER = fossy
# group for the project in system
PROJECTGROUP = fossy
#####################################################################
# Install paths
#####################################################################
# pseudoroot for packaging purposes
DESTDIR =
# base of the program data tree
PREFIX = /usr/local
# executable programs that users run
BINDIR = $(PREFIX)/bin
# executable programs that sysadmins run
SBINDIR = $(PREFIX)/sbin
# config files
SYSCONFDIR = $(PREFIX)/etc/$(PROJECT)
# init script root dir
INITDIR = /etc
# object code libraries
LIBDIR = $(PREFIX)/lib
# header files
INCLUDEDIR = $(PREFIX)/include
# executables/libraries that only our project uses
LIBEXECDIR = $(PREFIX)/lib/$(PROJECT)
# non-arch-specific data
DATAROOTDIR = $(PREFIX)/share
# non-arch-dependent program data
MODDIR = $(DATAROOTDIR)/$(PROJECT)
# hardcoded repository location
REPODIR = /srv/$(PROJECT)/repository
# local state
LOCALSTATEDIR = /var/local
# project local state
PROJECTSTATEDIR = $(LOCALSTATEDIR)/lib/$(PROJECT)
# cache dir
CACHEDIR = $(LOCALSTATEDIR)/cache/$(PROJECT)
# project logdir
LOGDIR = /var/log/$(PROJECT)
# man pages
MANDIR = $(DATAROOTDIR)/man
# Man pages in *roff format, man 1
MAN1DIR = $(MANDIR)/man1
# project documentation
DOCDIR = $(DATAROOTDIR)/doc/$(PROJECT)
# webroot
WEBDIR = $(MODDIR)/www
# php root
PHPDIR = $(MODDIR)/php
#####################################################################
# Build variables
#####################################################################
SHELL = /bin/sh
INSTALL = /usr/bin/install -D
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = ${INSTALL} -m 644
MV = mv -f
ifeq ($(origin CC), default)
CC = gcc
endif
ifeq ($(origin CXX), default)
CXX = g++
endif
# these are the default cflags, recommended but not fully _required_
# if a user sets CFLAGS they get what they set it to and lose any they
# didn't include, which is the expected behavior
CFLAGS ?= -g -O2 -Wall -D_FILE_OFFSET_BITS=64
CXXFLAGS ?= $(CFLAGS)
CXXFLAGS += -std=c++0x
# agent library
# $TOP is set in each Makefile in order to make these work
FOSRCDIR = $(TOP)/src
FOLIBDIR = $(FOSRCDIR)/lib/c
FOLIBPHPDIR = $(FOSRCDIR)/lib/php
FOCLIDIR = $(FOSRCDIR)/cli
CXXFOLIBDIR = $(FOSRCDIR)/lib/cpp
FOLIB = $(FOLIBDIR)/libfossology.a
CXXFOLIB = $(CXXFOLIBDIR)/libfossologyCPP.a
GLIB_CFLAGS := $(shell pkg-config --cflags glib-2.0)
GLIB_LDFLAGS := $(shell pkg-config --libs glib-2.0)
PG_INCLUDEDIR := $(shell pg_config --includedir)
FO_CFLAGS = -I$(PG_INCLUDEDIR) $(GLIB_CFLAGS) -I$(FOLIBDIR) $(CFLAGS)
FO_LDFLAGS = -lfossology -L$(FOLIBDIR) $(GLIB_LDFLAGS) -lpq $(LDFLAGS)
FO_CXXFLAGS = -I$(CXXFOLIBDIR) $(FO_CFLAGS) $(CXXFLAGS)
FO_CXXLDFLAGS = -lfossologyCPP -L$(CXXFOLIBDIR) -lstdc++ $(FO_LDFLAGS)
# define VERSION and COMMIT_ID
VERSION=`git describe --tags > /dev/null 2>&1 && git describe --tags | head -1 || echo "unknown"`
BRANCH=`git rev-parse --abbrev-ref HEAD > /dev/null 2>&1 && git rev-parse --abbrev-ref HEAD | head -1 || echo "unknown"`
COMMIT_HASH=`git show > /dev/null 2>&1 && git show | head -1 | awk '{print substr($$2,1,6)}' || echo "unknown"`
export PATH := $(TOP)/src/vendor/bin:$(PATH)
# directory containing the php iPATHFILE include file
FOWWWDIR = $(FOSRCDIR)/www/ui
# for use when coverage C code
FLAG_COV = -O0 -fprofile-arcs -ftest-coverage
# to run phpunit tests
PHPUNIT = $(FOSRCDIR)/vendor/bin/phpunit
PHPUNIT_CONF = $(FOSRCDIR)/phpunit.xml
PHPUNIT_BOOT = $(FOSRCDIR)/phpunit-bootstrap.php
# to run cunit tets
CUNIT_VERSION = $(shell $(TOP)/utils/cunit-version)
WriteVERSIONFile = echo "writing VERSION file for $(1)"; \
{\
echo "[$(1)]";\
echo "VERSION=\"$(VERSION)\"";\
echo "BRANCH=\"$(BRANCH)\"";\
echo "COMMIT_HASH=$(COMMIT_HASH)";\
echo BUILD_DATE=`date +"%Y/%m/%d %R %Z"`;\
git show -s --format="%ct.%h" 2>/dev/null | {\
IFS='.' read ctimestamp chash && {\
echo "COMMIT_DATE=$$(date -d"@$$ctimestamp" +"%Y/%m/%d %R %Z" )";\
} || {\
echo "COMMIT_DATE=unknown";\
}\
}\
} > VERSION
# define VERSION and COMMIT_ID
DEFS = -DVERSION_S=\"$(VERSION)\" -DCOMMIT_HASH_S=\"$(COMMIT_HASH)\"
# build html coverage report
#LCOV_OPT = --rc lcov_branch_coverage=1
LCOV_OPT =
coverage-report-html = lcov --directory "$(1)" $(LCOV_OPT) --capture --output-file cov_raw.txt && \
lcov --remove cov_raw.txt $(LCOV_OPT) '/usr/include/*' '*/agent_tests/*' '*/tests/*' -o cov.txt && \
rm cov_raw.txt && \
genhtml -o results $(LCOV_OPT) cov.txt && \
rm cov.txt
# TWIG_CACHE = <parameter key=\"cache\" type=\"constant\">false</parameter>
TWIG_CACHE = <parameter key=\"cache\" type=\"string\">$(CACHEDIR)</parameter>