Index: src/Makefile
--- src/Makefile.orig	2021-11-21 14:31:43.000000000 +0100
+++ src/Makefile	2021-11-21 22:44:27.874892000 +0100
@@ -42,7 +42,7 @@
 
 # Command-line FLIF encoding/decoding tool - LGPLv3
 flif: $(FILES_O) flif.o
-	$(CXX) -std=gnu++11 $(CXXFLAGS) $(CPPFLAGS) $(LIB_OPTIMIZATIONS) -Wall -fPIC -o flif flif.o $(FILES_O) $(LDFLAGS)
+	$(CXX) -std=gnu++11 $(CXXFLAGS) $(CPPFLAGS) $(LIB_OPTIMIZATIONS) -o flif flif.o $(FILES_O) $(LDFLAGS)
 
 # Command-line FLIF decoding tool - Apache2 (not built by default)
 dflif: $(FILES_H) libflif_dec$(LIBEXT) flif.cpp
@@ -58,6 +58,11 @@
 libflif$(LIBEXT): $(FILES_O) library/flif-interface.o
 	$(CXX) -shared -std=gnu++11 $(CPPFLAGS) $(CXXFLAGS) $(LIB_OPTIMIZATIONS) -Wall -fPIC -o libflif$(LIBEXTV) $(FILES_O) library/flif-interface.o -Wl,$(SONAME),libflif$(LIBEXTV) $(LDFLAGS)
 	ln -sf libflif$(LIBEXTV) libflif$(LIBEXT)
+.cpp.o:
+	$(CXX) -std=gnu++11 $(CXXFLAGS) -c -o $@ $<
+libflif.a: $(FILES_CPP:%.cpp=%.o) library/flif-interface.o
+	ar rc libflif.a $(FILES_CPP:%.cpp=%.o) library/flif-interface.o
+	ranlib libflif.a
 
 libflif.dbg$(LIBEXT): $(FILES_H) $(FILES_CPP) library/*.h library/*.hpp library/*.cpp
 	$(CXX) -std=gnu++11 $(CXXFLAGS) -DDEBUG -O0 -ggdb3 -Wall -shared -fPIC $(FILES_CPP) library/flif-interface.cpp $(LDFLAGS) -Wl,$(SONAME),libflif$(LIBEXTV) -o libflif.dbg$(LIBEXTV)
