diff --git a/Makefile b/Makefile index 37412c3..9c840c4 100644 --- a/Makefile +++ b/Makefile @@ -49,16 +49,13 @@ scripts/%: scripts/%.in scripts: scripts/beesd scripts/beesd@.service -install_libs: lib - install -Dm644 lib/libcrucible.so $(DESTDIR)$(LIB_PREFIX)/libcrucible.so - install_tools: ## Install support tools + libs -install_tools: install_libs src +install_tools: src install -Dm755 bin/fiemap $(DESTDIR)$(PREFIX)/bin/fiemap install -Dm755 bin/fiewalk $(DESTDIR)$(PREFIX)/sbin/fiewalk install_bees: ## Install bees + libs -install_bees: install_libs src $(RUN_INSTALL_TESTS) +install_bees: src $(RUN_INSTALL_TESTS) install -Dm755 bin/bees $(DESTDIR)$(LIBEXEC_PREFIX)/bees install_scripts: ## Install scipts diff --git a/docs/install.md b/docs/install.md index 7958e2c..612b6ba 100644 --- a/docs/install.md +++ b/docs/install.md @@ -62,9 +62,8 @@ packages. Build from source ----------------- -Build with `make`. The build produces `bin/bees` and `lib/libcrucible.so`, -which must be copied to somewhere in `$PATH` and `$LD_LIBRARY_PATH` -on the target system respectively. +Build with `make`. The build produces `bin/bees` which must be copied +to somewhere in `$PATH` on the target system respectively. It will also generate `scripts/beesd@.service` for systemd users. This service makes use of a helper script `scripts/beesd` to boot the service. diff --git a/lib/Makefile b/lib/Makefile index 3c3ccea..82e62a5 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1,7 +1,7 @@ TAG ?= $(shell git describe --always --dirty || echo UNKNOWN) -default: libcrucible.so -%.so: Makefile +default: libcrucible.a +%.a: Makefile CRUCIBLE_OBJS = \ chatter.o \ @@ -44,7 +44,7 @@ depends.mk: $(CRUCIBLE_OBJS:%.o=.depends/%.dep) include depends.mk %.o: %.cc ../makeflags - $(CXX) $(BEES_CXXFLAGS) -fPIC -o $@ -c $< + $(CXX) $(BEES_CXXFLAGS) -o $@ -c $< -libcrucible.so: $(CRUCIBLE_OBJS) .version.o - $(CXX) $(BEES_LDFLAGS) -fPIC -shared -Wl,-soname,$@ -o $@ $^ -luuid +libcrucible.a: $(CRUCIBLE_OBJS) .version.o + $(AR) rcs $@ $^ diff --git a/makeflags b/makeflags index 2afa254..c5b6951 100644 --- a/makeflags +++ b/makeflags @@ -7,7 +7,7 @@ CCFLAGS = -Wall -Wextra -Werror -O3 # Debug: # CCFLAGS = -Wall -Wextra -Werror -O0 -ggdb -CCFLAGS += -I../include -fpic -D_FILE_OFFSET_BITS=64 +CCFLAGS += -I../include -D_FILE_OFFSET_BITS=64 BEES_CFLAGS = $(CCFLAGS) -std=c99 $(CFLAGS) BEES_CXXFLAGS = $(CCFLAGS) -std=c++11 -Wold-style-cast $(CXXFLAGS) diff --git a/src/Makefile b/src/Makefile index dbe9f9e..90cbaad 100644 --- a/src/Makefile +++ b/src/Makefile @@ -7,7 +7,7 @@ all: $(BEES) $(PROGRAMS) include ../makeflags -LIBS = -lcrucible -lpthread +LIBS = -lcrucible -luuid -lpthread BEES_LDFLAGS = -L../lib $(LDFLAGS) BEES_OBJS = \ diff --git a/test/Makefile b/test/Makefile index 4c267d3..94d1331 100644 --- a/test/Makefile +++ b/test/Makefile @@ -16,7 +16,7 @@ FORCE: include ../makeflags LIBS = -lcrucible -lpthread -BEES_LDFLAGS = -L../lib -Wl,-rpath=$(abspath ../lib) $(LDFLAGS) +BEES_LDFLAGS = -L../lib $(LDFLAGS) .depends: mkdir -p $@