boxes/Makefile

120 lines
4.3 KiB
Makefile
Raw Normal View History

1999-08-14 01:45:34 +02:00
#
# boxes - Command line filter to draw/remove ASCII boxes around text
# Copyright (c) 1999-2021 Thomas Jensen and the boxes contributors
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License, version 2, as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1999-08-14 01:45:34 +02:00
#____________________________________________________________________________
#============================================================================
# The following line (GLOBALCONF) is the only line you should need to edit!
GLOBALCONF = /usr/share/boxes
2021-02-13 10:49:15 +01:00
GIT_STATUS = ($(shell git describe --dirty --always))
2021-02-14 21:55:55 +01:00
BVERSION = 2.0.0
2019-02-20 22:28:07 +01:00
ALL_FILES = LICENSE README.md README.Win32.md boxes-config
DOC_FILES = doc/boxes.1 doc/boxes.el
PKG_NAME = boxes-$(BVERSION)
WIN_PCRE2_VERSION = 10.36
WIN_PCRE2_DIR = pcre2-$(WIN_PCRE2_VERSION)
.PHONY: clean build win32 debug win32.debug infomsg replaceinfos test package win32.package package_common
2019-03-28 21:57:56 +01:00
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
build debug: infomsg replaceinfos
$(MAKE) -C src BOXES_PLATFORM=unix $@
1999-08-14 01:45:34 +02:00
win32: infomsg replaceinfos
$(MAKE) -C src BOXES_PLATFORM=win32 C_INCLUDE_PATH=../$(WIN_PCRE2_DIR)/src LDFLAGS=-L../$(WIN_PCRE2_DIR)/.libs build
1999-08-14 01:45:34 +02:00
win32.debug: infomsg replaceinfos
$(MAKE) -C src BOXES_PLATFORM=win32 C_INCLUDE_PATH=../$(WIN_PCRE2_DIR)/src LDFLAGS=-L../$(WIN_PCRE2_DIR)/.libs debug
win32.pcre:
# build the pcre2 dependency (only needed on Windows MinGW)
curl -LO https://ftp.pcre.org/pub/pcre/$(WIN_PCRE2_DIR).tar.gz
tar xfz $(WIN_PCRE2_DIR).tar.gz
cd $(WIN_PCRE2_DIR)
./configure --disable-pcre2-8 --disable-pcre2-16 --enable-pcre2-32 --disable-shared --enable-never-backslash-C --enable-newline-is-anycrlf
$(MAKE)
1999-08-14 01:45:34 +02:00
2019-03-28 21:57:56 +01:00
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
infomsg:
@echo "| For compilation info please refer to the boxes compilation FAQ"
2019-02-14 21:41:11 +01:00
@echo "| at https://boxes.thomasjensen.com/docs/faq.html#q5"
replaceinfos: src/boxes.h doc/boxes.1
src/boxes.h: src/boxes.h.in src/regulex.h src/shape.h Makefile
2019-02-20 22:28:07 +01:00
sed -e 's/--BVERSION--/$(BVERSION) $(GIT_STATUS)/; s/--GLOBALCONF--/$(subst /,\/,$(GLOBALCONF))/' src/boxes.h.in > src/boxes.h
doc/boxes.1: doc/boxes.1.in Makefile
sed -e 's/--BVERSION--/$(BVERSION)/; s/--GLOBALCONF--/$(subst /,\/,$(GLOBALCONF))/' doc/boxes.1.in > doc/boxes.1
doc/boxes.1.html: doc/boxes.1
cat doc/boxes.1 | groff -mandoc -Thtml > doc/boxes.1.raw.html
sed -E -e 's/&lt;URL:([^&]+)&gt;/<a href=\1>\1<\/a>/g' < doc/boxes.1.raw.html > doc/boxes.1.html
rm -f doc/boxes.1.raw.html
2019-03-28 21:57:56 +01:00
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$(PKG_NAME).tar.gz:
mkdir -p $(PKG_NAME)/doc
cp $(ALL_FILES) $(PKG_NAME)
cp $(DOC_FILES) $(PKG_NAME)/doc
$(MAKE) -C src PKG_NAME=$(PKG_NAME) BOXES_PLATFORM=$(BOXES_PLATFORM) flags_$(BOXES_PLATFORM) package
if which gtar >/dev/null 2>&1 ; then gtar cfvz $(PKG_NAME).tar.gz $(PKG_NAME)/* ; \
else tar cfvz $(PKG_NAME).tar.gz $(PKG_NAME)/* ; fi
rm -rf $(PKG_NAME)/
package: build
$(MAKE) BOXES_PLATFORM=unix $(PKG_NAME).tar.gz
win32.package: win32
$(MAKE) BOXES_PLATFORM=win32 $(PKG_NAME).tar.gz
2019-03-28 21:57:56 +01:00
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
choco: tools/LICENSE.txt tools/boxes.cfg tools/boxes.exe
2019-03-28 21:57:56 +01:00
choco pack --version=$(BVERSION)
tools/LICENSE.txt: LICENSE
cp LICENSE tools/LICENSE.txt
tools/boxes.cfg: boxes-config
cp boxes-config tools/boxes.cfg
tools/boxes.exe: src/boxes.exe
cp src/boxes.exe tools/
src/boxes.exe: win32
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
clean:
rm -f src/boxes.h tools/boxes.cfg tools/LICENSE.txt tools/boxes.exe tools/README*.md boxes.portable.*.nupkg
rm -f doc/boxes.1 doc/boxes.1.raw.html doc/boxes.1.html
$(MAKE) -C src clean
2019-03-28 21:57:56 +01:00
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2014-09-23 23:50:36 +02:00
test:
cd test; ./testrunner.sh -suite
1999-08-14 01:45:34 +02:00
#EOF