]> rtime.felk.cvut.cz Git - orte.git/blob - Makefile.git
Add shell.nix
[orte.git] / Makefile.git
1 default: git
2         @echo "Now you can run './configure'"
3
4 git:
5         autoreconf -i
6
7 all:
8         aclocal -I admin
9         autoheader
10         automake
11         autoconf
12
13 .PHONY: default git all dist dist-tarball
14
15 VER=$(shell git describe --match='v[0-9]*' | sed -e 's/^v\(.*\)/\1/')
16
17 CONFIGURE_FLAGS = --enable-orte-idl
18
19 configure: git
20
21 check: check-omk check-autotools check-windows check-windows-omk check-java check-android
22
23 check-%: configure
24         rm -rf _$@
25         mkdir -p _$@
26         $(MAKE) -C _$@ -f ../Makefile.git $@.real
27
28 check-windows.real:
29 # We don't have libIDL for mingw, so we check without --enable-orte-idl
30         ../configure --prefix=/ --host=i586-mingw32msvc CC=i586-mingw32msvc-gcc || \
31         ../configure --prefix=/ --host=i686-w64-mingw32 CC=i686-w64-mingw32-gcc
32         make
33         make install DESTDIR=$(CURDIR)/_install
34         test -f _install/bin/liborte-*.dll
35
36 check-windows-omk.real:
37         echo "TARGET_OS=win32" > config.omk
38         echo "CC=i686-w64-mingw32-gcc" >> config.omk
39         echo "CXX=i686-w64-mingw32-g++" >> config.omk
40         echo "AR=i686-w64-mingw32-ar" >> config.omk
41         echo "LD=i686-w64-mingw32-ld" >> config.omk
42         echo "TARGET_LOADLIBES=pthread" >> config.omk
43         ln -s ../orte ../Makefile ../Makefile.omk ../Makefile.rules .
44         make
45
46 check-omk.real:
47         ln -s ../orte ../Makefile ../Makefile.omk ../Makefile.rules .
48         make
49
50 check-autotools.real:
51         ../configure $(CONFIGURE_FLAGS)
52         make
53
54 check-java.real: JAVAC=$(shell readlink -f $(shell which javac))
55 check-java.real: JAVA_HOME=$(JAVAC:%/bin/javac=%)
56 check-java.real:
57         test -d "$(JAVA_HOME)"
58         ../configure --with-java=$(JAVA_HOME)
59         $(MAKE)
60         ant -f ../orte/java/build.xml
61         test -f ../orte/java/lib/orte.jar
62
63 check-android:
64         android update project -p orte/libaorte
65         android update project -p orte/contrib/Robot_Demo
66         cd orte/libaorte && ndk-build
67         cd orte/contrib/Robot_Demo && ant debug
68         test -f orte/contrib/Robot_Demo/bin/RoboDruid-debug.apk
69
70 dist:
71         $(MAKE) -f Makefile.git VER=$(VER) dist-tarball dist-check
72         @echo "Tarball stored as orte-$(VER).tar.gz"
73
74 dist-tarball: orte-$(VER).tar.gz
75
76 orte-$(VER).tar.gz: $(shell git ls-files)
77 # Export clean sources and run autoreconf
78         test ! -d orte-$(VER)
79         git archive --format=tar --prefix=orte-$(VER)/ HEAD | tar x
80         make -C orte-$(VER) -f Makefile.git
81         rm -rf orte-$(VER)/autom4te.cache
82 # Export sources again for building of documentation and copy generated orte manual to release dir
83         test ! -d orte-$(VER)-doc
84         git archive --format=tar --prefix=orte-$(VER)-doc/ HEAD | tar x
85         make -C orte-$(VER)-doc/doc
86         cp orte-$(VER)-doc/doc/orteman.pdf orte-$(VER)/doc
87         rm -rf orte-$(VER)-doc
88 # Create tarball
89         tar czf $@ orte-$(VER)
90         rm -rf orte-$(VER)
91         @echo "Tarball stored as orte-$(VER).tar.gz"
92
93 dist-check: orte-$(VER).tar.gz
94         tar xf $<
95 # Check that we can compile the content of the tarball
96         mkdir orte-$(VER)/_build
97         cd orte-$(VER)/_build && ../configure $(CONFIGURE_FLAGS) && make V=0
98         mkdir orte-$(VER)/_win
99         cd orte-$(VER)/_win && ../configure --host=i686-w64-mingw32 CC=i686-w64-mingw32-gcc && make V=0
100         rm -rf orte-$(VER)