Restore install target

This commit is contained in:
2026-06-25 14:08:22 +03:00
parent 05b0aabeb4
commit 73836e0416
3 changed files with 47 additions and 6 deletions
+15 -5
View File
@@ -1,8 +1,7 @@
INSTALLATION INSTRUCTIONS INSTALLATION INSTRUCTIONS
To build and install the libfec libraries, simply say To build and install the libfec libraries for the host platform, say
./configure
make make
make test (optional) make test (optional)
make install (as root) make install (as root)
@@ -11,6 +10,19 @@ By default, "make install" puts the libfec libraries in
/usr/local/lib, the include files in /usr/local/include, and the /usr/local/lib, the include files in /usr/local/include, and the
manual page in /usr/local/man. manual page in /usr/local/man.
To build a specific platform target, use one of:
make linux
make macos
make windows
Use DESTDIR for staged packaging installs, for example:
make install DESTDIR=/tmp/libfec-package
You can override prefix, libdir, includedir and mandir on the make
command line.
You may have an old version of the GNU assembler that cannot handle You may have an old version of the GNU assembler that cannot handle
the relatively new SSE2 mnemonics. Update your version of the GNU the relatively new SSE2 mnemonics. Update your version of the GNU
"binutils" package. "binutils" package.
@@ -22,8 +34,7 @@ http://sources.redhat.com/binutils/
TESTING THE FEC LIBRARY TESTING THE FEC LIBRARY
After running the ./configure script, optional tests can be built and Optional native tests can be built and run as follows:
run as follows:
make test make test
@@ -36,4 +47,3 @@ broken.
Phil Karn, karn@ka9q.net Phil Karn, karn@ka9q.net
+29 -1
View File
@@ -6,6 +6,7 @@
# make windows build Windows libraries (cross-build on Linux/macOS) # make windows build Windows libraries (cross-build on Linux/macOS)
# make static build only the static library # make static build only the static library
# make shared build only the shared library # make shared build only the shared library
# make install install libraries, header and man pages
# make clean remove obj/ and lib/ # make clean remove obj/ and lib/
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
@@ -18,6 +19,13 @@ endif
BUILD ?= $(HOST_OS) BUILD ?= $(HOST_OS)
prefix ?= /usr/local
exec_prefix ?= $(prefix)
libdir ?= $(exec_prefix)/lib
includedir ?= $(prefix)/include
mandir ?= $(prefix)/man
INSTALL ?= install
OBJROOT := obj OBJROOT := obj
OUTROOT := lib OUTROOT := lib
OBJDIR := $(OBJROOT)/$(BUILD) OBJDIR := $(OBJROOT)/$(BUILD)
@@ -45,6 +53,7 @@ ifeq ($(BUILD),windows)
IMPORT_LIB := $(OUTDIR)/libfec.dll.a IMPORT_LIB := $(OUTDIR)/libfec.dll.a
SHARED_FLAGS := -shared -Wl,--out-implib,$(IMPORT_LIB) SHARED_FLAGS := -shared -Wl,--out-implib,$(IMPORT_LIB)
PIC_CFLAGS := PIC_CFLAGS :=
REBIND :=
else ifeq ($(BUILD),linux) else ifeq ($(BUILD),linux)
ifeq ($(origin CC),default) ifeq ($(origin CC),default)
CC := gcc CC := gcc
@@ -59,6 +68,7 @@ else ifeq ($(BUILD),linux)
IMPORT_LIB := IMPORT_LIB :=
SHARED_FLAGS := -shared -Wl,-soname,libfec.so SHARED_FLAGS := -shared -Wl,-soname,libfec.so
PIC_CFLAGS := -fPIC PIC_CFLAGS := -fPIC
REBIND := ldconfig
else ifeq ($(BUILD),macos) else ifeq ($(BUILD),macos)
ifeq ($(origin CC),default) ifeq ($(origin CC),default)
CC := cc CC := cc
@@ -73,6 +83,7 @@ else ifeq ($(BUILD),macos)
IMPORT_LIB := IMPORT_LIB :=
SHARED_FLAGS := -dynamiclib -install_name libfec.dylib SHARED_FLAGS := -dynamiclib -install_name libfec.dylib
PIC_CFLAGS := -fPIC PIC_CFLAGS := -fPIC
REBIND :=
else else
$(error Unsupported BUILD='$(BUILD)'; use BUILD=linux, BUILD=macos or BUILD=windows) $(error Unsupported BUILD='$(BUILD)'; use BUILD=linux, BUILD=macos or BUILD=windows)
endif endif
@@ -89,6 +100,7 @@ HOSTCFLAGS ?= -O2
STATIC_LIB := $(OUTDIR)/libfec.a STATIC_LIB := $(OUTDIR)/libfec.a
TEST_EXEEXT := $(if $(filter windows,$(BUILD)),.exe) TEST_EXEEXT := $(if $(filter windows,$(BUILD)),.exe)
INSTALL_LIBS := $(STATIC_LIB) $(SHARED_LIB) $(IMPORT_LIB)
SOURCES := \ SOURCES := \
cpu_mode_generic.c fec.c sim.c \ cpu_mode_generic.c fec.c sim.c \
@@ -117,12 +129,28 @@ HOST_GEN_OBJECTS := $(TOOLDIR)/gen_ccsds.o $(TOOLDIR)/init_rs_char.o
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
.SECONDARY: $(TEST_OBJECTS) .SECONDARY: $(TEST_OBJECTS)
.PHONY: all build linux macos windows static shared test check-tools clean .PHONY: all build linux macos windows static shared install test check-tools clean
all: build all: build
build: check-tools static shared build: check-tools static shared
static: $(STATIC_LIB) static: $(STATIC_LIB)
shared: $(SHARED_LIB) shared: $(SHARED_LIB)
install: build
mkdir -p $(DESTDIR)$(libdir)
$(INSTALL) -m 644 -p $(INSTALL_LIBS) $(DESTDIR)$(libdir)
ifneq ($(REBIND),)
ifneq ($(DESTDIR),)
@echo "Skipping $(REBIND) for staged install under DESTDIR=$(DESTDIR)"
else ifeq ($(BUILD),$(HOST_OS))
$(REBIND)
else
@echo "Skipping $(REBIND) for cross install BUILD=$(BUILD)"
endif
endif
mkdir -p $(DESTDIR)$(includedir)
$(INSTALL) -m 644 -p fec.h $(DESTDIR)$(includedir)
mkdir -m 0755 -p $(DESTDIR)$(mandir)/man3
$(INSTALL) -m 644 -p simd-viterbi.3 rs.3 dsp.3 $(DESTDIR)$(mandir)/man3
ifeq ($(BUILD),$(HOST_OS)) ifeq ($(BUILD),$(HOST_OS))
test: $(TEST_PROGRAMS) test: $(TEST_PROGRAMS)
$(OUTDIR)/vtest27$(TEST_EXEEXT) -e 3.0 -n 1000 -v $(OUTDIR)/vtest27$(TEST_EXEEXT) -e 3.0 -n 1000 -v
+3
View File
@@ -111,6 +111,9 @@ The resulting files are in lib/linux/, lib/macos/ or lib/windows/. Use
`make static` or `make shared` to build only one library type, and `make clean` `make static` or `make shared` to build only one library type, and `make clean`
to remove all generated files. to remove all generated files.
Use `make install` to install under /usr/local, or pass `DESTDIR` and the
standard `prefix`, `libdir`, `includedir` or `mandir` variables for packaging.
To build and run the native test programs: To build and run the native test programs:
make test make test