Commit d82b3ac3 authored by Maxime Perrotin's avatar Maxime Perrotin

Improve installation scripts

parent 73595ac3
ITERATORS_PREFIX?=$(HOME)/.local PREFIX?=$(HOME)/.local
all: all:
@echo You can install with "make install" @echo You can install with "make install"
@echo A testcase can be build from source with "make test" @echo A testcase can be build from source with "make test"
install: install: uninstall
gprinstall --uninstall asn1_iterators || : mkdir -p obj && sed 's,$$PREFIX,$(PREFIX),g' src/taste-asn1-iterators > obj/taste-asn1-iterators && chmod +x obj/taste-asn1-iterators
gprbuild -p asn1_iterators.gpr gprbuild -p asn1_iterators.gpr
gprinstall -p -XLIBRARY_TYPE=dynamic --build-name=shared asn1_iterators.gpr gprinstall -p -XLIBRARY_TYPE=dynamic --build-name=shared --prefix=$(PREFIX) asn1_iterators.gpr
install -m 755 src/taste-asn1-iterators $(ITERATORS_PREFIX)/bin
test_build: clean install test_build: clean install
mkdir -p build_test mkdir -p build_test
...@@ -19,6 +18,9 @@ test_build: clean install ...@@ -19,6 +18,9 @@ test_build: clean install
test: test_build test: test_build
build_test/test_generic build_test/test_generic
uninstall:
gprinstall --uninstall --prefix=$(PREFIX) asn1_iterators || :
clean: clean:
gprclean test_generic.gpr || : gprclean test_generic.gpr || :
gprclean asn1_iterators.gpr || : gprclean asn1_iterators.gpr || :
......
...@@ -4,5 +4,6 @@ project asn1_iterators is ...@@ -4,5 +4,6 @@ project asn1_iterators is
for Languages use ("Ada"); for Languages use ("Ada");
package Install is package Install is
for Artifacts ("share/asn1_iterators/stg") use ("stg/*"); for Artifacts ("share/asn1_iterators/stg") use ("stg/*");
for Artifacts ("bin/") use ("obj/taste-asn1-iterators");
end Install; end Install;
end asn1_iterators; end asn1_iterators;
#!/bin/bash -e #!/bin/bash -e
echo 'taste-asn1-iterators (c) 2017 European Space Agency' echo 'taste-asn1-iterators (c) 2018 European Space Agency (maxime.perrotin@esa.int)'
STG_PREFIX=/usr/local/share/taste STG_PREFIX=$PREFIX/share/asn1_iterators/stg
OUT=iterators OUT=iterators
if [ ! -f "$1" ] if [ ! -f "$1" ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment