File: depmexe.sh

package info (click to toggle)
allegro4.2 2:4.2.0-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 24,436 kB
  • ctags: 14,714
  • sloc: ansic: 126,425; asm: 17,011; cpp: 3,846; sh: 2,120; objc: 925; makefile: 715; python: 216; pascal: 179; perl: 73
file content (43 lines) | stat: -rwxr-xr-x 1,128 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#! /bin/sh

# Generate dependencies and rules for multifile binaries like the
# makedoc program. Usage is 'script binary_target sourcefiles'

first=$1
depend=
missing=
if test -n "$first"; then
   for file in $*; do
      if test $first != $file; then
	 if test -f $file; then
	    dir=`echo $file | sed 's,/[^/]*$,,'`
	    name=`echo $file | sed 's,^.*/,,' | sed 's,\.[^.]*$,,'`
	    ext=`echo $file | sed 's,^.*\.,,'`
	    echo "\$(OBJDIR)/$name\$(OBJ): $file"
	    echo "	\$(COMPILE_PROGRAM) -c $file -o \$(OBJDIR)/$name\$(OBJ)"
	    echo ""
	    depend="$depend \$(OBJDIR)/$name\$(OBJ)"
	 else
	    missing="$missing $file"
	 fi
      fi
   done

   if test -n "$missing"; then
      echo "# These files don't exist: $missing"
   fi
   
   if test -n "$depend"; then
      echo "$first: $depend"
      if test "$first" = "demo/demo"; then
         echo "	\$(LINK) -o $first $depend \$(LINK_LIBALLEG) \$(LIBS)"
      else
         echo "	\$(LINK) -o $first $depend"
      fi
   else
      echo "# Missing object files for $first, couldn't generate target"
   fi
else
   echo "# depmexe.sh script run without parameters!"
fi