summaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile44
1 files changed, 44 insertions, 0 deletions
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))