forked from cfengine/masterfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (47 loc) · 1.29 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
PWD:=$(shell pwd)
ifeq ($(CORE),)
CORE:=$(PWD)/../core/
endif
ifeq ($(ENTERPRISE),)
ENTERPRISE:=$(PWD)/../enterprise/
endif
ifeq ($(DESTDIR),)
DESTDIR:=/var/cfengine/masterfiles
endif
UNAME := $(shell uname)
REL := $(shell uname -r)
ifeq ($(UNAME), SunOS)
ifneq ($(REL), 5.11)
INSTALL = /usr/sbin/install
else
INSTALL = /opt/csw/gnu/install
endif
else
INSTALL = /usr/bin/install
endif
INSTALL_DATA = ${INSTALL} -m 600
INSTALL_DIR = ${INSTALL} -m 750 -d
ENV_FILE:=$(PWD)/tests/acceptance/testall.env
copy:
cp $(CORE)/tests/acceptance/*.cf.sub tests/acceptance
env:
echo export CORE=\"$(CORE)\" > $(ENV_FILE)
echo export ENTERPRISE=\"$(ENTERPRISE)\" >> $(ENV_FILE)
echo export CFENGINE_TEST_OVERRIDE_EXTENSION_LIBRARY_DIR=\"$(ENTERPRISE)/enterprise-plugin/.libs\" >> $(ENV_FILE)
check: copy env
cd tests/acceptance && ./testall
checklog: copy env
cd tests/acceptance && ./testall --printlog
install:
for d in . cfe_internal controls inventory lib/3.5 lib/3.6 lib/3.7 reports services services/autorun sketches/meta update; do \
$(INSTALL_DIR) $(DESTDIR)/$$d; \
for f in $$d/*.cf; do\
$(INSTALL_DATA) $$f $(DESTDIR)/$$f; \
done; \
done;
for d in templates; do \
$(INSTALL_DIR) $(DESTDIR)/$$d; \
for f in $$d/*.mustache; do\
$(INSTALL_DATA) $$f $(DESTDIR)/$$f; \
done; \
done;