Simon Kelley | 824af85 | 2008-02-12 20:43:05 +0000 | [diff] [blame^] | 1 | # dnsmasq is Copyright (c) 2000-2007 Simon Kelley |
| 2 | # |
| 3 | # This program is free software; you can redistribute it and/or modify |
| 4 | # it under the terms of the GNU General Public License as published by |
| 5 | # the Free Software Foundation; version 2 dated June, 1991, or |
| 6 | # (at your option) version 3 dated 29 June, 2007. |
| 7 | # |
| 8 | # This program is distributed in the hope that it will be useful, |
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | # GNU General Public License for more details. |
| 12 | # |
| 13 | # You should have received a copy of the GNU General Public License |
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | |
| 16 | PREFIX = /usr/local |
| 17 | BINDIR = ${PREFIX}/sbin |
| 18 | MANDIR = ${PREFIX}/share/man |
| 19 | LOCALEDIR = ${PREFIX}/share/locale |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 20 | |
| 21 | SRC = src |
Simon Kelley | b8187c8 | 2005-11-26 21:46:27 +0000 | [diff] [blame] | 22 | PO = po |
| 23 | MAN = man |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 24 | |
Simon Kelley | 824af85 | 2008-02-12 20:43:05 +0000 | [diff] [blame^] | 25 | PKG_CONFIG = pkg-config |
| 26 | AWK = nawk |
| 27 | INSTALL = install |
| 28 | |
| 29 | DBUS_MINOR=" `echo $(COPTS) | ../bld/pkg-wrapper $(PKG_CONFIG) --modversion dbus-1 | $(AWK) -F . -- '{ if ($$(NF-1)) print \"-DDBUS_MINOR=\"$$(NF-1) }'`" |
| 30 | DBUS_CFLAGS="`echo $(COPTS) | ../bld/pkg-wrapper $(PKG_CONFIG) --cflags dbus-1`" |
| 31 | DBUS_LIBS=" `echo $(COPTS) | ../bld/pkg-wrapper $(PKG_CONFIG) --libs dbus-1`" |
| 32 | SUNOS_VER=" `if uname | grep SunOS 2>&1 >/dev/null; then uname -r | $(AWK) -F . -- '{ print \"-DSUNOS_VER=\"$$2 }'; fi`" |
| 33 | SUNOS_LIBS=" `if uname | grep SunOS 2>&1 >/dev/null; then echo -lsocket -lnsl -lposix4; fi `" |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 34 | |
Simon Kelley | 208b65c | 2006-08-05 21:41:37 +0100 | [diff] [blame] | 35 | all : dnsmasq |
| 36 | |
| 37 | dnsmasq : |
Simon Kelley | 824af85 | 2008-02-12 20:43:05 +0000 | [diff] [blame^] | 38 | cd $(SRC) && $(MAKE) \ |
| 39 | DBUS_MINOR=$(DBUS_MINOR) \ |
| 40 | DBUS_CFLAGS=$(DBUS_CFLAGS) \ |
| 41 | DBUS_LIBS=$(DBUS_LIBS) \ |
| 42 | SUNOS_LIBS=$(SUNOS_LIBS) \ |
| 43 | SUNOS_VER=$(SUNOS_VER) \ |
| 44 | -f ../bld/Makefile dnsmasq |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 45 | |
| 46 | clean : |
Simon Kelley | b8187c8 | 2005-11-26 21:46:27 +0000 | [diff] [blame] | 47 | rm -f *~ $(SRC)/*.mo contrib/*/*~ */*~ $(SRC)/*.pot |
Simon Kelley | 208b65c | 2006-08-05 21:41:37 +0100 | [diff] [blame] | 48 | rm -f $(SRC)/*.o $(SRC)/dnsmasq.a $(SRC)/dnsmasq core */core |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 49 | |
Simon Kelley | b8187c8 | 2005-11-26 21:46:27 +0000 | [diff] [blame] | 50 | install : all install-common |
| 51 | |
| 52 | install-common : |
Simon Kelley | 824af85 | 2008-02-12 20:43:05 +0000 | [diff] [blame^] | 53 | $(INSTALL) -d $(DESTDIR)$(BINDIR) -d $(DESTDIR)$(MANDIR)/man8 |
| 54 | $(INSTALL) -m 644 $(MAN)/dnsmasq.8 $(DESTDIR)$(MANDIR)/man8 |
| 55 | $(INSTALL) -m 755 $(SRC)/dnsmasq $(DESTDIR)$(BINDIR) |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 56 | |
Simon Kelley | b8187c8 | 2005-11-26 21:46:27 +0000 | [diff] [blame] | 57 | all-i18n : |
Simon Kelley | 824af85 | 2008-02-12 20:43:05 +0000 | [diff] [blame^] | 58 | cd $(SRC) && $(MAKE) \ |
| 59 | I18N=-DLOCALEDIR='\"$(LOCALEDIR)\"' \ |
| 60 | DBUS_MINOR=$(DBUS_MINOR) \ |
| 61 | DBUS_CFLAGS=$(DBUS_CFLAGS) \ |
| 62 | DBUS_LIBS=$(DBUS_LIBS) \ |
| 63 | SUNOS_LIBS=$(SUNOS_LIBS) \ |
| 64 | SUNOS_VER=$(SUNOS_VER) \ |
| 65 | -f ../bld/Makefile dnsmasq |
Simon Kelley | b8187c8 | 2005-11-26 21:46:27 +0000 | [diff] [blame] | 66 | cd $(PO); for f in *.po; do \ |
Simon Kelley | 824af85 | 2008-02-12 20:43:05 +0000 | [diff] [blame^] | 67 | cd ../$(SRC) && $(MAKE) -f ../bld/Makefile $${f%.po}.mo; \ |
Simon Kelley | b8187c8 | 2005-11-26 21:46:27 +0000 | [diff] [blame] | 68 | done |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 69 | |
Simon Kelley | b8187c8 | 2005-11-26 21:46:27 +0000 | [diff] [blame] | 70 | install-i18n : all-i18n install-common |
| 71 | cd $(SRC); ../bld/install-mo $(DESTDIR)$(LOCALEDIR) |
| 72 | cd $(MAN); ../bld/install-man $(DESTDIR)$(MANDIR) |
| 73 | |
| 74 | merge : |
| 75 | $(MAKE) I18N=-DLOCALEDIR='\"$(LOCALEDIR)\"' -f ../bld/Makefile -C $(SRC) dnsmasq.pot |
| 76 | cd $(PO); for f in *.po; do \ |
| 77 | msgmerge -U $$f ../$(SRC)/dnsmasq.pot; \ |
| 78 | done |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 79 | |
| 80 | |