@@ 24,22 24,19 @@ include configMakefile
LDDLLS := efivar efiboot crypto $(OS_LD_LIBS)
-LDAR := $(LNCXXAR) $(foreach l,,-L$(BLDDIR)$(l)) $(foreach dll,$(LDDLLS),-l$(dll))
-INCAR := -isystemext/fmt/include -isystemext $(shell pkg-config --cflags catch2 2>/dev/null)
+LDAR := $(LNCXXAR) $(foreach dll,$(LDDLLS),-l$(dll)) $(shell { command -v pkg-config > /dev/null && pkg-config --libs fmt; } || echo -lfmt)
+INCAR := -isystemext $(shell for p in catch2 fmt; do pkg-config --cflags $p; done 2>/dev/null)
VERAR := $(foreach l,KLAPKI,-D$(l)_VERSION='$($(l)_VERSION)')
SOURCES := $(sort $(wildcard $(SRCDIR)*.cpp $(SRCDIR)**/*.cpp $(SRCDIR)**/**/*.cpp $(SRCDIR)**/**/**/*.cpp))
TEST_SOURCES := $(sort $(wildcard $(TSTDIR)*.cpp $(TSTDIR)**/*.cpp $(TSTDIR)**/**/*.cpp $(TSTDIR)**/**/**/*.cpp))
MANPAGES := $(subst man/,,$(wildcard man/*.8))
-# Building with -flto on Clang means we can't make useful archives, so don't
-LIBFMT := $(patsubst ext/fmt/src/%.cc,$(BLDDIR)fmt/obj/%$(OBJ),$(wildcard ext/fmt/src/*.cc))
-
-.PHONY : all clean build build-test manpages htmlpages fmt
+.PHONY : all clean build build-test manpages htmlpages
.SECONDARY:
-all : fmt build manpages htmlpages build-test test
+all : build manpages htmlpages build-test test
test: build-test
$(OUTDIR)klapki-test$(EXE)
@@ 47,18 44,17 @@ test: build-test
clean :
rm -rf $(OUTDIR)
-build : fmt $(OUTDIR)klapki$(EXE)
-build-test : fmt $(OUTDIR)klapki-test$(EXE)
+build : $(OUTDIR)klapki$(EXE)
+build-test : $(OUTDIR)klapki-test$(EXE)
manpages : $(patsubst %,$(OUTDIR)man/%,$(MANPAGES))
htmlpages : $(patsubst %,$(OUTDIR)man/%.html,$(MANPAGES)) $(OUTDIR)man/style.css
-fmt : $(LIBFMT)
-$(OUTDIR)klapki$(EXE) : $(subst $(SRCDIR),$(OBJDIR),$(subst .cpp,$(OBJ),$(SOURCES))) $(LIBFMT)
+$(OUTDIR)klapki$(EXE) : $(subst $(SRCDIR),$(OBJDIR),$(subst .cpp,$(OBJ),$(SOURCES)))
$(CXX) $(CXXAR) -o$@ $^ $(PIC) $(LDAR)
$(STRIP) $(STRIPAR) $@
-$(OUTDIR)klapki-test$(EXE) : $(subst $(TSTDIR),$(BLDDIR)test/,$(subst .cpp,$(OBJ),$(TEST_SOURCES))) $(subst $(SRCDIR),$(OBJDIR),$(subst .cpp,$(OBJ),$(filter-out $(SRCDIR)main.cpp,$(SOURCES)))) $(patsubst ext/fmt/src/%.cc,$(BLDDIR)fmt/obj/%$(OBJ),$(wildcard ext/fmt/src/*.cc))
+$(OUTDIR)klapki-test$(EXE) : $(subst $(TSTDIR),$(BLDDIR)test/,$(subst .cpp,$(OBJ),$(TEST_SOURCES))) $(subst $(SRCDIR),$(OBJDIR),$(subst .cpp,$(OBJ),$(filter-out $(SRCDIR)main.cpp,$(SOURCES))))
$(CXX) $(CXXAR) -o$@ $^ $(PIC) $(LDAR)
# The d-v-o-s string starts at "BSD" (hence the "BSD General Commands Manual" default); we're not BSD, so hide it
@@ 87,7 83,3 @@ $(OBJDIR)%$(OBJ) : $(SRCDIR)%.cpp
$(BLDDIR)test/%$(OBJ) : $(TSTDIR)%.cpp
@mkdir -p $(dir $@)
$(CXX) $(CXXAR) $(INCAR) -I$(SRCDIR) $(VERAR) -c -o$@ $^
-
-$(BLDDIR)fmt/obj/%$(OBJ) : ext/fmt/src/%.cc
- @mkdir -p $(dir $@)
- $(CXX) $(CXXAR) -Iext/fmt/include -c -o$@ $^
@@ 34,9 34,9 @@ echo root=zfs:AUTO intel_iommu=on zfs.zfs_arc_max=85899345920 "$2"
### Building
-You'll need `libssl-dev`, `libefi{var,boot}-dev`, `catch2`, to initialise the submodules, and `make` should hopefully Just Work™ if you have a C++17-capable compiler.
+You'll need `libssl-dev`, `libefi{var,boot}-dev`, `catch2`, `libfmt-dev` and `make` should hopefully Just Work™ if you have a C++17-capable compiler.
-`catch2` is searched via `pkg-config --cflags catch2` if available, or in `$ADDITIONAL_INCLUDE_DIR`.
+`catch2` and `libfmt-dev` are searched via `pkg-config` as `catch2`/`fmt` if available, or in `$ADDITIONAL_INCLUDE_DIR`/`$ADDITIONAL_LINK_DIR`.
`mandoc` is required for HTML manpages. Set `MANDOC=true` when building to remove this dependency.