From ed2547b8585652a4a6f71e2bc24148e26ef6d0c8 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 24 May 2002 06:25:52 +0000 Subject: [PATCH] Clean up autoconf install to obey DESTDIR --- Makefile.in | 67 +++++++++++++++++++++++++++++------------- fc-cache/Makefile.in | 23 +++++++++------ fc-list/Makefile.in | 22 +++++++++----- fontconfig/Makefile.in | 24 +++++++-------- src/Makefile.in | 48 ++++++++++++++++++++---------- 5 files changed, 119 insertions(+), 65 deletions(-) diff --git a/Makefile.in b/Makefile.in index 6e63524..e14e75c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,5 +1,5 @@ # -# $XFree86: xc/lib/fontconfig/Makefile.in,v 1.2 2002/05/21 17:48:15 keithp Exp $ +# $XFree86: xc/lib/fontconfig/Makefile.in,v 1.4 2002/05/24 05:19:30 keithp Exp $ # # Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. # @@ -31,40 +31,65 @@ DIRS = src fc-cache fc-list fontconfig all install clean:: for d in $(DIRS); do $(MAKE) -C $$d $@; done +# +# create fonts.conf file +# all:: fonts.conf fonts.conf: fonts.conf.in rm -f $@ sh ./setfontdirs $(FC_DEFAULT_FONTS) $(X_FONT_DIR) -install:: $(CONFDIR)/fonts.conf $(CONFDIR)/fonts.dtd +clean:: + rm -f fonts.conf + +# +# installation directories +# + +install:: $(DESTDIR)$(CONFDIR) $(DESTDIR)$(BINDIR) +install:: $(DESTDIR)$(LIBDIR) $(DESTDIR)$(LIBDIR)/pkgconfig -$(CONFDIR)/fonts.conf:: fonts.conf +$(DESTDIR)$(CONFDIR): + mkdir -p $@ + +$(DESTDIR)$(BINDIR): + mkdir -p $@ + +$(DESTDIR)$(LIBDIR): + mkdir -p $@ + +$(DESTDIR)$(LIBDIR)/pkgconfig: + mkdir -p $@ + +# +# install config files +# +install:: $(DESTDIR)$(CONFDIR)/fonts.conf $(DESTDIR)$(CONFDIR)/fonts.dtd + +$(DESTDIR)$(CONFDIR)/fonts.conf:: fonts.conf if [ -f $@ ]; then \ echo "Not overwriting existing $@"; \ else \ - $(INSTALL_DATA) fonts.conf $(CONFDIR); \ + $(INSTALL_DATA) fonts.conf $(DESTDIR)$(CONFDIR); \ fi -$(CONFDIR)/fonts.dtd:: fonts.dtd - $(INSTALL_DATA) fonts.dtd $(CONFDIR) - -clean:: - rm -f fonts.conf - -install:: $(BINDIR)/fontconfig-config +$(DESTDIR)$(CONFDIR)/fonts.dtd:: fonts.dtd + $(INSTALL_DATA) fonts.dtd $(DESTDIR)$(CONFDIR) -all:: fontconfig-config +# +# install fontconfig-config script +# -$(BINDIR)/fontconfig-config: fontconfig-config - $(INSTALL_SCRIPT) $< $(BINDIR) +install:: $(DESTDIR)$(BINDIR)/fontconfig-config -install:: $(LIBDIR)/pkgconfig $(LIBDIR)/pkgconfig/fontconfig.pc +$(DESTDIR)$(BINDIR)/fontconfig-config: fontconfig-config + $(INSTALL_SCRIPT) $< $(DESTDIR)$(BINDIR) -$(LIBDIR)/pkgconfig: - mkdir -p $@ - -all:: fontconfig.pc +# +# install pkgconfig control file +# +install:: $(DESTDIR)$(LIBDIR)/pkgconfig/fontconfig.pc -$(LIBDIR)/pkgconfig/fontconfig.pc: fontconfig.pc - $(INSTALL_DATA) $< $(LIBDIR)/pkgconfig +$(DESTDIR)$(LIBDIR)/pkgconfig/fontconfig.pc: fontconfig.pc + $(INSTALL_DATA) $< $(DESTDIR)$(LIBDIR)/pkgconfig diff --git a/fc-cache/Makefile.in b/fc-cache/Makefile.in index 7cc9d0c..a7aaf60 100644 --- a/fc-cache/Makefile.in +++ b/fc-cache/Makefile.in @@ -1,5 +1,5 @@ # -# $XFree86: xc/lib/fontconfig/fc-cache/Makefile.in,v 1.1 2002/05/21 17:06:21 keithp Exp $ +# $XFree86: xc/lib/fontconfig/fc-cache/Makefile.in,v 1.2 2002/05/21 17:48:15 keithp Exp $ # # Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. # @@ -34,15 +34,20 @@ PROG=fc-cache all:: $(PROG) -install:: $(BINDIR)/$(PROG) - -$(BINDIR)/$(PROG): $(PROG) - $(INSTALL_PROGRAM) $(PROG) $(BINDIR) - -clean:: - rm -f $(PROG) $(OBJS) - $(PROG): $(OBJS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBFONTCONFIG) $(OBJS): $(HEADERS) + +install:: $(DESTDIR)$(BINDIR) + +$(DESTDIR)$(BINDIR): + mkdir -p $@ + +install:: $(DESTDIR)$(BINDIR)/$(PROG) + +$(DESTDIR)$(BINDIR)/$(PROG): $(PROG) + $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(BINDIR) + +clean:: + rm -f $(PROG) $(OBJS) diff --git a/fc-list/Makefile.in b/fc-list/Makefile.in index 18943f1..8088bb3 100644 --- a/fc-list/Makefile.in +++ b/fc-list/Makefile.in @@ -1,5 +1,5 @@ # -# $XFree86: xc/lib/fontconfig/fc-list/Makefile.in,v 1.1 2002/05/21 17:06:21 keithp Exp $ +# $XFree86: xc/lib/fontconfig/fc-list/Makefile.in,v 1.2 2002/05/21 17:48:15 keithp Exp $ # # Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. # @@ -34,15 +34,21 @@ PROG=fc-list all:: $(PROG) -install:: $(BINDIR)/$(PROG) +$(PROG): $(OBJS) + $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBFONTCONFIG) + +$(OBJS): $(HEADERS) + +install:: $(DESTDIR)$(BINDIR) + +$(DESTDIR)$(BINDIR): + mkdir -p $@ -$(BINDIR)/$(PROG): $(PROG) - $(INSTALL_PROGRAM) $(PROG) $(BINDIR) +install:: $(DESTDIR)$(BINDIR)/$(PROG) + +$(DESTDIR)$(BINDIR)/$(PROG): $(PROG) + $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(BINDIR) clean:: rm -f $(PROG) $(OBJS) -$(PROG): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBFONTCONFIG) - -$(OBJS): $(HEADERS) diff --git a/fontconfig/Makefile.in b/fontconfig/Makefile.in index c7c9692..a4e7bbb 100644 --- a/fontconfig/Makefile.in +++ b/fontconfig/Makefile.in @@ -1,5 +1,5 @@ # -# $XFree86: xc/lib/fontconfig/fc-list/Makefile.in,v 1.1 2002/05/21 17:06:21 keithp Exp $ +# $XFree86: xc/lib/fontconfig/fontconfig/Makefile.in,v 1.1 2002/05/22 22:59:41 keithp Exp $ # # Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. # @@ -28,21 +28,21 @@ include $(TOPDIR)/config/Makedefs all:: -install:: $(INCLUDEDIR) -install:: $(INCLUDEDIR)/fcfreetype.h -install:: $(INCLUDEDIR)/fcprivate.h -install:: $(INCLUDEDIR)/fontconfig.h +install:: $(DESTDIR)$(INCLUDEDIR) +install:: $(DESTDIR)$(INCLUDEDIR)/fcfreetype.h +install:: $(DESTDIR)$(INCLUDEDIR)/fcprivate.h +install:: $(DESTDIR)$(INCLUDEDIR)/fontconfig.h -$(INCLUDEDIR): +$(DESTDIR)$(INCLUDEDIR): mkdir -p $@ -$(INCLUDEDIR)/fcfreetype.h: fcfreetype.h - $(INSTALL_DATA) $< $(INCLUDEDIR) +$(DESTDIR)$(INCLUDEDIR)/fcfreetype.h: fcfreetype.h + $(INSTALL_DATA) $< $(DESTDIR)$(INCLUDEDIR) -$(INCLUDEDIR)/fcprivate.h: fcprivate.h - $(INSTALL_DATA) $< $(INCLUDEDIR) +$(DESTDIR)$(INCLUDEDIR)/fcprivate.h: fcprivate.h + $(INSTALL_DATA) $< $(DESTDIR)$(INCLUDEDIR) -$(INCLUDEDIR)/fontconfig.h: fontconfig.h - $(INSTALL_DATA) $< $(INCLUDEDIR) +$(DESTDIR)$(INCLUDEDIR)/fontconfig.h: fontconfig.h + $(INSTALL_DATA) $< $(DESTDIR)$(INCLUDEDIR) clean:: diff --git a/src/Makefile.in b/src/Makefile.in index 0db9084..90a4d23 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,5 +1,5 @@ # -# $XFree86: xc/lib/fontconfig/src/Makefile.in,v 1.2 2002/05/21 17:48:15 keithp Exp $ +# $XFree86: xc/lib/fontconfig/src/Makefile.in,v 1.3 2002/05/22 04:12:35 keithp Exp $ # # Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. # @@ -71,20 +71,9 @@ OBJS=fcatomic.@OBJEXT@ \ all:: $(LIBFILE) $(LIBMAJOR) $(LIBBASE) -install:: $(LIBDIR)/$(LIB) $(LIBDIR)/$(LIBMAJOR) $(LIBDIR)/$(LIBBASE) - -$(LIBDIR)/$(LIBFILE): $(LIBFILE) - $(INSTALL_PROGRAM) $< $(LIBDIR) - -$(LIBDIR)/$(LIBMAJOR): $(LIBDIR)/$(LIBFILE) - $(LN_S) $(LIBDIR)/$(LIBFILE) $(LIBDIR)/$(LIBMAJOR) - -$(LIBDIR)/$(LIBBASE): $(LIBDIR)/$(LIBMAJOR) - $(LN_S) $(LIBDIR)/$(LIBMAJOR) $(LIBDIR)/$(LIBBASE) - -clean:: - rm -f $(LIBFILE) $(LIBMAJOR) $(LIBBASE) $(OBJS) - +# +# build the library and the various version links +# $(LIBFILE): $(OBJS) rm -f $@ $(MKSHLIB) $(OBJS) $(LIBS) @@ -98,3 +87,32 @@ $(LIBBASE): $(LIBMAJOR) $(LN_S) $(LIBMAJOR) $(LIBBASE) $(OBJS): fcint.h $(HEADERS) + +# +# install directories +# +install:: $(DESTDIR)$(LIBDIR) + +$(DESTDIR)$(LIBDIR): + mkdir -p $@ + +# +# install library +# + +install:: $(DESTDIR)$(LIBDIR)/$(LIB) $(DESTDIR)$(LIBDIR)/$(LIBMAJOR) +install:: $(DESTDIR)$(LIBDIR)/$(LIBBASE) + +$(DESTDIR)$(LIBDIR)/$(LIBFILE): $(LIBFILE) + $(INSTALL_PROGRAM) $< $(DESTDIR)$(LIBDIR) + +$(DESTDIR)$(LIBDIR)/$(LIBMAJOR): $(DESTDIR)$(LIBDIR)/$(LIBFILE) + rm -f $(DESTDIR)$(LIBDIR)/$(LIBMAJOR) + $(LN_S) $(LIBFILE) $(DESTDIR)$(LIBDIR)/$(LIBMAJOR) + +$(DESTDIR)$(LIBDIR)/$(LIBBASE): $(DESTDIR)$(LIBDIR)/$(LIBMAJOR) + rm -f $(DESTDIR)$(LIBDIR)/$(LIBBASE) + $(LN_S) $(LIBMAJOR) $(DESTDIR)$(LIBDIR)/$(LIBBASE) + +clean:: + rm -f $(LIBFILE) $(LIBMAJOR) $(LIBBASE) $(OBJS) -- 2.39.5