File: undep.sh.in

package info (click to toggle)
freeciv 1.9.0-2.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 11,004 kB
  • ctags: 6,284
  • sloc: ansic: 65,037; makefile: 634; sh: 418; sed: 93
file content (63 lines) | stat: -rw-r--r-- 1,568 bytes parent folder | download | duplicates (2)
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
#
# @configure_input@
#
# This script gets run at the end of configure, to modify
# the Makefile's produced by configure to remove deps stuff 
# which can (for cvs sources and snapshots) upset some make 
# programs and C compilers.  (GNU make and gcc work, maybe 
# some others work too...)
#
# Whether anything is actually modified depends on how configure
# sets CVS_DEPS; see configure.in; if CVS_DEPS is set to "yes",
# this script does nothing.   For a "release" distribution
# of freeciv (where the deps are done differently and are portable) 
# this script will in effect do nothing because the sed regex's 
# won't match. 

CVS_DEPS=@CVS_DEPS@

if test "$CVS_DEPS" = "yes"; then
    exit
fi

@CLIENT_TRUE@CSUBDIRS="client client/@gui_sources@"
@CLIENT_FALSE@CSUBDIRS=""

@SERVER_TRUE@SSUBDIRS="ai server"
@SERVER_FALSE@SSUBDIRS=""

SUBDIRS="common $SSUBDIRS $CSUBDIRS"

for subdir in $SUBDIRS ; do

if test ! -d $subdir; then
   echo "No directory $subdir"
   continue
fi

name=$subdir/Makefile

if test ! -r $name; then
    echo "No file $name"
    continue
fi

echo "removing cvs-deps from $name"

mv -f $name $name.bak

sed '
s/^DEPS_MAGIC.*//
s/^-include $(DEP_FILES)//
s/^%\.o: %\.c/.c.o:/
s/\@echo\ '"'"'$(COMPILE) -c $<'"'"'; \\/$(COMPILE) -c $</
s/$(COMPILE) -Wp,-MD,\.deps\/$(\*F)\.P -c $<//
s/	$(COMPILE) -Wp,-MD,\.deps\/$(\*F)\.pp -c $</junknever:/
' $name.bak > $name

# Above, first COMPILE substitution line is appropriate
# for automake 1.3, second is for automake 1.4
# The second one has an embedded tab character after the s/

done