xref: /freebsd/contrib/libxo/Makefile.am (revision 0a36787e4c1fa0cf77dcf83be0867178476e372b)
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
35DIST_FILES_DIR = ~/Dropbox/dist-files/
36GH_PAGES_DIR = gh-pages/
37GH_PAGES_DIR_VER = gh-pages/${PACKAGE_VERSION}
38PACKAGE_FILE = ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.gz
39
40XOHTML_FILES = \
41    ${top_srcdir}/xohtml/xohtml.css \
42    ${top_srcdir}/xohtml/xohtml.js \
43    ${top_srcdir}/xohtml/external/jquery.js \
44    ${top_srcdir}/xohtml/external/jquery.qtip.css \
45    ${top_srcdir}/xohtml/external/jquery.qtip.js
46
47upload: dist upload-docs upload-xohtml-files
48	@echo "Remember to run:"
49	@echo "        gt tag ${PACKAGE_VERSION}"
50
51upload-docs: docs upload-html
52
53upload-html:
54	@echo "Uploading html ... "
55	@-[ -d ${GH_PAGES_DIR} -a -d doc/html ] \
56		&& echo "Updating html on gh-pages ..." \
57		&& mkdir -p ${GH_PAGES_DIR_VER}/html \
58		&& cp doc/top-link.html ${GH_PAGES_DIR}/libxo.html \
59		&& cp -r doc/html/* ${GH_PAGES_DIR_VER}/html/ \
60		&& (cd ${GH_PAGES_DIR} \
61			&& git add libxo.html \
62			&& git add ${PACKAGE_VERSION}/html \
63			&& git commit -m 'new docs' \
64                               libxo.html ${PACKAGE_VERSION}/html \
65			&& git push origin gh-pages ) ; true
66
67upload-xohtml-files:
68	@echo "Uploading xohtml files ... "
69	@-[ -d ${GH_PAGES_DIR} ] \
70		&& echo "Updating xohtml files on gh-pages ..." \
71		&& mkdir -p ${GH_PAGES_DIR_VER}/xohtml \
72		&& cp ${XOHTML_FILES} ${GH_PAGES_DIR_VER}/xohtml \
73		&& (cd ${GH_PAGES_DIR} \
74			&& git add ${PACKAGE_VERSION}/xohtml \
75			&& git commit -m 'new xohtml files' \
76                               ${PACKAGE_VERSION}/xohtml \
77			&& git push origin gh-pages ) ; true
78
79pkgconfigdir=$(libdir)/pkgconfig
80pkgconfig_DATA = packaging/${PACKAGE_NAME}.pc
81
82get-wiki:
83	git clone https://github.com/Juniper/${PACKAGE_NAME}.wiki.git wiki
84
85get-gh-pages:
86	git clone https://github.com/Juniper/${PACKAGE_NAME}.git \
87		gh-pages -b gh-pages
88
89UPDATE_PACKAGE_FILE = \
90    -e "s;__SHA1__;$$SHA1;" \
91    -e "s;__SHA256__;SHA256 (textproc/${PACKAGE_FILE}) = $$SHA256;" \
92    -e "s;__SIZE__;SIZE (textproc/${PACKAGE_FILE}) = $$SIZE;"
93
94GH_PACKAGING_DIR = ${PACKAGE_VERSION}/packaging
95GH_PAGES_PACKAGE_DIR = ${GH_PAGES_DIR}/${GH_PACKAGING_DIR}
96
97packages:
98	@-[ -d ${GH_PAGES_DIR} ] && set -x \
99		&& echo "Updating packages on gh-pages ..." \
100                && mkdir -p ${GH_PAGES_DIR}/${GH_PACKAGING_DIR} \
101		&& SHA1="`openssl sha1 ${PACKAGE_FILE} | awk '{print $$2}'`" \
102		&& SHA256="`openssl sha256 ${PACKAGE_FILE} | awk '{print $$2}'`" \
103		&& SIZE="`ls -l ${PACKAGE_FILE} | awk '{print $$5}'`" \
104		&& echo "... ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.rb ..." \
105		&& sed ${UPDATE_PACKAGE_FILE} \
106			packaging/${PACKAGE_NAME}.rb.base \
107			> ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.rb \
108		&& echo "... ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.spec ..." \
109		&& cp packaging/${PACKAGE_NAME}.spec \
110			${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.spec \
111		&& (cd ${GH_PAGES_DIR} \
112			&& git add ${GH_PACKAGING_DIR} \
113			&& git add ${GH_PACKAGING_DIR}/libxo.rb \
114                                   ${GH_PACKAGING_DIR}/libxo.spec \
115			&& git commit -m 'new packaging data' \
116                               ${GH_PACKAGING_DIR} \
117			&& git push origin gh-pages ) ; true
118
119ANALYZE_DIR = ~/trash/libxo
120ANALYZE_CMD = scan-build-mp-3.6
121
122analyze:
123	${MAKE} clean
124	${ANALYZE_CMD} -o ${ANALYZE_DIR} ${MAKE}
125
126SANIFLAGS=-fno-omit-frame-pointer -g -O2
127
128sanitize-address:
129	${MAKE} clean
130	${MAKE} CFLAGS="-fsanitize=address ${SANIFLAGS}"
131	${MAKE} install
132	${MAKE} test
133
134sanitize-undefined:
135	${MAKE} clean
136	${MAKE} CFLAGS="-fsanitize=undefined ${SANIFLAGS}"
137	${MAKE} install
138	${MAKE} test
139
140sanitize-memory:
141	${MAKE} clean
142	${MAKE} CFLAGS="-fsanitize=memory ${SANIFLAGS}"
143	${MAKE} install
144	${MAKE} test
145