File:  [mozdev] / protozilla / ipc / makemake
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Sat Apr 20 12:22:25 2002 UTC (17 years, 7 months ago) by saravn
Branches: MAIN
CVS tags: ipc-1-0-3, ipc-1-0-2, ipc-1-0-1, ipc-1-0-0-branch-for-mozilla-trunk, ipc-1-0-0-2, ipc-1-0-0-1, ipc-1-0-0, ipc-0-99-63, ipc-0-99-62, ipc-0-99-60, HEAD
added makemake

#!/bin/csh
# makemake: Dumb script to make Makefile from Makefile.in
#           (recursively, if -r is specified)
# Usage: makemake [-r]

if ($#argv == 0) then
   set makelist = (./Makefile.in)
else
   set makelist = (`find . -name Makefile.in -print`)
endif

foreach makefile ($makelist)
   set dir=${makefile:h}
   pushd $dir

   set wd=`pwd`
   echo $wd

   set top_srcdir = ""
   while (("$wd" != "") && (${wd:t} != "mozilla"))
      if ("$top_srcdir" == "") then
         set top_srcdir = ".."
      else
         set top_srcdir = "../$top_srcdir"
      endif
      set wd=${wd:h}
   end

   /bin/cp Makefile.in Makefile
   ex -s Makefile << /EOF
set nomagic
g%@srcdir@%s%@srcdir@%.%gp
g%@top_srcdir@%s%@top_srcdir@%${top_srcdir}%gp
wq
/EOF

   popd
end

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>