| 1 |
# an - Anagram generator |
| 2 |
# Copyright (C) 2012 Paul Martin <[email protected]> |
| 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 |
|
| 19 |
INSTALLDIR := $(DESTDIR)/usr/games |
| 20 |
MANDIR := $(DESTDIR)/usr/share/man/man6 |
| 21 |
|
| 22 |
CC:=gcc |
| 23 |
INSTALL:=install |
| 24 |
|
| 25 |
CFLAGS += $(shell icu-config --cflags) |
| 26 |
CPPFLAGS += $(shell icu-config --cppflags) -D_BSD_SOURCE=1 -D_GNU_SOURCE=1 |
| 27 |
LDFLAGS += $(shell icu-config --ldflags) |
| 28 |
LIBS += $(shell icu-config --ldflags-libsonly) |
| 29 |
|
| 30 |
BIN=an |
| 31 |
MAN=an.6 |
| 32 |
OBJS=an.o bitfield.o malloc.o unicode.o words.o |
| 33 |
HEADERS=an.h bitfield.h malloc.h unicode.h words.h |
| 34 |
|
| 35 |
|
| 36 |
all: $(BIN) |
| 37 |
|
| 38 |
$(OBJS): $(HEADERS) |
| 39 |
|
| 40 |
$(BIN): $(OBJS) |
| 41 |
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ |
| 42 |
|
| 43 |
$(MAN): |
| 44 |
|
| 45 |
install: $(BIN) |
| 46 |
$(INSTALL) -m 755 $(BIN) $(INSTALLDIR)/$(BIN) |
| 47 |
$(INSTALL) -m 644 $(MAN) $(MANDIR)/$(MAN) |
| 48 |
|
| 49 |
clean: |
| 50 |
rm -f *.o $(BIN) |
| 51 |
|
| 52 |
distclean: clean |
| 53 |
rm -f *~ |