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