-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.am
82 lines (66 loc) · 2.34 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
# $Id: Makefile.am,v 1.0.0-0 2010/05/14 11:09:28 Cnangel Exp $
# AUTOMAKE_OPTIONS = foreign 1.11.1
AUTOMAKE_OPTIONS = foreign
CURRENTPATH = $(shell /bin/pwd)
ACLOCAL_AMFLAGS = -I m4
# install m4 files
m4datadir = aclocal
m4data_DATA = @[email protected] \
$(NULL)
# install pc files
pcdatadir = $(libdir)/pkgconfig
pcdata_DATA = pkgconfig/@[email protected] \
$(NULL)
# install @PACKAGE@-config
bin_SCRIPTS = scripts/@PACKAGE@-config
# define rpm build root
RPMBUILDTOPDIR = $(shell unset RPMBUILDTOPDIR; if [ -f ${HOME}/.rpmmacros ]; then export RPMBUILDTOPDIR=`grep _topdir ${HOME}/.rpmmacros|head -1|awk '{print $$2}'`; else if [ -z $(RDIR) ]; then export RPMBUILDTOPDIR=target; else export RPMBUILDTOPDIR=$(RDIR); fi; fi; echo $${RPMBUILDTOPDIR};)
# `rpm --showrc | $(PERL) -n -e 'print if(s/.*_topdir\s+(.*)/$$1/)'` ;
EXTRA_DIST = autogen.sh \
m4/AC_CREATE_PREFIX_CONFIG_H.m4 \
m4/AC_C_INT64_T.m4 \
m4/AC_FUNC_SNPRINTF.m4 \
m4/BB_CHECK_PTHREADS.m4 \
m4/BB_ENABLE_DOXYGEN.m4 \
m4/ac_config_libconfig_in.m4 \
m4/ac_config_pkgconfig_in.m4 \
m4/acinclude.m4 \
$(NULL)
SUBDIRS = include \
lib \
lib64 \
data \
src \
conf \
doc \
scripts \
tools \
test \
$(NULL)
.PHONY: rpm doc
# make doc WITH_FOO=1, like spec file: make %{?_with_iconv_macro}
doc:
@MK@ifeq ($(WITH_FOO), 1)
@MK@ @echo "Only for ifeq test with FOO ... OK"
@MK@else
@MK@ @echo "Not with FOO ... OK"
@MK@endif
$(mkdir_p) @DOXYGEN_OUTPUT_DIR@
doxygen -u && doxygen
sed -i -e "s/charset=iso-8859-1/charset=utf-8/g" $(top_builddir)/@DOXYGEN_OUTPUT_DIR@/html/*.html
# for make rpm --with foo : make rpm OPTIONS='--with foo'
rpm: doc dist @[email protected]
$(mkdir_p) ${RPMBUILDTOPDIR}/{BUILD,RPMS,SOURCES,SPECS,SRPMS,BUILDROOT}
$(RM) ${RPMBUILDTOPDIR}/SOURCES/$(distdir).tar.gz
$(RM) ${RPMBUILDTOPDIR}/SPECS/@[email protected]
$(LN_S) `pwd`/$(distdir).tar.gz ${RPMBUILDTOPDIR}/SOURCES
$(LN_S) `pwd`/@[email protected] ${RPMBUILDTOPDIR}/SPECS
rpmbuild -ba ${RPMBUILDTOPDIR}/SPECS/@[email protected] $(OPTIONS)
CLEANDIRS = doc/doxygen
DISTCLEANFILES = .deps Makefile
CLEANFILES = *~ *.log @PACKAGE@-*.tar.gz @PACKAGE@-config
MAINTAINERCLEANFILES = Makefile.in
clean-local:
-test -z "$(CLEANDIRS)" || rm -rf $(CLEANDIRS)