1 # dnsmasq is Copyright (c) 2000-2011 Simon Kelley
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.
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.
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/>.
17 BINDIR
= ${PREFIX}/sbin
18 MANDIR
= ${PREFIX}/share
/man
19 LOCALEDIR
= ${PREFIX}/share
/locale
21 PKG_CONFIG
= pkg-config
29 #################################################################
35 DBUS_CFLAGS
=`echo $(COPTS) | ../bld/pkg-wrapper HAVE_DBUS $(PKG_CONFIG) --cflags dbus-1`
36 DBUS_LIBS
= `echo $(COPTS) | ../bld/pkg-wrapper HAVE_DBUS $(PKG_CONFIG) --libs dbus-1`
37 IDN_CFLAGS
= `echo $(COPTS) | ../bld/pkg-wrapper HAVE_IDN $(PKG_CONFIG) --cflags libidn`
38 IDN_LIBS
= `echo $(COPTS) | ../bld/pkg-wrapper HAVE_IDN $(PKG_CONFIG) --libs libidn`
39 CT_CFLAGS
= `echo $(COPTS) | ../bld/pkg-wrapper HAVE_CONNTRACK $(PKG_CONFIG) --cflags libnetfilter_conntrack`
40 CT_LIBS
= `echo $(COPTS) | ../bld/pkg-wrapper HAVE_CONNTRACK $(PKG_CONFIG) --libs libnetfilter_conntrack`
41 LUA_CFLAGS
=`echo $(COPTS) | ../bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --cflags lua5.1`
42 LUA_LIBS
= `echo $(COPTS) | ../bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --libs lua5.1`
43 SUNOS_LIBS
= `if uname | grep SunOS 2>&1 >/dev/null; then echo -lsocket -lnsl -lposix4; fi`
45 OBJS
= cache.o rfc1035.o util.o option.o forward.o network.o \
46 dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o \
47 helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o
50 @cd
$(SRC
) && $(MAKE
) \
51 BUILD_CFLAGS
="$(DBUS_CFLAGS) $(IDN_CFLAGS) $(CT_CFLAGS) $(LUA_CFLAGS)" \
52 BUILD_LIBS
="$(DBUS_LIBS) $(IDN_LIBS) $(CT_LIBS) $(LUA_LIBS) $(SUNOS_LIBS)" \
53 -f ..
/Makefile dnsmasq
56 rm -f
*~
$(SRC
)/*.mo contrib
/*/*~
*/*~
$(SRC
)/*.pot
57 rm -f
$(SRC
)/*.o
$(SRC
)/dnsmasq.a
$(SRC
)/dnsmasq core
*/core
59 install : all install-common
62 $(INSTALL
) -d
$(DESTDIR
)$(BINDIR
) -d
$(DESTDIR
)$(MANDIR
)/man8
63 $(INSTALL
) -m
644 $(MAN
)/dnsmasq
.8 $(DESTDIR
)$(MANDIR
)/man8
64 $(INSTALL
) -m
755 $(SRC
)/dnsmasq
$(DESTDIR
)$(BINDIR
)
67 @cd
$(SRC
) && $(MAKE
) \
68 I18N
=-DLOCALEDIR
='\"$(LOCALEDIR)\"' \
69 BUILD_CFLAGS
="$(DBUS_CFLAGS) $(CT_CFLAGS) $(LUA_CFLAGS) `$(PKG_CONFIG) --cflags libidn`" \
70 BUILD_LIBS
="$(DBUS_LIBS) $(CT_LIBS) $(LUA_LIBS) $(SUNOS_LIBS) `$(PKG_CONFIG) --libs libidn`" \
71 -f ..
/Makefile dnsmasq
72 @cd
$(PO
); for f in
*.po
; do \
73 cd ..
/$(SRC
) && $(MAKE
) \
74 -f ..
/Makefile
$${f
%.po
}.mo
; \
77 install-i18n
: all-i18n install-common
78 cd
$(SRC
); ..
/bld
/install-mo
$(DESTDIR
)$(LOCALEDIR
) $(INSTALL
)
79 cd
$(MAN
); ..
/bld
/install-man
$(DESTDIR
)$(MANDIR
) $(INSTALL
)
82 @cd
$(SRC
) && $(MAKE
) -f ..
/Makefile dnsmasq.pot
83 @cd
$(PO
); for f in
*.po
; do \
84 echo
-n msgmerge
$$f && $(MSGMERGE
) --no-wrap
-U
$$f ..
/$(SRC
)/dnsmasq.pot
; \
88 # rules below are targets in recusive makes with cwd=$(SRC)
91 $(CC
) $(CFLAGS
) $(COPTS
) $(I18N
) $(BUILD_CFLAGS
) $(RPM_OPT_FLAGS
) -c
$<
94 $(CC
) $(LDFLAGS
) -o
$@
$(OBJS
) $(BUILD_LIBS
) $(LIBS
)
96 dnsmasq.pot
: $(OBJS
:.o
=.c
) dnsmasq.h config.h
97 $(XGETTEXT
) -d dnsmasq
--foreign-user
--omit-header
--keyword
=_
-o
$@
-i
$(OBJS
:.o
=.c
)
99 %.mo
: ..
/po
/%.po dnsmasq.pot
100 $(MSGMERGE
) -o
- ..
/po
/$*.po dnsmasq.pot |
$(MSGFMT
) -o
$*.mo
-
103 .PHONY
: all clean install install-common all-i18n install-i18n merge