forked from gridcf/gct
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
182 lines (158 loc) · 6.32 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
ACLOCAL_AMFLAGS = -I m4
PKG_CONFIG_PATH = $(GT_PKGCONFIG_DIRS)
SUBDIRS = @TOP_SUBDIRS@
DIST_SUBDIRS = @TOP_DIST_SUBDIRS@
@TARGETS_FILE@
$(GT_TARGETS_CLEAN):
@if [ -f $($@_stamp) ]; then \
export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) ; cd $($@_SUBDIR) && $(MAKE) $(AM_MAKEFLAGS) clean ; \
fi
@rm -f $($@_stamp)
$(GT_ALL_TARGETS_INSTALL):
@export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) ; cd $($@_SUBDIR) && $(MAKE) $(AM_MAKEFLAGS) install
$(GT_TARGETS_CHECK):
@export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) ; cd $($@_SUBDIR) && $(MAKE) $(AM_MAKEFLAGS) check
$(GT_ALL_TARGETS_DIST):
@export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) ; cd $($@_SUBDIR) && MAKEFLAGS= $(MAKE) $(AM_MAKEFLAGS) dist
@$(MKDIR_P) package-output && cp $($@_SUBDIR)/$($@-tarball) package-output
$(GT_ALL_STAMPS):
@export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) ; (cd $($@_SUBDIR) && $(MAKE) $(AM_MAKEFLAGS) all) && touch $@
$(GT_ONLY):
@export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) ; cd $($@_SUBDIR) && $(MAKE) $(AM_MAKEFLAGS) all
RPMDIRS = BUILD BUILDROOT RPMS SOURCES SPECS SRPMS
.rpmmacros:
@$(MKDIR_P) rpmbuild
@(case `lsb_release -is`:`lsb_release -rs` in \
CentOS*:5*|RedHat*:5*|Scientific*:5*) \
echo "%rhel 5" \
;; \
CentOS*:6*|RedHat*:6*|Scientific*:6*) \
echo "%rhel 6" \
;; \
CentOS*:7*|RedHat*:7*|Scientific*:7*) \
echo "%rhel 7" \
;; \
esac; \
echo "%_topdir $(abs_builddir)/rpmbuild"; \
echo "%globus_version $(PACKAGE_VERSION)"; \
) > $@
$(GT_ALL_TARGETS_RPM): .rpmmacros
@for d in $(RPMDIRS); do mkdir -p rpmbuild/$$d || exit 1; done
@cp $($@_SOURCE) rpmbuild/SOURCES
@HOME=$$(pwd) ac_cv_host=$(host_triplet) rpmbuild --target=$(host_triplet) -ba $($@_SPECFILE)
$(GT_ALL_TARGETS_DEB):
@rm -rf debbuild/$($@_PACKAGE_NAME)
@mkdir -p debbuild/$($@_PACKAGE_NAME)
@cp $($@_SOURCE) $($@_TARBALL)
@cp -R $(srcdir)/packaging/debian/$($@_PACKAGE_NAME) debbuild
@sed -e 's/@distro@/$(shell lsb_release -cs)/g' < $(srcdir)/packaging/debian/$($@_PACKAGE_NAME)/debian/changelog.in > debbuild/$($@_PACKAGE_NAME)/debian/changelog
@tar --strip 1 -zxf $($@_SOURCE) -C debbuild/$($@_PACKAGE_NAME)
@cd debbuild/$($@_PACKAGE_NAME) && dpkg-buildpackage -uc -us $(DPKG_BUILDPACKAGE_OPTS)
$(GT_ALL_TARGETS_OSX_PKG):
rm -f $($@)
export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) ; cd $($($@)_SUBDIR) && $(MAKE) $(AM_MAKEFLAGS) install DESTDIR=$(abs_builddir)/osx/dest/$$(basename $($@) .pkg)
@for filename in `find $(abs_builddir)/osx/dest/$$(basename $($@) .pkg) -type f | grep -v '\.a$$'`; do \
if file "$$filename" | grep -q Mach-O; then \
echo "Processing $$filename"; \
for lib in `otool -L "$$filename" | sed 1d | grep -E "$(libdir)|ltdl" | awk '{print $$1}'`; do \
echo "Rewriting $$lib"; \
libname="$$(echo "$$lib" | sed -e 's|//*|/|g' -e 's|${libdir}//*||')"; \
install_name_tool -change "$$lib" "@loader_path/../lib/$$libname" $$filename || exit 1; \
done; \
if basename $$filename | grep -vq '^lib'; then \
install_name_tool -add_rpath "@loader_path/../lib" "$$filename"; \
else \
install_name_tool -id "$$(basename $$filename)" "$$filename"; \
fi; \
fi; \
done
@find osx/dest/$$(basename $($@) .pkg) \( -name '*.la' -o -name '*.a' \) -a -exec rm {} +
@mkdir -p osx/packages
@pkgbuild --root $(abs_builddir)/osx/dest/$$(basename $($@) .pkg) \
--version $($($@)_PACKAGE_VERSION) \
--identifier org.globus.$($($@)_PACKAGE_NAME) \
--ownership recommended \
$($($($@)_PACKAGE_NAME)_macosx_scripts) \
$($@)
if !HAVE_LTDL
LTDL_MAC_PKG = ltdl-@[email protected]
GT_TARGETS_OSX_PKG += $(LTDL_MAC_PKG)
endif
globus_common_macosx_scripts = --scripts osx/scripts/globus_common
$(globus_common-osx-pkg): osx/scripts/globus_common/postinstall
osx/$(PACKAGE)-$(VERSION).pkg: $(GT_TARGETS_OSX_PKG) osx/distribution.xml
@productbuild --distribution osx/distribution.xml \
--package-path osx/packages \
--resources $(srcdir)/osx/resources \
$@
osx-pkgs: osx/$(PACKAGE)-$(VERSION).pkg
rpm-pkgs: $(GT_TARGETS_RPM)
tarballs: $(GT_ALL_TARGETS_DIST)
DOC_STAMPS =
DOC_PHONY =
DOC_CLEAN =
if ENABLE_DOXYGEN
DOC_STAMPS += doc-stamp
DOC_CLEAN += doc-clean
doc: doc-stamp
doc-stamp: Doxyfile doxygen/index.dox $(GT_ENABLED_BUNDLES)
rm -rf doc
@$(DOXYGEN)
@touch $@
doc-clean:
@rm -rf doc doc-stamp
DOC_PHONY += doc doc-clean
endif
install-data-local: $(DOC_STAMPS)
@if test -d doc/man/man3; then \
install -d -m 755 $(DESTDIR)$(mandir)/man3 && \
$(INSTALL) -m 644 doc/man/man3/[Gg][Ll][Oo][Bb][Uu][Ss]*.3 $(DESTDIR)$(mandir)/man3 ; \
fi
@if test -d doc/html; then \
for dir in `cd doc; find html -type d`; do \
install -d -m 755 $(DESTDIR)$(docdir)/$$dir || exit 1; \
done ; \
for f in `cd doc; find html -type f`; do \
$(INSTALL) -m 644 doc/$$f $(DESTDIR)$(docdir)/$$f || exit 1; \
done ; \
fi
install-exec-local:
@for stamp in $(GT_ALL_STAMPS); do \
if [ -f $$stamp ]; then \
stamp_pkg=`echo $$stamp | sed -e s'/-stamp//'`; \
export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) ; $(MAKE) $(AM_MAKEFLAGS) $${stamp_pkg}-install || exit 1 ; \
fi; \
done
EXTRA_DIST = globus-vararg-enums-doxygen-filter.pl GLOBUS_LICENSE osx/resources/GLOBUS_LICENSE osx/resources/logo.png
if !HAVE_LTDL
LTDL_CLEAN = libltdl-clean
endif
all-local: $(GT_ENABLED_BUNDLES) $(DOC_STAMPS)
clean-local: $(GT_TARGETS_CLEAN) $(DOC_CLEAN) $(LTDL_CLEAN)
distclean-local: $(GT_TARGETS_DISTCLEAN)
check-local:
@for stamp in $(GT_ALL_STAMPS); do \
if [ -f $$stamp ]; then \
stamp_pkg=`echo $$stamp | sed -e s'/-stamp//'`; \
export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) ; $(MAKE) $(AM_MAKEFLAGS) $${stamp_pkg}-check || exit 1 ; \
fi; \
done
libltdl-install:
if !HAVE_LTDL
export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) ; cd libltdl && $(MAKE) $(AM_MAKEFLAGS) install
endif
:
libltdl-stamp:
if !HAVE_LTDL
export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) ; cd libltdl && $(MAKE) $(AM_MAKEFLAGS)
endif
touch $@
if !HAVE_LTDL
libltdl-clean:
export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) ; if [ -f libltdl/Makefile ]; then cd libltdl && $(MAKE) $(AM_MAKEFLAGS) clean ; fi
rm -f libltdl-stamp
endif
dist-hook:
if [ ! -d $(distdir)/gridftp/hdfs ]; then cp -pPR $(srcdir)/gridftp/hdfs $(distdir)/gridftp/hdfs; fi
globus_gridftp_server-stamp: $(GT_ENABLED_XIO_DRIVERS)
.PHONY: $(GT_TARGETS_ALL) $(GT_TARGETS_ONLY) $(GT_TARGETS_CLEAN) $(GT_TARGETS_INSTALL) $(GT_TARGETS_CHECK) $(GT_TARGETS_DISTCLEAN) $(GT_TARGETS_DIST) $(DOC_PHONY) $(GT_TARGETS_RPM) $(GT_TARGETS_DEB) $(GT_BUNDLES)