1#    an - Anagram generator
2#    Copyright (C) 2012 Paul Martin <pm@debian.org>
3#
4#    This program is free software; you can redistribute it and/or modify
5#    it under the terms of the GNU General Public License as published by
6#    the Free Software Foundation; either version 2 of the License, or
7#    (at your option) any later version.
8#
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
12#    GNU General Public License for more details.
13#
14#    You should have received a copy of the GNU General Public License along
15#    with this program; if not, write to the Free Software Foundation, Inc.,
16#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
19INSTALLDIR := $(DESTDIR)$(PREFIX)/bin
20MANDIR := $(DESTDIR)$(PREFIX)/man/man6
21
22CC?=gcc
23INSTALL:=install
24
25CFLAGS += $(shell icu-config --cflags)
26CPPFLAGS += $(shell icu-config --cppflags) -D_BSD_SOURCE=1 -D_GNU_SOURCE=1
27LDFLAGS += $(shell icu-config --ldflags)
28LIBS += $(shell icu-config --ldflags-libsonly)
29
30BIN=an
31MAN=an.6
32OBJS=an.o bitfield.o malloc.o unicode.o words.o
33HEADERS=an.h bitfield.h malloc.h unicode.h words.h
34
35
36all:	$(BIN)
37
38$(OBJS): $(HEADERS)
39
40$(BIN):	$(OBJS)
41	$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
42
43$(MAN):
44
45install:	$(BIN)
46	$(BSD_INSTALL_PROGRAM) $(BIN) $(INSTALLDIR)/$(BIN)
47	$(BSD_INSTALL_MAN) $(MAN) $(MANDIR)/$(MAN)
48
49clean:
50	rm -f *.o $(BIN)
51
52distclean:	clean
53	rm -f *~
54