]>
Commit | Line | Data |
---|---|---|
73a08a24 | 1 | # dnsmasq is Copyright (c) 2000-2009 Simon Kelley |
824af85b SK |
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 | # | |
73a08a24 SK |
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/>. | |
824af85b SK |
15 | |
16 | PREFIX = /usr/local | |
17 | BINDIR = ${PREFIX}/sbin | |
18 | MANDIR = ${PREFIX}/share/man | |
19 | LOCALEDIR = ${PREFIX}/share/locale | |
9e4abcb5 SK |
20 | |
21 | SRC = src | |
b8187c80 SK |
22 | PO = po |
23 | MAN = man | |
9e4abcb5 | 24 | |
824af85b | 25 | PKG_CONFIG = pkg-config |
824af85b | 26 | INSTALL = install |
1f15b81d SK |
27 | MSGMERGE = msgmerge |
28 | MSGFMT = msgfmt | |
29 | XGETTEXT = xgettext | |
824af85b | 30 | |
1f15b81d SK |
31 | ################################################################# |
32 | ||
33 | DNSMASQ_CFLAGS=`echo $(COPTS) | ../bld/pkg-wrapper HAVE_DBUS $(PKG_CONFIG) --cflags dbus-1` | |
34 | DNSMASQ_LIBS= `echo $(COPTS) | ../bld/pkg-wrapper HAVE_DBUS $(PKG_CONFIG) --libs dbus-1` | |
35 | SUNOS_LIBS= `if uname | grep SunOS 2>&1 >/dev/null; then echo -lsocket -lnsl -lposix4; fi` | |
9e4abcb5 | 36 | |
208b65c5 SK |
37 | all : dnsmasq |
38 | ||
39 | dnsmasq : | |
1f15b81d SK |
40 | @cd $(SRC) && $(MAKE) \ |
41 | DNSMASQ_CFLAGS="$(DNSMASQ_CFLAGS)" \ | |
42 | DNSMASQ_LIBS="$(DNSMASQ_LIBS) $(SUNOS_LIBS)" \ | |
824af85b | 43 | -f ../bld/Makefile dnsmasq |
9e4abcb5 SK |
44 | |
45 | clean : | |
b8187c80 | 46 | rm -f *~ $(SRC)/*.mo contrib/*/*~ */*~ $(SRC)/*.pot |
208b65c5 | 47 | rm -f $(SRC)/*.o $(SRC)/dnsmasq.a $(SRC)/dnsmasq core */core |
9e4abcb5 | 48 | |
b8187c80 SK |
49 | install : all install-common |
50 | ||
51 | install-common : | |
824af85b SK |
52 | $(INSTALL) -d $(DESTDIR)$(BINDIR) -d $(DESTDIR)$(MANDIR)/man8 |
53 | $(INSTALL) -m 644 $(MAN)/dnsmasq.8 $(DESTDIR)$(MANDIR)/man8 | |
54 | $(INSTALL) -m 755 $(SRC)/dnsmasq $(DESTDIR)$(BINDIR) | |
9e4abcb5 | 55 | |
b8187c80 | 56 | all-i18n : |
1f15b81d | 57 | @cd $(SRC) && $(MAKE) \ |
824af85b | 58 | I18N=-DLOCALEDIR='\"$(LOCALEDIR)\"' \ |
1f15b81d SK |
59 | DNSMASQ_CFLAGS="$(DNSMASQ_CFLAGS) `$(PKG_CONFIG) --cflags libidn`" \ |
60 | DNSMASQ_LIBS="$(DNSMASQ_LIBS) $(SUNOS_LIBS) `$(PKG_CONFIG) --libs libidn`" \ | |
824af85b | 61 | -f ../bld/Makefile dnsmasq |
1f15b81d SK |
62 | @cd $(PO); for f in *.po; do \ |
63 | cd ../$(SRC) && $(MAKE) \ | |
64 | MSGMERGE=$(MSGMERGE) MSGFMT=$(MSGFMT) XGETTEXT=$(XGETTEXT) \ | |
65 | -f ../bld/Makefile $${f%.po}.mo; \ | |
b8187c80 SK |
66 | done |
67 | ||
68 | install-i18n : all-i18n install-common | |
1f15b81d SK |
69 | cd $(SRC); ../bld/install-mo $(DESTDIR)$(LOCALEDIR) $(INSTALL) |
70 | cd $(MAN); ../bld/install-man $(DESTDIR)$(MANDIR) $(INSTALL) | |
b8187c80 SK |
71 | |
72 | merge : | |
1f15b81d SK |
73 | @cd $(SRC) && $(MAKE) XGETTEXT=$(XGETTEXT) -f ../bld/Makefile dnsmasq.pot |
74 | @cd $(PO); for f in *.po; do \ | |
75 | echo -n msgmerge $$f && $(MSGMERGE) --no-wrap -U $$f ../$(SRC)/dnsmasq.pot; \ | |
b8187c80 | 76 | done |
9e4abcb5 SK |
77 | |
78 |