1# Makefile for librote
2#
3# Copyright (c) 2004 Bruno T. C. de Oliveira
4#
5# LICENSE INFORMATION:
6# This program is free software; you can redistribute it and/or
7# modify it under the terms of the GNU General Public
8# License as published by the Free Software Foundation; either
9# version 2 of the License, or (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14# General Public License for more details.
15#
16# You should have received a copy of the GNU General Public
17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19# Copyright (c) 2002 Bruno T. C. de Oliveira
20
21SOURCES=$(wildcard *.c)
22HEADERS=$(wildcard *.h)
23
24OBJECTS=$(patsubst %.c,%.o,$(SOURCES))
25
26ROTE_VERSION=@PACKAGE_VERSION@
27ROTE_SONAME=librote.so.0
28
29CC=@CC@
30CFLAGS=@CFLAGS@ -Wall -fPIC
31LIBS=@LIBS@
32LDFLAGS=@LDFLAGS@
33prefix=@prefix@
34exec_prefix=@exec_prefix@
35libdir=@libdir@
36includedir=@includedir@
37bindir=@bindir@
38
39all: librote.so.$(ROTE_VERSION)
40
41install: all
42	mkdir -p $(DESTDIR)$(includedir)/rote
43	rm -f $(DESTDIR)$(includedir)/rote/*.h
44	cp rote.h $(DESTDIR)$(includedir)/rote
45	mkdir -p $(DESTDIR)$(libdir)
46	cp librote.so.$(ROTE_VERSION) $(DESTDIR)$(libdir)
47	cd $(DESTDIR)$(libdir) && ln -sf librote.so.$(ROTE_VERSION) librote.so
48	cd $(DESTDIR)$(libdir) && ln -sf librote.so.$(ROTE_VERSION) $(ROTE_SONAME)
49	chmod 755 rote-config
50	mkdir -p $(DESTDIR)$(bindir)
51	cp -p rote-config $(DESTDIR)$(bindir)
52	@echo "-----------------------------------------------------------"
53	@echo "ROTE - Our Own Terminal Emulation Library v$(ROTE_VERSION)"
54	@echo
55	@echo "Include files installed at: $(DESTDIR)$(includedir)"
56	@echo "Library files installed at: $(DESTDIR)$(libdir)"
57	@echo "rote-config executable    : $(DESTDIR)$(bindir)/rote-config"
58	@echo
59	@echo "To find out what compiler arguments you should use to"
60	@echo "compile programs that use rote, use the rote-config"
61	@echo "program (make sure $(DESTDIR)$(bindir) is in your path)."
62	@echo "-----------------------------------------------------------"
63
64librote.so.$(ROTE_VERSION): $(OBJECTS)
65	$(CC) $(CFLAGS) -shared -o $@ -Wl,-soname=$(ROTE_SONAME) $(OBJECTS) $(LDFLAGS) $(LIBS)
66
67.depends: $(SOURCES) $(HEADERS)
68	$(CC) $(CFLAGS) -MM $(SOURCES) >.depends
69
70-include .depends
71
72clean:
73	rm -f *.o .depends librote.so.*
74
75pristine: clean
76	rm -rf autom4te.cache configure config.status config.log Makefile rote-config
77
78.PHONY: clean all install pristine
79
80