comparison build-scripts/makedep.sh @ 1634:14f302c5b32c

Don't hardcode the output directory
author Sam Lantinga <slouken@libsdl.org>
date Fri, 14 Apr 2006 03:56:31 +0000
parents 9b9212e4810c
children 9f64d06fa168
comparison
equal deleted inserted replaced
1633:b17ca8c3a404 1634:14f302c5b32c
1 #!/bin/sh 1 #!/bin/sh
2 # 2 #
3 # Generate dependencies from a list of source files 3 # Generate dependencies from a list of source files
4 4
5 # Check to make sure our environment variables are set 5 # Check to make sure our environment variables are set
6 if test x"$INCLUDE" = x -o x"$SOURCES" = x -o x"$objects" = x -o x"$output" = x; then 6 if test x"$INCLUDE" = x -o x"$SOURCES" = x -o x"$output" = x; then
7 echo "SOURCES, INCLUDE, objects, and output needs to be set" 7 echo "SOURCES, INCLUDE, and output needs to be set"
8 exit 1 8 exit 1
9 fi 9 fi
10 cache_prefix=".#$$" 10 cache_prefix=".#$$"
11 11
12 generate_var() 12 generate_var()
39 39
40 :>${output}.new 40 :>${output}.new
41 for src in $SOURCES 41 for src in $SOURCES
42 do echo "Generating dependencies for $src" 42 do echo "Generating dependencies for $src"
43 ext=`echo $src | sed 's|.*\.\(.*\)|\1|'` 43 ext=`echo $src | sed 's|.*\.\(.*\)|\1|'`
44 obj=`echo $src | sed "s|^.*/\([^ ]*\)\..*|$objects/\1.lo|g"` 44 obj=`echo $src | sed "s|^.*/\([^ ]*\)\..*|\1.lo|g"`
45 echo "$obj: $src \\" >>${output}.new 45 echo "\$(objects)/$obj: $src \\" >>${output}.new
46 search_deps $src | sort | uniq >>${output}.new 46 search_deps $src | sort | uniq >>${output}.new
47 case $ext in 47 case $ext in
48 c) cat >>${output}.new <<__EOF__ 48 c) cat >>${output}.new <<__EOF__
49 49
50 \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@ 50 \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@