summaryrefslogtreecommitdiffstats
path: root/tderadio3/presets/update-makefile-dot-am.sh
blob: 0ce7d714c01a42f15e37d6cee699be7c50066761 (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh

THIS="$0"
if [ ${THIS:0:1} != "/" ] ; then
	if [ -e "$PWD/$THIS" ] ; then
		THIS="$PWD/$THIS"
	fi
fi

THISDIR=$(pwd | sed "s/^.*presets\/\?//" )
OUT=Makefile.am
HERE=$(pwd)

echo -n "SUBDIRS =" > $OUT
echo -e "Makefile\nMakefile.in\nmaintainers.txt\nmakemaintainers" > .cvsignore


find -mindepth 1 -maxdepth 1 -type d | sed 's/^\.\///' | sed 's/\/$//' | grep -v CVS | \
  while read line; do

    echo -n " $line" >> $OUT
	
    cd "$line"
    "$THIS"
    cd "$HERE"

  done

echo >> $OUT


if [ -n "$THISDIR" ] ; then

	echo -n "EXTRA_DIST =" >> $OUT


	ls *.krp 2> /dev/null | while read line; do
		echo -n " \"$line\"" >> $OUT
	done

	echo >> $OUT

	echo -e "\ninstall-data-local:" >> $OUT
	echo "	\$(mkinstalldirs) \"\$(DESTDIR)\$(kde_datadir)/tderadio/presets/$THISDIR/\"" >> $OUT
	
	find -mindepth 1 -maxdepth 1 -name "*.krp" | sed 's/^\.\///' | \
	  while read line; do
		
	    echo "	\$(INSTALL_DATA) \"\$(srcdir)/$line\" \"\$(DESTDIR)\$(kde_datadir)/tderadio/presets/$THISDIR/$line\"" >> $OUT

	  done


	echo -e "\n\nuninstall-local:" >> $OUT

	find -mindepth 1 -maxdepth 1 -name "*.krp" | sed 's/^\.\///' | \
	  while read line; do

		echo "	-rm -f \"\$(DESTDIR)\$(kde_datadir)/tderadio/presets/$THISDIR/$line\"" >> $OUT	

	  done

fi