xref: /freebsd/contrib/libxo/Makefile.am (revision 34b867ca30479cec104fd069178df294f8ea35f1)
131337658SMarcel Moolenaar#
231337658SMarcel Moolenaar# $Id$
331337658SMarcel Moolenaar#
431337658SMarcel Moolenaar# Copyright 2014, Juniper Networks, Inc.
531337658SMarcel Moolenaar# All rights reserved.
631337658SMarcel Moolenaar# This SOFTWARE is licensed under the LICENSE provided in the
731337658SMarcel Moolenaar# ../Copyright file. By downloading, installing, copying, or otherwise
831337658SMarcel Moolenaar# using the SOFTWARE, you agree to be bound by the terms of that
931337658SMarcel Moolenaar# LICENSE.
1031337658SMarcel Moolenaar
1131337658SMarcel MoolenaarACLOCAL_AMFLAGS = -I m4
1231337658SMarcel Moolenaar
13*34b867caSPhil ShaferSUBDIRS = bin libxo xo xopo xolint xohtml tests doc encoder
1431337658SMarcel Moolenaarbin_SCRIPTS=libxo-config
1531337658SMarcel Moolenaardist_doc_DATA = Copyright
1631337658SMarcel Moolenaar
1731337658SMarcel MoolenaarEXTRA_DIST = \
1831337658SMarcel Moolenaar    libxo-config.in \
1931337658SMarcel Moolenaar    warnings.mk \
2031337658SMarcel Moolenaar    README.md \
2131337658SMarcel Moolenaar    INSTALL.md \
2231337658SMarcel Moolenaar    packaging/libxo.spec
2331337658SMarcel Moolenaar
2431337658SMarcel Moolenaar.PHONY: test tests
2531337658SMarcel Moolenaar
2631337658SMarcel Moolenaartest tests:
2731337658SMarcel Moolenaar	@(cd tests ; ${MAKE} test)
2831337658SMarcel Moolenaar
2931337658SMarcel Moolenaarerrors:
3031337658SMarcel Moolenaar	@(cd tests/errors ; ${MAKE} test)
3131337658SMarcel Moolenaar
3231337658SMarcel Moolenaardocs:
3331337658SMarcel Moolenaar	@(cd doc ; ${MAKE} docs)
3431337658SMarcel Moolenaar
3531337658SMarcel MoolenaarDIST_FILES_DIR = ~/Dropbox/dist-files/
3631337658SMarcel MoolenaarGH_PAGES_DIR = gh-pages/
37545ddfbeSMarcel MoolenaarGH_PAGES_DIR_VER = gh-pages/${PACKAGE_VERSION}
3831337658SMarcel MoolenaarPACKAGE_FILE = ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.gz
3931337658SMarcel Moolenaar
40fd5e3f3eSPhil ShaferXOHTML_FILES = \
41fd5e3f3eSPhil Shafer    ${top_srcdir}/xohtml/xohtml.css \
42fd5e3f3eSPhil Shafer    ${top_srcdir}/xohtml/xohtml.js \
43fd5e3f3eSPhil Shafer    ${top_srcdir}/xohtml/external/jquery.js \
44fd5e3f3eSPhil Shafer    ${top_srcdir}/xohtml/external/jquery.qtip.css \
45fd5e3f3eSPhil Shafer    ${top_srcdir}/xohtml/external/jquery.qtip.js
46fd5e3f3eSPhil Shafer
47fd5e3f3eSPhil Shaferupload: dist upload-docs upload-xohtml-files
4831337658SMarcel Moolenaar	@echo "Remember to run:"
4931337658SMarcel Moolenaar	@echo "        gt tag ${PACKAGE_VERSION}"
5031337658SMarcel Moolenaar
5176afb20cSPhil Shaferupload-docs: docs upload-html
5276afb20cSPhil Shafer
5376afb20cSPhil Shaferupload-html:
5476afb20cSPhil Shafer	@echo "Uploading html ... "
5576afb20cSPhil Shafer	@-[ -d ${GH_PAGES_DIR} -a -d doc/html ] \
5676afb20cSPhil Shafer		&& echo "Updating html on gh-pages ..." \
5776afb20cSPhil Shafer		&& mkdir -p ${GH_PAGES_DIR_VER}/html \
5876afb20cSPhil Shafer		&& cp doc/top-link.html ${GH_PAGES_DIR}/libxo.html \
5976afb20cSPhil Shafer		&& cp -r doc/html/* ${GH_PAGES_DIR_VER}/html/ \
6031337658SMarcel Moolenaar		&& (cd ${GH_PAGES_DIR} \
6176afb20cSPhil Shafer			&& git add libxo.html \
6276afb20cSPhil Shafer			&& git add ${PACKAGE_VERSION}/html \
6331337658SMarcel Moolenaar			&& git commit -m 'new docs' \
6476afb20cSPhil Shafer                               libxo.html ${PACKAGE_VERSION}/html \
6531337658SMarcel Moolenaar			&& git push origin gh-pages ) ; true
6631337658SMarcel Moolenaar
67fd5e3f3eSPhil Shaferupload-xohtml-files:
68fd5e3f3eSPhil Shafer	@echo "Uploading xohtml files ... "
69fd5e3f3eSPhil Shafer	@-[ -d ${GH_PAGES_DIR} ] \
70fd5e3f3eSPhil Shafer		&& echo "Updating xohtml files on gh-pages ..." \
71fd5e3f3eSPhil Shafer		&& mkdir -p ${GH_PAGES_DIR_VER}/xohtml \
72fd5e3f3eSPhil Shafer		&& cp ${XOHTML_FILES} ${GH_PAGES_DIR_VER}/xohtml \
73fd5e3f3eSPhil Shafer		&& (cd ${GH_PAGES_DIR} \
74fd5e3f3eSPhil Shafer			&& git add ${PACKAGE_VERSION}/xohtml \
75fd5e3f3eSPhil Shafer			&& git commit -m 'new xohtml files' \
76fd5e3f3eSPhil Shafer                               ${PACKAGE_VERSION}/xohtml \
77fd5e3f3eSPhil Shafer			&& git push origin gh-pages ) ; true
78fd5e3f3eSPhil Shafer
7931337658SMarcel Moolenaarpkgconfigdir=$(libdir)/pkgconfig
8031337658SMarcel Moolenaarpkgconfig_DATA = packaging/${PACKAGE_NAME}.pc
8131337658SMarcel Moolenaar
8231337658SMarcel Moolenaarget-wiki:
8331337658SMarcel Moolenaar	git clone https://github.com/Juniper/${PACKAGE_NAME}.wiki.git wiki
8431337658SMarcel Moolenaar
8531337658SMarcel Moolenaarget-gh-pages:
8631337658SMarcel Moolenaar	git clone https://github.com/Juniper/${PACKAGE_NAME}.git \
8731337658SMarcel Moolenaar		gh-pages -b gh-pages
8831337658SMarcel Moolenaar
8931337658SMarcel MoolenaarUPDATE_PACKAGE_FILE = \
9031337658SMarcel Moolenaar    -e "s;__SHA1__;$$SHA1;" \
9131337658SMarcel Moolenaar    -e "s;__SHA256__;SHA256 (textproc/${PACKAGE_FILE}) = $$SHA256;" \
9231337658SMarcel Moolenaar    -e "s;__SIZE__;SIZE (textproc/${PACKAGE_FILE}) = $$SIZE;"
9331337658SMarcel Moolenaar
94545ddfbeSMarcel MoolenaarGH_PACKAGING_DIR = ${PACKAGE_VERSION}/packaging
9531337658SMarcel MoolenaarGH_PAGES_PACKAGE_DIR = ${GH_PAGES_DIR}/${GH_PACKAGING_DIR}
9631337658SMarcel Moolenaar
9731337658SMarcel Moolenaarpackages:
9831337658SMarcel Moolenaar	@-[ -d ${GH_PAGES_DIR} ] && set -x \
9931337658SMarcel Moolenaar		&& echo "Updating packages on gh-pages ..." \
10042ff34c3SPhil Shafer                && mkdir -p ${GH_PAGES_DIR}/${GH_PACKAGING_DIR} \
10131337658SMarcel Moolenaar		&& SHA1="`openssl sha1 ${PACKAGE_FILE} | awk '{print $$2}'`" \
10231337658SMarcel Moolenaar		&& SHA256="`openssl sha256 ${PACKAGE_FILE} | awk '{print $$2}'`" \
10331337658SMarcel Moolenaar		&& SIZE="`ls -l ${PACKAGE_FILE} | awk '{print $$5}'`" \
10431337658SMarcel Moolenaar		&& echo "... ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.rb ..." \
10531337658SMarcel Moolenaar		&& sed ${UPDATE_PACKAGE_FILE} \
10631337658SMarcel Moolenaar			packaging/${PACKAGE_NAME}.rb.base \
10731337658SMarcel Moolenaar			> ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.rb \
10831337658SMarcel Moolenaar		&& echo "... ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.spec ..." \
10931337658SMarcel Moolenaar		&& cp packaging/${PACKAGE_NAME}.spec \
11031337658SMarcel Moolenaar			${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.spec \
11131337658SMarcel Moolenaar		&& (cd ${GH_PAGES_DIR} \
11231337658SMarcel Moolenaar			&& git add ${GH_PACKAGING_DIR} \
113545ddfbeSMarcel Moolenaar			&& git add ${GH_PACKAGING_DIR}/libxo.rb \
114545ddfbeSMarcel Moolenaar                                   ${GH_PACKAGING_DIR}/libxo.spec \
11531337658SMarcel Moolenaar			&& git commit -m 'new packaging data' \
11631337658SMarcel Moolenaar                               ${GH_PACKAGING_DIR} \
11731337658SMarcel Moolenaar			&& git push origin gh-pages ) ; true
118d1a0d267SMarcel Moolenaar
119d1a0d267SMarcel MoolenaarANALYZE_DIR = ~/trash/libxo
120d1a0d267SMarcel MoolenaarANALYZE_CMD = scan-build-mp-3.6
121d1a0d267SMarcel Moolenaar
122d1a0d267SMarcel Moolenaaranalyze:
123f2b7bf8aSPhil Shafer	${MAKE} clean
124d1a0d267SMarcel Moolenaar	${ANALYZE_CMD} -o ${ANALYZE_DIR} ${MAKE}
125f2b7bf8aSPhil Shafer
126f2b7bf8aSPhil ShaferSANIFLAGS=-fno-omit-frame-pointer -g -O2
127f2b7bf8aSPhil Shafer
128f2b7bf8aSPhil Shafersanitize-address:
129f2b7bf8aSPhil Shafer	${MAKE} clean
130f2b7bf8aSPhil Shafer	${MAKE} CFLAGS="-fsanitize=address ${SANIFLAGS}"
131f2b7bf8aSPhil Shafer	${MAKE} install
132f2b7bf8aSPhil Shafer	${MAKE} test
133f2b7bf8aSPhil Shafer
134f2b7bf8aSPhil Shafersanitize-undefined:
135f2b7bf8aSPhil Shafer	${MAKE} clean
136f2b7bf8aSPhil Shafer	${MAKE} CFLAGS="-fsanitize=undefined ${SANIFLAGS}"
137f2b7bf8aSPhil Shafer	${MAKE} install
138f2b7bf8aSPhil Shafer	${MAKE} test
139f2b7bf8aSPhil Shafer
140f2b7bf8aSPhil Shafersanitize-memory:
141f2b7bf8aSPhil Shafer	${MAKE} clean
142f2b7bf8aSPhil Shafer	${MAKE} CFLAGS="-fsanitize=memory ${SANIFLAGS}"
143f2b7bf8aSPhil Shafer	${MAKE} install
144f2b7bf8aSPhil Shafer	${MAKE} test
145