More GTK3 Waf build system adjustments
[geany-mirror.git] / scripts / wafinit.sh
blob27d3bd0f33b399ed8ba766c5bec814b3dd1c19cc
1 #! /bin/sh
3 # This script creates a "configure" script and a Makefile to imitate autotools
4 # but Waf is actually used to build
6 WAF="./waf"
8 # Makefile
9 cat > Makefile << EOF
11 .PHONY: build configure
13 all: build
15 build:
16 @$WAF build
18 install:
19 @if test -n "\$(DESTDIR)"; then \\
20 ./waf install --destdir="\$(DESTDIR)"; \\
21 else \\
22 ./waf install; \\
23 fi;
25 uninstall:
26 @if test -n "\$(DESTDIR)"; then \\
27 $WAF uninstall --destdir="\$(DESTDIR)"; \\
28 else \\
29 $WAF uninstall; \\
30 fi;
32 clean:
33 @$WAF clean
35 distclean:
36 @$WAF distclean
37 @-rm -f Makefile
39 htmldoc:
40 @$WAF --htmldoc
42 apidoc:
43 @$WAF --apidoc
45 configure:
46 @$WAF configure
48 EOF
50 template="
51 all: build
53 build:
54 cd .. && $WAF build
58 echo "$template" > src/Makefile
59 echo "$template" > tagmanager/Makefile
60 echo "$template" > scintilla/Makefile
61 echo "$template" > plugins/Makefile
64 # configure
65 cat > configure << EOF
66 #!/bin/sh
68 $WAF configure \$@
70 EOF
72 chmod 755 configure