Makefile 1.33 KB
Newer Older
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
ITERATORS_PREFIX?=/usr/local

all:
	@echo You can install with "sudo make install"
	@echo A testcase can be build from source with "make test"

install:
	install -d $(ITERATORS_PREFIX)/share/taste
	install -m 644 stg/ada_iterators-iterators-adb.stg $(ITERATORS_PREFIX)/share/taste
	install -m 644 stg/ada_iterators-iterators-ads.stg $(ITERATORS_PREFIX)/share/taste
	install -m 644 stg/ada_iterators.stg $(ITERATORS_PREFIX)/share/taste
	install -m 755 src/taste-asn1-iterators $(ITERATORS_PREFIX)/bin
	install -d /usr/share/ada/adainclude/asn1_iterators
	install -m 644 src/asn1_iterators.gpr /usr/share/ada/adainclude
	install -d /usr/lib/i386-linux-gnu/ada/adalib/asn1_iterators
	install -m 644 src/*.ad? /usr/share/ada/adainclude/asn1_iterators
	cd src && mkdir -p tmp && cd tmp && gnat make -c -O2 ../*.ad? && \
	    install -m 644 *.ali /usr/lib/i386-linux-gnu/ada/adalib/asn1_iterators && \
	    ar r libasn1_iterators.so *.o && cp libasn1_iterators.so /usr/lib/i386-linux-gnu && \
	    cd ../.. && rm -rf src/tmp


test_install: clean
	mkdir -p build_test
	cp test/DataView.asn build_test
	cp test/test_generic.gpr build_test
	cp test/test_generic.adb build_test
	cd build_test && taste-asn1-iterators DataView.asn && gprbuild test_generic.gpr

test: test_install
	build_test/test_generic

clean:
	@rm -rf build_test

.PHONY: all clean install test_install