xref: /dflybsd-src/usr.bin/wmake/wmake.sh (revision 1eb57c75e4c1b4de776c2ab9d68b922cb30d0fe4)
1cb0f1574SMatthew Dillon#!/bin/sh
2cb0f1574SMatthew Dillon#
321bd8f07SSimon Schubert# $DragonFly: src/usr.bin/wmake/wmake.sh,v 1.3 2006/02/11 10:42:12 corecode Exp $
4cb0f1574SMatthew Dillon#
5c5f6a559SSimon Schubert# This script was written by Matt Dillon and has been placed in the
6cb0f1574SMatthew Dillon# public domain.
7cb0f1574SMatthew Dillon
8cb0f1574SMatthew Dillonpath=$PWD
9cb0f1574SMatthew Dillonwhile [ "$path" != "" ]; do
10cb0f1574SMatthew Dillon    if [ -f $path/Makefile.inc1 ]; then
11cb0f1574SMatthew Dillon	break
12cb0f1574SMatthew Dillon    fi
13cb0f1574SMatthew Dillon    path=${path%/*}
14cb0f1574SMatthew Dillondone
15cb0f1574SMatthew Dillonif [ "$path" = "" ]; then
16cb0f1574SMatthew Dillon    echo "Unable to locate Makefile.inc through parent dirs"
17cb0f1574SMatthew Dillonfi
18cb0f1574SMatthew Dillon
1921bd8f07SSimon Schubertescaped_args=`echo -n "$@" | sed -e "s/'/\\'/"`
20*1eb57c75SMatthew Dillonfor i in $escaped_args; do
21*1eb57c75SMatthew Dillon    case $i in
22*1eb57c75SMatthew Dillon    DESTDIR=*)
23*1eb57c75SMatthew Dillon	escaped_args="$escaped_args _SHLIBDIRPREFIX=${i#DESTDIR=}"
24*1eb57c75SMatthew Dillon	;;
25*1eb57c75SMatthew Dillon    esac
26*1eb57c75SMatthew Dillondone
27cb0f1574SMatthew Dillon
28c5f6a559SSimon Schuberteval `cd $path; make WMAKE_ARGS="'$escaped_args'" -f Makefile.inc1 wmake`
29