forked from OPENDAP/bes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
189 lines (150 loc) · 6.24 KB
/
Makefile.am
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
185
186
187
188
# Build the Back End Server.
#
# jhrg 9/2/05
#
# Parallel versus serial build times:
# A full build using 'make' on a four core single-processor laptop took:
# real 2m7.363s
# user 1m51.920s
# sys 0m13.313s
#
# on the same machine, the same build using 'make -j6' took:
# real 0m48.181s
# user 3m29.876s
# sys 0m23.857s
AUTOMAKE_OPTIONS = foreign check-news subdir-objects
ACLOCAL_AMFLAGS = -I conf
AM_DISTCHECK_CONFIGURE_FLAGS=
if WITH_DEPENDENCIES
# With automake 1.14 setting AM_DISTCHECK... means that the user variable
# DISTCHECK_CONFIGURE_FLAGS no longer needs to be used. Earlier versions
# of automake don't support this. jhrg 6/5/17
AM_DISTCHECK_CONFIGURE_FLAGS += --with-dependencies=@ac_bes_dependencies_prefix@ --enable-developer
endif
AM_CXXFLAGS=
AM_LDFLAGS =
include $(top_srcdir)/coverage.mk
SUBDIRS = http dispatch xmlcommand ppt server cmdln standalone docs bin templates hello_world
if LIBDAP
SUBDIRS += dap dapreader
if DAP_BUILTIN_MODULES
SUBDIRS += functions modules
endif
endif
bin_SCRIPTS = bes-config bes-config-pkgconfig bes-tmpfiles-conf
# Yes, even though its `init_d_SCRIPTS`, we use `init_ddir`,
# with-out a second underscore.
init_ddir = $(sysconfdir)/rc.d/init.d
init_d_SCRIPTS = besd
logrotate_ddir = $(sysconfdir)/logrotate.d
logrotate_d_DATA = besd.logrotate
CLEANFILES = $(init_d_SCRIPTS)
pkgconfigdir=$(libdir)/pkgconfig
pkgconfig_DATA = bes_dispatch.pc bes_ppt.pc bes_xml_command.pc
aclocaldir=$(datadir)/aclocal
dist_aclocal_DATA = conf/bes.m4
EXTRA_DIST = doxy.conf.in bes.spec OSX_Resources bes-config-pkgconfig \
bes-tmpfiles-conf besd.logrotate README.md rapidjson
HTML_DOCS=html
DOXYGEN_CONF=doxy.conf
# Build a compile_commands.json.tmp file for use with CLion. This will emable
# reasonable use for all the source that's compiled using either 'all' or
# 'check' but other targets will have to be added by hand. See the compiledb
# github site (https://github.com/nickdiego/compiledb) for more info.
# jhrg 9/25/19
.PHONY: compiledb
compiledb:
make -nwk all check | compiledb
# This target only builds the documents, it does not move them to
# github. Use the 'gh-docs' target below for that.
.PHONY: docs
docs: ${DOXYGEN_CONF}
doxygen ${DOXYGEN_CONF}
# GitHub.io docs
.PHONY: gh-docs
gh-docs:
./build-gh-docs.sh
# cccc computes metrics like Lines of code and McCabe. It'a available
# on the web...
# For the BES, compute metrics for: dispatch xmlcommand ppt server
.PHONY: cccc
cccc:
for d in dispatch xmlcommand ppt server; \
do $(MAKE) -C $$d $(MFLAGS) cccc; \
done
# This hack strips out the individual handlers' spec files from the
# big tar and lets us use the old target again, which means I don't
# have to code the rpmbuild root into a target.
dist-hook:
-rm -rf `find $(distdir) -name '*.spec' -a ! -name bes.spec `
-rm -rf `find $(distdir) -name 'test_config.h' `
# Build linux RPMs
srpm: dist
rpmbuild -ts --clean $(RPM_OPTIONS) @PACKAGE@-@[email protected]
# NB: 'dist' builds a tar.gz package using automake in the CWD.
rpm: dist
rpmbuild -tb --clean $(RPM_OPTIONS) @PACKAGE@-@[email protected]
# This target is pretty specific to our need to build a RPM for use at
# GSFC and JPL. We are assuming that the user has the rpmbuild dirs.
# This will link with everything it can find in the local deps dir,
# removing the need for EPEL
all-static-rpm: dist
cp @PACKAGE@-@[email protected] ~/rpmbuild/SOURCES
rpmbuild -bb $(RPM_OPTIONS) bes.spec.all_static
# Static RPM for CentOS 6 - the 'all-static-rpm' target requires CentOS 7
c6-all-static-rpm: dist
cp @PACKAGE@-@[email protected] ~/rpmbuild/SOURCES
rpmbuild -bb $(RPM_OPTIONS) bes.spec.c6.all_static
# Old comment:
# We used to use -tb and feed it the source tar.gz but with the new
# 'modules' build of the bes there are multiple .spec files in the resulting
# tar.gz and that confuses rpmbuild. Running rpmbuild with more than one
# spec file in the tar.gz results in the somewhat inscrutable error: 'two
# %prep lines'. As a work-around (and because I don't want to remove the
# handler's spec files, I'm using the modified rpm rule above). jhrg 3/18/15
#
# Update: I used dist-hook to filter out the modules' *.spec files. jhrg
# 3/20/15
###########################################################################
#Build the debian package
deb: dist
( mv @PACKAGE@-@[email protected] ../ )
( mv ../@PACKAGE@-@[email protected] ../@PACKAGE@_@[email protected] )
( cd ../ && tar xzf @PACKAGE@_@[email protected] )
( cp -r debian/ ../@PACKAGE@-@PACKAGE_VERSION@ )
( cd ../@PACKAGE@-@PACKAGE_VERSION@ && debuild --preserve-env --prepend-path=$(prefix)/deps/bin -us -uc -j7)
##########################################################################
# Build OS/X Packages. The strange operations with configure and make
# are there so that the values built into bes-config will match the mac
# osx install dirs and not the temp directory used to build the packages
PACKAGEMAKER=/Developer/usr/bin/packagemaker
PKG_CONF_FLAGS=
clean-pkg:
-rm -rf mac_osx @PACKAGE@-@[email protected] @PACKAGE@-@PACKAGE_VERSION@
pkg-build: clean-pkg
./configure --prefix=$(prefix) --disable-dependency-tracking $(PKG_CONF_FLAGS)
make clean all
DESTDIR=`pwd`/mac_osx make install
pkg-main: pkg-build
./OSX_Resources/update_mac_package_contents.pl README
cat ./OSX_Resources/InstallationCheck.proto | sed -e "s^_PREFIX_^$(prefix)^g" > foo
mv foo ./OSX_Resources/InstallationCheck
cat ./OSX_Resources/Info.plist.proto | \
sed -e "s^_PREFIX_^$(prefix)^g" \
-e "s^_FULL_VERSION_^@PACKAGE_VERSION@^g" \
-e "s^_MAJOR_VERSION_^@PACKAGE_MAJOR_VERSION@^g" \
-e "s^_MINOR_VERSION_^@PACKAGE_MINOR_VERSION@^g" \
> foo
mv foo ./OSX_Resources/Info.plist
${PACKAGEMAKER} --root mac_osx --id org.opendap.@PACKAGE@ \
--title "@PACKAGE@ @PACKAGE_VERSION@" --version @PACKAGE_VERSION@ \
--out @PACKAGE@-@[email protected] --resources OSX_Resources
pkg-dmg: pkg-main
-rm -rf @PACKAGE@-@PACKAGE_VERSION@
-rm -rf @PACKAGE@-@[email protected]
mkdir @PACKAGE@-@PACKAGE_VERSION@
cp -r @PACKAGE@-@[email protected] @PACKAGE@-@PACKAGE_VERSION@
cp README NEWS @PACKAGE@-@PACKAGE_VERSION@
dropdmg -i --sanitize-for-servers --format zlib @PACKAGE@-@PACKAGE_VERSION@
-rm -rf @PACKAGE@-@PACKAGE_VERSION@
pkg: pkg-main