-
Notifications
You must be signed in to change notification settings - Fork 92
/
Makefile
121 lines (108 loc) · 3.09 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
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
.DEFAULT_GOAL:=all
.PHONY: all
all: modules
COREPATH=core
include Makefile.defs
NAME=$(APP_NAME)
subdirs = core apps tools
.PHONY: clean
clean:
@rm -f *.so
@set -e ; \
for r in $(subdirs) doc "" ; do \
if [ -n "$$r" ]; then \
echo "" ; \
echo "making $$r" ; \
$(MAKE) -C $$r clean ; \
fi ; \
done
.PHONY: modules
modules:
@set -e ; \
for r in $(subdirs) "" ; do \
if [ -n "$$r" ]; then \
echo "" ; \
echo "making $$r" ; \
$(MAKE) -C $$r all; \
fi ; \
done
.PHONY: install
install:
@set -e ; \
for r in $(subdirs) "" ; do \
if [ -n "$$r" ]; then \
echo "" ; \
echo "" ; \
$(MAKE) -C $$r install; \
fi ; \
done
@echo ""
@echo "*** install complete. Run SEMS with "
@echo "*** "
@echo "*** $(bin_target)$(NAME) -f $(cfg_target)sems.conf"
.PHONY: dist
dist: tar
.PHONY: tar
tar:
$(TAR) -C .. \
--exclude=$(notdir $(CURDIR))/tmp \
--exclude=core/$(notdir $(CURDIR))/tmp \
--exclude=.svn* \
--exclude=.git* \
--exclude=.\#* \
--exclude=*.[do] \
--exclude=*.la \
--exclude=*.lo \
--exclude=*.so \
--exclude=*.il \
--exclude=*.gz \
--exclude=*.bz2 \
--exclude=*.tar \
--exclude=*~ \
-cf - $(notdir $(CURDIR)) | \
(mkdir -p tmp/_tar1; mkdir -p tmp/_tar2 ; \
cd tmp/_tar1; $(TAR) -xf - ) && \
mv tmp/_tar1/$(notdir $(CURDIR)) \
tmp/_tar2/"$(NAME)-$(RELEASE)" && \
(cd tmp/_tar2 && $(TAR) \
-zcf ../../"$(NAME)-$(RELEASE)".tar.gz \
"$(NAME)-$(RELEASE)" ) ; \
rm -rf tmp
# the rpmtar target creates source tar.gz file, with versions taken from rpm spec file
# the tarball can be used for rpm building
.PHONY: rpmtar
rpmtar:
RPM_VERSION=`cat pkg/rpm/sems.spec|grep -e "^Version:"|awk '{print $$2}'`; \
RPM_RELEASE=`cat pkg/rpm/sems.spec|grep -e "^Release:"|awk '{print $$2}'`; \
echo "RPM_VERSION=$${RPM_VERSION}"; \
echo "RPM_RELEASE=$${RPM_RELEASE}"; \
$(TAR) -C .. \
--exclude=$(notdir $(CURDIR))/tmp \
--exclude=core/$(notdir $(CURDIR))/tmp \
--exclude=.svn* \
--exclude=.git* \
--exclude=.\#* \
--exclude=*.[do] \
--exclude=*.la \
--exclude=*.lo \
--exclude=*.so \
--exclude=*.il \
--exclude=*.gz \
--exclude=*.bz2 \
--exclude=*.tar \
--exclude=*~ \
-cf - $(notdir $(CURDIR)) | \
(mkdir -p tmp/_tar1; mkdir -p tmp/_tar2 ; \
cd tmp/_tar1; $(TAR) -xf - ) && \
mv tmp/_tar1/$(notdir $(CURDIR)) \
tmp/_tar2/"$(NAME)-$${RPM_VERSION}" && \
(cd tmp/_tar2 && $(TAR) \
-zcf ../../"$(NAME)-$${RPM_VERSION}-$${RPM_RELEASE}".tar.gz \
"$(NAME)-$${RPM_VERSION}" ) ; \
rm -rf tmp;
.PHONY: doc
doc:
make -C doc/ doc
.PHONY: fulldoc
fulldoc:
make -C doc/ fulldoc