1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
# Copyright (C) 2011,2013,2017 G.P. Halkes
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, 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, see <http://www.gnu.org/licenses/>.
.POSIX:
# C-compiler flags
CFLAGS=-O2
# Configuration flags and libraries. Include flags here to compile against the
# (n)curses or libtinfo, libunistring and libtranscript libraries.
# If your system does not provide strdup, remove -DHAS_STRDUP
CONFIGFLAGS=-DHAS_STRDUP
CONFIGLIBS=
# Gettext configuration
# GETTEXTFLAGS should contain -DUSE_GETTEXT to enable gettext translations
# GETTEXTLIBS should contain all link flags to allow linking with gettext, if
# it has been enabled. The GNU libc already contains the gettext library, so
# there is no need to add any flags. Otherwise, -lintl is usually required, and
# sometimes -liconv as well.
# LOCALEDIR: the directory where the locale dependant files should be installed.
# LINGUAS: translations to be installed. Look in po directory for available
# translations.
GETTEXTFLAGS=
GETTEXTLIBS=
LOCALEDIR=$(prefix)/share/locale
LINGUAS=
# The libtool executable
LIBTOOL=libtool
# Installation prefix
prefix=/usr/local
# Install program to use (should be BSD install compatible)
INSTALL=install
# Miscelaneous install paths
libdir=$(prefix)/lib
docdir=$(prefix)/share/doc/libt3window
includedir=$(prefix)/include
pkgconfigdir=$(libdir)/pkgconfig
SILENCELT=--silent
SILENTCCLT=@echo '[CCLT]' $< ;
SILENTLDLT=@echo '[LDLT]' $@ ;
OBJECTS=src/window.lo src/misc.lo src/log.lo src/terminal.lo src/input.lo src/curses_interface.lo src/window_paint.lo src/utf8.lo src/generated/chardata.lo src/convert_output.lo src/terminal_init.lo src/window_shared.lo
all: src/libt3window.la
.PHONY: all clean dist-clean distclean install uninstall
.SUFFIXES: .c .o .lo .la .mo .po
.IGNORE: uninstall
clean:
rm -rf src/*.lo src/generated/*.lo src/.libs src/generated/.libs src/libt3window.la
dist-clean: clean
rm -rf Makefile config.log libt3window.pc .Makefile* .config*
distclean: dist-clean
.c.lo:
$(SILENTCCLT) $(LIBTOOL) $(SILENCELT) --mode=compile --tag=CC $(CC) -shared \
$(CFLAGS) $(CONFIGFLAGS) $(GETTEXTFLAGS) -DLOCALEDIR=\"$(LOCALEDIR)\" \
-Isrc -DT3_WINDOW_BUILD_DSO -D_T3_WINDOW_INTERNAL -c -o $@ $<
src/libt3window.la: $(OBJECTS)
$(SILENTLDLT) $(LIBTOOL) $(SILENCELT) --mode=link --tag=CC $(CC) -shared \
-version-info 0:0:0 $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) \
$(LDLIBS) $(CONFIGLIBS) $(GETTEXTLIBS) -rpath $(libdir)
# Macros to make DESTDIR support more readable
_libdir=$(DESTDIR)$(libdir)
_docdir=$(DESTDIR)$(docdir)
_includedir=$(DESTDIR)$(includedir)
_pkgconfigdir=$(DESTDIR)$(pkgconfigdir)
_LOCALEDIR=$(DESTDIR)$(LOCALEDIR)
install: all
$(INSTALL) -d $(_libdir)
$(LIBTOOL) --mode=install $(INSTALL) -s -m0644 src/libt3window.la $(_libdir)
chmod 0644 $(_libdir)/libt3window.la
$(INSTALL) -d $(_includedir)/t3/window/t3window
$(INSTALL) -m0644 src/window.h src/window_api.h src/window_errors.h src/terminal.h src/utf8.h $(_includedir)/t3/window/t3window
$(INSTALL) -d $(_docdir)
$(INSTALL) -m0644 COPYING README Changelog $(_docdir)
$(INSTALL) -d $(_pkgconfigdir)
$(INSTALL) -m0644 libt3window.pc $(_pkgconfigdir)
uninstall:
$(LIBTOOL) --mode=uninstall rm $(_libdir)/libt3window.la
rm -rf $(_includedir)/t3/window
rm -rf $(_docdir)
rm -f $(_pkgconfigdir)/libt3window.pc
# LIBVERSION=0
|