Bläddra i källkod

pkgconfig: correct and clean up Makefile.am

* pkgconfig/Makefile.am: Factor, add missing deps.
(pkgconf_LIBS): Remove unused var.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2137 fd59a12c-fef9-0310-b244-a6a79926bd2f
Jim Meyering 17 år sedan
förälder
incheckning
17a3979ba9
1 ändrade filer med 16 tillägg och 13 borttagningar
  1. 16 13
      pkgconfig/Makefile.am

+ 16 - 13
pkgconfig/Makefile.am

@@ -33,33 +33,36 @@ MAINTAINERCLEANFILES	= Makefile.in
 LIBS	= cfg confdb coroipcc coroipcs cpg evs logsys pload quorum \
 	  totem_pg votequorum
 
-pkgconf_LIBS = $(LIBS:%=lib%)
-
 target_LIBS = $(LIBS:%=lib%.pc)
 
 target_PACKAGE = corosync.pc
 
-lib%:
-	cat $(srcdir)/libtemplate.pc.in | sed \
+lib%.pc: libtemplate.pc.in
+	rm -f $@-t $@
+	sed \
 		-e 's#@PREFIX@#$(exec_prefix)#g' \
 		-e 's#@LIBDIR@#$(libdir)#g' \
 		-e 's#@LIBVERSION@#$(VERSION)#g' \
-		-e 's#@LIB@#'$(@:lib%=%)'#g' \
-	> $@.pc;
-	touch $@
+		-e 's#@LIB@#'$(*:lib%=%)'#g' \
+	    $< > $@-t
+	chmod a-w $@-t
+	mv $@-t $@
 
-$(target_PACKAGE):
-	cat $(srcdir)/$@.in | sed \
+%: %.in
+	rm -f $@-t $@
+	sed \
 		-e 's#@PREFIX@#$(exec_prefix)#g' \
 		-e 's#@LIBDIR@#$(libdir)#g' \
 		-e 's#@LIBVERSION@#$(VERSION)#g' \
 		-e 's#@COROLCRSODIR@#$(LCRSODIR)#g' \
 		-e 's#@COROSOCKETDIR@#$(SOCKETDIR)#g' \
-	> $@
+	    $< > $@-t
+	chmod a-w $@-t
+	mv $@-t $@
 
-all-local: $(pkgconf_LIBS) $(target_PACKAGE)
+all-local: $(target_LIBS) $(target_PACKAGE)
 
-install-exec-local:
+install-exec-local: $(target_LIBS) $(target_PACKAGE)
 	install -d $(DESTDIR)/$(libdir)/pkgconfig
 	install -m 644 $(target_LIBS) $(target_PACKAGE) $(DESTDIR)/$(libdir)/pkgconfig
 
@@ -68,4 +71,4 @@ uninstall-local:
 	rmdir $(DESTDIR)/$(libdir)/pkgconfig 2> /dev/null || :
 
 clean-local:
-	rm -f *.pc $(pkgconf_LIBS)
+	rm -f *.pc