Pathnames detection generalized, no longer 'configuration' specific.
[udpgate.git] / src / Makefile.am
1 # $Id$
2 # automake source for UDP Gateway Makefile
3 # Copyright (C) 2004 Jan Kratochvil <project-udpgate@jankratochvil.net>
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; exactly version 2 of June 1991 is required
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
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18
19 include $(top_srcdir)/Makefile-head.am
20
21 GLADE_IN= \
22                 ui-gnome.glade \
23                 ui-gnome.gladep
24
25 GLADE_OUT= \
26                 ui-gnome-interface.c \
27                 ui-gnome-interface.h \
28                 ui-gnome-callbacks.h \
29                 ui-gnome-support.c \
30                 ui-gnome-support.h
31
32 if HAVE_GNOME
33 GNOME_SRCS= \
34                 ui-gnome.c \
35                 ui-gnome.h \
36                 $(GLADE_OUT)
37 endif
38
39 if ENABLE_BUNDLE
40 BUNDLE_SRCS= \
41                 bundle.c \
42                 bundle.h \
43                 bundle-util.c \
44                 bundle-util.h \
45                 no-gmodule.c
46 endif
47
48 EXTRA_DIST+= \
49                 bundle.pl
50
51 if HAVE_PERL
52 # FIXME: GNU make(1) dependency by $(addprefix ...)
53 po_files=$(addprefix $(top_builddir)/$(POSUB)/,$(CATALOGS))
54 bundle_files=$(top_srcdir)/init.d/$(PACKAGE).init $(po_files)
55 bundle.c: bundle.pl $(bundle_files)
56         $(PERL) bundle.pl $(bundle_files) >$@
57
58 $(po_files):
59         $(MAKE) -C $(top_builddir)/$(POSUB)
60
61 endif
62
63 udpgate_SOURCES= \
64                 configuration.c \
65                 configuration.h \
66                 main.c \
67                 main.h \
68                 network.c \
69                 network.h \
70                 packet.c \
71                 packet.h \
72                 pathname.c \
73                 pathname.h \
74                 startup-lsb.c \
75                 startup-lsb.h \
76                 startup-chkconfig.c \
77                 startup-chkconfig.h \
78                 startup-debian.c \
79                 startup-debian.h \
80                 startup.c \
81                 startup.h \
82                 static-startup.c \
83                 static-startup.h \
84                 ui-line.c \
85                 ui-line.h \
86                 $(GNOME_SRCS) \
87                 $(BUNDLE_SRCS)
88
89 EXTRA_DIST+= \
90                 $(GLADE_IN)
91
92 udpgate_CFLAGS= \
93                 -DSYSCONFDIR="$(sysconfdir)" \
94                 -DLOCALSTATEDIR="$(localstatedir)" \
95                 -DCATALOGS="$(CATALOGS)"
96 udpgate_LDADD=
97
98 udpgate-ui-gnome-interface.$(OBJEXT): ui-gnome-callbacks.h
99
100 if HAVE_GLADE_WRITESOURCE
101 # touch(1) as 'ui-gnome-callbacks.h' are not overwritten if not changed:
102 $(GLADE_OUT): $(GLADE_IN)
103         sh $(top_srcdir)/macros/glade-w.sh $<
104         @touch ui-gnome-callbacks.h
105
106 endif
107
108 CLEANFILES+= \
109                 ui-gnome-callbacks.c \
110                 ui-gnome.glade.bak \
111                 ui-gnome.gladep.bak
112
113 udpgate_LDADD+=$(POPT_LIBS) $(INTLLIBS)
114
115 # FIXME: /usr/include/gtk-2.0/gtk/gtkitemfactory.h:51: warning: function declaration isn't a prototype
116 # /* We use () here to mean unspecified arguments. This is deprecated
117 #  * as of C99, but we can't change it without breaking compatibility.
118 #  * (Note that if we are included from a C++ program () will mean
119 #  * (void) so an explicit cast will be needed.)
120 #  */
121 # typedef void  (*GtkItemFactoryCallback)  ();
122 # We cannot put '-Wno-strict-prototypes' as we get always overriden by $(CFLAGS) !
123 udpgate_CFLAGS+=$(GNOMEUI_CFLAGS)
124 udpgate_LDADD +=$(GNOMEUI_LIBS)
125
126 bin_PROGRAMS+=udpgate
127
128 EXTRA_DIST+=udpgate.pod.pl.in
129 CLEANFILES+=udpgate.pod udpgate.1
130 if ENABLE_MAN_PAGES
131 udpgate_man_cond=udpgate.1
132 endif
133 man_MANS=$(udpgate_man_cond)