Makefile (1727B)
1 prefix := /usr/local 2 PREFIX := $(prefix) 3 libdir := $(PREFIX)/lib 4 DESTDIR := "" 5 6 build: 7 gcc -I./src $(CFLAGS) -c src/rlp.c -o src/rlp.o 8 gcc -I./src $(CFLAGS) -c src/encode.c -o src/encode.o 9 gcc -I./src $(CFLAGS) -c src/decode.c -o src/decode.o 10 gcc -I./src $(CFLAGS) -c src/bits.c -o src/bits.o 11 gcc -I./src $(CFLAGS) -c src/endian.c -o src/endian.o 12 13 build_lib: build 14 gcc -I./src -fPIC -shared -o librlp.so -Wl,-soname,librlp.so.0.0.1 src/rlp.o src/encode.o src/decode.o src/bits.o src/endian.o 15 16 17 build_test: build 18 gcc -I./src -g3 tests/check_rlp.c src/rlp.o src/bits.o src/encode.o src/decode.o src/endian.o -o tests/check_rlp -lcheck 19 gcc -I./src -g3 tests/check_encoder.c src/rlp.o src/bits.o src/encode.o src/decode.o src/endian.o -o tests/check_encoder -lcheck 20 gcc -I./src -g3 tests/check_bits.c src/rlp.o src/bits.o src/encode.o src/decode.o src/endian.o -o tests/check_bits -lcheck 21 gcc -I./src -g3 tests/check_vectors.c src/rlp.o src/bits.o src/encode.o src/decode.o src/endian.o -o tests/check_vectors -lcheck 22 gcc -I./src -g3 tests/check_decoder.c src/rlp.o src/bits.o src/encode.o src/decode.o src/endian.o -o tests/check_decoder -lcheck 23 24 check: build_test 25 tests/check_rlp 26 tests/check_encoder 27 tests/check_decoder 28 tests/check_bits 29 tests/check_vectors 30 31 .PHONY clean: 32 rm -vf tests/check_rlp 33 rm -vf tests/check_encoder 34 rm -vf tests/check_decoder 35 rm -vf tests/check_bits 36 rm -vf tests/check_vectors 37 rm -vf src/*.o 38 rm -vf src/lib*.so* 39 40 dist: check 41 mkdir -vp dist 42 tar -zcvf dist/librlp-`cat VERSION`.tar.gz src/*.h src/*.c Makefile CONTRIBUTORS LICENSE VERSION CHANGELOG 43 44 install: build_lib 45 install -m0644 -D -t $(DESTDIR)$(libdir) librlp.so 46 47 48 .PHONE distclean: clean 49 rm -rf dist/ 50 51 52 .PHONY test: check