blob: a647cd8ecc3c7ff3d6248abf9306015c364db111 [file] [log] [blame]
Simon Kelley824af852008-02-12 20:43:05 +00001# 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
16PREFIX = /usr/local
17BINDIR = ${PREFIX}/sbin
18MANDIR = ${PREFIX}/share/man
19LOCALEDIR = ${PREFIX}/share/locale
Simon Kelley9e4abcb2004-01-22 19:47:41 +000020
21SRC = src
Simon Kelleyb8187c82005-11-26 21:46:27 +000022PO = po
23MAN = man
Simon Kelley9e4abcb2004-01-22 19:47:41 +000024
Simon Kelley824af852008-02-12 20:43:05 +000025PKG_CONFIG = pkg-config
26AWK = nawk
27INSTALL = install
28
29DBUS_MINOR=" `echo $(COPTS) | ../bld/pkg-wrapper $(PKG_CONFIG) --modversion dbus-1 | $(AWK) -F . -- '{ if ($$(NF-1)) print \"-DDBUS_MINOR=\"$$(NF-1) }'`"
30DBUS_CFLAGS="`echo $(COPTS) | ../bld/pkg-wrapper $(PKG_CONFIG) --cflags dbus-1`"
31DBUS_LIBS=" `echo $(COPTS) | ../bld/pkg-wrapper $(PKG_CONFIG) --libs dbus-1`"
32SUNOS_VER=" `if uname | grep SunOS 2>&1 >/dev/null; then uname -r | $(AWK) -F . -- '{ print \"-DSUNOS_VER=\"$$2 }'; fi`"
33SUNOS_LIBS=" `if uname | grep SunOS 2>&1 >/dev/null; then echo -lsocket -lnsl -lposix4; fi `"
Simon Kelley9e4abcb2004-01-22 19:47:41 +000034
Simon Kelley208b65c2006-08-05 21:41:37 +010035all : dnsmasq
36
37dnsmasq :
Simon Kelley824af852008-02-12 20:43:05 +000038 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 Kelley9e4abcb2004-01-22 19:47:41 +000045
46clean :
Simon Kelleyb8187c82005-11-26 21:46:27 +000047 rm -f *~ $(SRC)/*.mo contrib/*/*~ */*~ $(SRC)/*.pot
Simon Kelley208b65c2006-08-05 21:41:37 +010048 rm -f $(SRC)/*.o $(SRC)/dnsmasq.a $(SRC)/dnsmasq core */core
Simon Kelley9e4abcb2004-01-22 19:47:41 +000049
Simon Kelleyb8187c82005-11-26 21:46:27 +000050install : all install-common
51
52install-common :
Simon Kelley824af852008-02-12 20:43:05 +000053 $(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 Kelley9e4abcb2004-01-22 19:47:41 +000056
Simon Kelleyb8187c82005-11-26 21:46:27 +000057all-i18n :
Simon Kelley824af852008-02-12 20:43:05 +000058 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 Kelleyb8187c82005-11-26 21:46:27 +000066 cd $(PO); for f in *.po; do \
Simon Kelley824af852008-02-12 20:43:05 +000067 cd ../$(SRC) && $(MAKE) -f ../bld/Makefile $${f%.po}.mo; \
Simon Kelleyb8187c82005-11-26 21:46:27 +000068 done
Simon Kelley9e4abcb2004-01-22 19:47:41 +000069
Simon Kelleyb8187c82005-11-26 21:46:27 +000070install-i18n : all-i18n install-common
71 cd $(SRC); ../bld/install-mo $(DESTDIR)$(LOCALEDIR)
72 cd $(MAN); ../bld/install-man $(DESTDIR)$(MANDIR)
73
74merge :
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 Kelley9e4abcb2004-01-22 19:47:41 +000079
80