Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patched to build shared library and install it #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 47 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
CFLAGS = -O3 -ggdb3 -fsanitize=address
CFLAGS = -O3 -ggdb3 -fsanitize=address -fPIC
CPPFLAGS = -std=c11 -I.
LDFLAGS = -lm -fsanitize=address
LDFLAGS = -L. -lm -lft8 -fsanitize=address
PREFIX ?= /usr
LIBDIR := ${PREFIX}/lib/x86_64-linux-gnu

TARGETS = gen_ft8 decode_ft8 test
# The shared library and it's parts
ft8lib := libft8.so
ft8lib_hdrs += ft8/constants.h
ft8lib_hdrs += ft8/crc.h
ft8lib_hdrs += ft8/decode.h
ft8lib_hdrs += ft8/encode.h
ft8lib_hdrs += ft8/ldpc.h
ft8lib_hdrs += ft8/pack.h
ft8lib_hdrs += ft8/text.h
ft8lib_hdrs += ft8/unpack.h

ft8lib_objs += common/wave.o
ft8lib_objs += fft/kiss_fft.o
ft8lib_objs += fft/kiss_fftr.o
ft8lib_objs += ft8/constants.o
ft8lib_objs += ft8/crc.o
ft8lib_objs += ft8/decode.o
ft8lib_objs += ft8/encode.o
ft8lib_objs += ft8/text.o
ft8lib_objs += ft8/pack.o
ft8lib_objs += ft8/ldpc.o
ft8lib_objs += ft8/unpack.o

TARGETS = ${ft8lib} gen_ft8 decode_ft8 test

.PHONY: run_tests all clean

Expand All @@ -11,17 +36,29 @@ all: $(TARGETS)
run_tests: test
@./test

gen_ft8: gen_ft8.o ft8/constants.o ft8/text.o ft8/pack.o ft8/encode.o ft8/crc.o common/wave.o
$(CXX) $(LDFLAGS) -o $@ $^
decode_ft8.o gen_ft8.o: ${ft8lib} #install

test: test.o ft8/pack.o ft8/encode.o ft8/crc.o ft8/text.o ft8/constants.o fft/kiss_fftr.o fft/kiss_fft.o
gen_ft8: gen_ft8.o
$(CXX) $(LDFLAGS) -o $@ $^

decode_ft8: decode_ft8.o fft/kiss_fftr.o fft/kiss_fft.o ft8/decode.o ft8/encode.o ft8/crc.o ft8/ldpc.o ft8/unpack.o ft8/text.o ft8/constants.o common/wave.o
test: test.o
$(CXX) $(LDFLAGS) -o $@ $^

decode_ft8: decode_ft8.o
$(CXX) $(LDFLAGS) -lft8 -o $@ $^

clean:
rm -f *.o ft8/*.o common/*.o fft/*.o $(TARGETS)
rm -f ${ft8lib} *.o ft8/*.o common/*.o fft/*.o $(TARGETS) *.a

install:
$(AR) rc libft8.a ft8/constants.o ft8/encode.o ft8/pack.o ft8/text.o common/wave.o
install libft8.a /usr/lib/libft8.a
# $(AR) rc libft8.a ${ft8lib_objs}
# install -m 0644 libft8.a ${LIBDIR}/lib/libft8.a
install -d ${PREFIX}/include/ft8
install -m 0644 ${ft8lib_hdrs} ${PREFIX}/include/ft8
install -m 0644 libft8.so ${LIBDIR}/libft8.so
install -m 0755 gen_ft8 ${PREFIX}/bin/genft8
install -m 0755 decode_ft8 ${PREFIX}/bin/decode_ft8

# Build the shared library
${ft8lib}: ${ft8lib_objs}
${CXX} -shared -Wl,-soname,$@ -o $@ $^
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,9 @@ Of course in moments of frustration I have looked up the original WSJT-X code, w

Karlis Goba,
YL3JG

------
This has been patched by Dangerous Devices / Pripyat Automations to build as
usable shared library.

I'll try to keep it up to day!.