xref: /freebsd/contrib/libxo/Makefile.am (revision 243e928310d073338c5ec089f0dce238a80b9866)
1#
2# $Id$
3#
4# Copyright 2014, Juniper Networks, Inc.
5# All rights reserved.
6# This SOFTWARE is licensed under the LICENSE provided in the
7# ../Copyright file. By downloading, installing, copying, or otherwise
8# using the SOFTWARE, you agree to be bound by the terms of that
9# LICENSE.
10
11ACLOCAL_AMFLAGS = -I m4
12
13SUBDIRS = libxo xo xopo xolint xohtml tests doc encoder
14bin_SCRIPTS=libxo-config
15dist_doc_DATA = Copyright
16
17EXTRA_DIST = \
18    libxo-config.in \
19    warnings.mk \
20    README.md \
21    INSTALL.md \
22    packaging/libxo.spec
23
24.PHONY: test tests
25
26test tests:
27	@(cd tests ; ${MAKE} test)
28
29errors:
30	@(cd tests/errors ; ${MAKE} test)
31
32docs:
33	@(cd doc ; ${MAKE} docs)
34
35
36DIST_FILES_DIR = ~/Dropbox/dist-files/
37GH_PAGES_DIR = gh-pages/
38GH_PAGES_DIR_VER = gh-pages/${PACKAGE_VERSION}
39PACKAGE_FILE = ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.gz
40
41upload: dist upload-docs
42	@echo "Remember to run:"
43	@echo "        gt tag ${PACKAGE_VERSION}"
44
45upload-docs: docs
46	@echo "Uploading libxo-manual.html ... "
47	@-[ -d ${GH_PAGES_DIR} ] \
48		&& echo "Updating manual on gh-pages ..." \
49		&& mkdir -p ${GH_PAGES_DIR_VER} \
50		&& cp doc/libxo-manual.html ${GH_PAGES_DIR} \
51		&& cp doc/libxo-manual.html ${GH_PAGES_DIR_VER} \
52		&& (cd ${GH_PAGES_DIR} \
53			&& git add ${PACKAGE_VERSION} \
54			&& git add libxo-manual.html \
55			&& git commit -m 'new docs' \
56                               libxo-manual.html ${PACKAGE_VERSION} \
57			&& git push origin gh-pages ) ; true
58
59pkgconfigdir=$(libdir)/pkgconfig
60pkgconfig_DATA = packaging/${PACKAGE_NAME}.pc
61
62get-wiki:
63	git clone https://github.com/Juniper/${PACKAGE_NAME}.wiki.git wiki
64
65get-gh-pages:
66	git clone https://github.com/Juniper/${PACKAGE_NAME}.git \
67		gh-pages -b gh-pages
68
69UPDATE_PACKAGE_FILE = \
70    -e "s;__SHA1__;$$SHA1;" \
71    -e "s;__SHA256__;SHA256 (textproc/${PACKAGE_FILE}) = $$SHA256;" \
72    -e "s;__SIZE__;SIZE (textproc/${PACKAGE_FILE}) = $$SIZE;"
73
74GH_PACKAGING_DIR = ${PACKAGE_VERSION}/packaging
75GH_PAGES_PACKAGE_DIR = ${GH_PAGES_DIR}/${GH_PACKAGING_DIR}
76
77packages:
78	@-[ -d ${GH_PAGES_DIR} ] && set -x \
79		&& echo "Updating packages on gh-pages ..." \
80                && mkdir -p ${GH_PAGES_DIR}/${GH_PACKAGING_DIR} \
81		&& SHA1="`openssl sha1 ${PACKAGE_FILE} | awk '{print $$2}'`" \
82		&& SHA256="`openssl sha256 ${PACKAGE_FILE} | awk '{print $$2}'`" \
83		&& SIZE="`ls -l ${PACKAGE_FILE} | awk '{print $$5}'`" \
84		&& echo "... ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.rb ..." \
85		&& sed ${UPDATE_PACKAGE_FILE} \
86			packaging/${PACKAGE_NAME}.rb.base \
87			> ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.rb \
88		&& echo "... ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.spec ..." \
89		&& cp packaging/${PACKAGE_NAME}.spec \
90			${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.spec \
91		&& (cd ${GH_PAGES_DIR} \
92			&& git add ${GH_PACKAGING_DIR} \
93			&& git add ${GH_PACKAGING_DIR}/libxo.rb \
94                                   ${GH_PACKAGING_DIR}/libxo.spec \
95			&& git commit -m 'new packaging data' \
96                               ${GH_PACKAGING_DIR} \
97			&& git push origin gh-pages ) ; true
98
99ANALYZE_DIR = ~/trash/libxo
100ANALYZE_CMD = scan-build-mp-3.6
101
102analyze:
103	${ANALYZE_CMD} -o ${ANALYZE_DIR} ${MAKE}
104