Proper dependencies of mandatory/optional bundle rebuild whether Perl is found.
[udpgate.git] / src / Makefile.am
index dfba9e5..fdadb7d 100644 (file)
@@ -38,9 +38,8 @@ endif
 
 if ENABLE_BUNDLE
 
-nodist_udpgate_SOURCES=bundle.c
-
 BUNDLE_SRCS= \
+               bundle.c \
                bundle.h \
                bundle-util.c \
                bundle-util.h
@@ -48,12 +47,18 @@ BUNDLE_SRCS= \
 EXTRA_DIST+= \
                bundle.pl
 
+if HAVE_PERL
 # FIXME: GNU make(1) dependency by $(addprefix ...)
-bundle_files=$(top_srcdir)/init.d/$(PACKAGE).init $(addprefix $(top_builddir)/$(POSUB)/,$(CATALOGS))
+po_files=$(addprefix $(top_builddir)/$(POSUB)/,$(CATALOGS))
+bundle_files=$(top_srcdir)/init.d/$(PACKAGE).init $(po_files)
 bundle.c: bundle.pl $(bundle_files)
-               $(PERL) bundle.pl $(bundle_files) >$@
+       $(PERL) bundle.pl $(bundle_files) >$@
+
+$(po_files):
+       $(MAKE) -C $(top_builddir)/$(POSUB)
 
 endif
+endif
 
 udpgate_SOURCES= \
                configuration.c \