1 # Makefile for libmadtty
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public
6 # License as published by the Free Software Foundation; either
7 # version 2 of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
14 # You should have received a copy of the GNU General Public
15 # License along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # Copyright © 2002-2004 Bruno T. C. de Oliveira
19 # Copyright © 2006 Pierre Habouzit
21 SOURCES=$(wildcard *.c)
22 HEADERS=$(wildcard *.h)
24 OBJECTS=$(patsubst %.c,%.o,$(SOURCES))
26 MADTTY_VERSION=@PACKAGE_VERSION@
27 MADTTY_SONAME=libmadtty.so.0
30 CFLAGS=@CFLAGS@ -Wall -fPIC
34 exec_prefix=@exec_prefix@
36 includedir=@includedir@
39 all: libmadtty.so.$(MADTTY_VERSION)
42 mkdir -p $(DESTDIR)$(includedir)/madtty
43 rm -f $(DESTDIR)$(includedir)/madtty/*.h
44 cp madtty.h $(DESTDIR)$(includedir)/madtty
45 mkdir -p $(DESTDIR)$(libdir)
46 cp libmadtty.so.$(MADTTY_VERSION) $(DESTDIR)$(libdir)
47 cd $(DESTDIR)$(libdir) && ln -sf libmadtty.so.$(MADTTY_VERSION) libmadtty.so
48 cd $(DESTDIR)$(libdir) && ln -sf libmadtty.so.$(MADTTY_VERSION) $(MADTTY_SONAME)
49 mkdir -p $(DESTDIR)$(libdir)/pkgconfig
50 cp madtty.pc $(DESTDIR)$(libdir)/pkgconfig
51 @echo "-----------------------------------------------------------"
52 @echo "MADTTY - the Mad tty Emulation Library v$(MADTTY_VERSION)"
54 @echo "Include files installed at: $(DESTDIR)$(includedir)"
55 @echo "Library files installed at: $(DESTDIR)$(libdir)"
56 @echo "-----------------------------------------------------------"
58 libmadtty.so.$(MADTTY_VERSION): $(OBJECTS)
59 $(CC) $(CFLAGS) -shared -o $@ -Wl,-soname=$(MADTTY_SONAME) $(OBJECTS) $(LDFLAGS) $(LIBS)
61 .depends: $(SOURCES) $(HEADERS)
62 $(CC) $(CFLAGS) -MM $(SOURCES) >.depends
67 rm -f *.o .depends libmadtty.so.*
70 rm -rf autom4te.cache configure config.status config.log Makefile madtty.pc
72 .PHONY: clean all install pristine