forked from fossology/fossology
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
95 lines (75 loc) · 2.3 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
84
85
86
87
88
89
90
91
92
93
94
95
# FOSSology Makefile
# Copyright (C) 2008-2011 Hewlett-Packard Development Company, L.P.
# pull in all our default variables
include Makefile.conf
# the directories we do things in by default
DIRS = install src
# create lists of targets for various operations
# these are phony targets (declared at bottom) of convenience so we can
# run 'make $(operation)-$(subdir)'. Yet another convenience, a target of
# '$(subdir)' is equivalent to 'build-$(subdir)'
BUILDDIRS = $(DIRS:%=build-%)
INSTALLDIRS = $(DIRS:%=install-%)
INSTALLDIRSOFFLINE = $(DIRS:%=install_offline-%)
UNINSTALLDIRS = $(DIRS:%=uninstall-%)
CLEANDIRS = $(DIRS:%=clean-%)
TESTDIRS = $(DIRS:%=test-%)
COVDIRS = $(DIRS:%=cov-%)
CONFPATH = $(SYSCONFDIR)
## Targets
# build
all: $(BUILDDIRS) VERSIONFILE
$(DIRS): $(BUILDDIRS)
$(BUILDDIRS):
$(MAKE) -C $(@:build-%=%)
# high level dependencies:
# the scheduler and agents need the library built first
build-scheduler: build-src
build-agents: build-src
# utils is a separate target, since it isn't built by default yet
utils: build-utils
# generate the VERSION file
TOP = .
VERSIONFILE:
@$(call WriteVERSIONFile,"BUILD")
# install depends on everything being built first
install: all $(INSTALLDIRS)
$(INSTALLDIRS):
$(INSTALL) -m 666 VERSION $(DESTDIR)$(CONFPATH)/VERSION
$(MAKE) -C $(@:install-%=%) install
# offline install (without composer)
install_offline: all $(INSTALLDIRSOFFLINE)
$(INSTALL) -m 666 VERSION $(DESTDIR)$(CONFPATH)/VERSION
$(INSTALLDIRSOFFLINE):
$(MAKE) -C $(@:install_offline-%=%) install_offline
uninstall: $(UNINSTALLDIRS)
$(UNINSTALLDIRS):
$(MAKE) -C $(@:uninstall-%=%) uninstall
# test depends on everything being built first
test: all $(TESTDIRS)
$(TESTDIRS):
$(MAKE) -C $(@:test-%=%) test
coverage: $(COVDIRS)
$(COVDIRS):
$(MAKE) -C $(@:cov-%=%) coverage
clean: $(CLEANDIRS)
rm -f variable.list VERSION
$(CLEANDIRS):
$(MAKE) -C $(@:clean-%=%) clean
phpvendors:
$(MAKE) -C $(FOSRCDIR) phpvendors
# release stuff
tar: dist-testing
dist-testing:
utils/fo-mktar -s
tar-release: dist
dist:
utils/fo-mktar
empty-cache:
$(MAKE) -C $(FOWWWDIR) empty-cache
%:
$(MAKE) -C $(FOSRCDIR) $@
.PHONY: $(BUILDDIRS) $(DIRS) $(INSTALLDIRS) $(UNINSTALLDIRS)
.PHONY: $(TESTDIRS) $(CLEANDIRS)
.PHONY: all install install_offline uninstall clean test utils preparetest
.PHONY: dist dist-testing tar tar-release