From d00dc2c69164d8a8850d317f2868c6f131b7f679 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Mon, 2 Jan 2023 16:32:01 +0100 Subject: First lib version --- Makefile | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fe17e98 --- /dev/null +++ b/Makefile @@ -0,0 +1,44 @@ +include common.mk + +PROJECTNAME=libreichwein + +CXXFLAGS+= -fvisibility=hidden -fPIC + +PROGSRC=\ + file.cpp \ + mime.cpp \ + stringutil.cpp \ + tempfile.cpp \ + url.cpp + +SRC=$(PROGSRC) +HEADERS=$(PROGSRC:.cpp=.h) + +all: $(PROJECTNAME).a + +install: + mkdir -p $(DESTDIR)/usr/lib + cp $(PROJECTNAME).a $(DESTDIR)/usr/lib/ + mkdir -p $(DESTDIR)/usr/include/libreichwein + cp $(HEADERS) $(DESTDIR)/usr/include/libreichwein/ + +$(PROJECTNAME).a: $(SRC:.cpp=.o) + ar rcs $@ $^ + +%.d: %.cpp + $(CXX) $(CXXFLAGS) -MM -MP -MF $@ -c $< + +%.o: %.cpp %.d + $(CXX) $(CXXFLAGS) -c $< -o $@ + +# dependencies + +ADD_DEP=Makefile + +# misc --------------------------------------------------- +clean: + -rm -f *.o *.a *.d + +.PHONY: clean all install + +-include $(wildcard $(SRC:.cpp=.d)) -- cgit v1.2.3