aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-03-31 02:06:41 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-03-31 02:06:41 +0300
commit3c7230c191ade30d5b9c8ef02a019ba42ab519f5 (patch)
tree7e85927e11ae604020c547cfe62c3aaa18cfe6f8 /Makefile
parentc251b0d5a905f19498e1d3312041b794e57fd2f8 (diff)
downloadrevela-aca230c6759c33391d87f5549e3789b5a3a3d333.tar.gz
revela-aca230c6759c33391d87f5549e3789b5a3a3d333.zip
Ready for packagingv0.1.0
* Documentation * make install/uninstall * roscha truthy fix * Other fixes/improvements
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 28 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 41be2b8..b91f3d2 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,9 @@ REVELA_OBJS:=$(REVELA_SRCS:%.c=$(OBJDIR)/%.o)
ALL_OBJS:=$(ROSCHA_OBJS) $(PARCINI_OBJS) $(REVELA_OBJS)
TEST_OBJS:=$(filter-out $(OBJDIR)/src/revela.o,$(ALL_OBJS))
-all: revela
+PREFIX?=/usr/local/
+
+all: revela docs
test: tests/config tests/fs
@@ -43,9 +45,33 @@ revela: $(ALL_OBJS)
mkdir -p $(@D)
$(CC) -o $(BUILDIR)/$@ $^ $(LIBS) $(CFLAGS)
+docs:
+ mkdir -p build/man/
+ scdoc < docs/revela.1.scd > build/man/revela.1
+ scdoc < docs/revela.5.scd > build/man/revela.5
+
+install:
+ mkdir -p $(PREFIX)/bin
+ mkdir -p $(PREFIX)/share/man/man1
+ mkdir -p $(PREFIX)/share/man/man5
+ mkdir -p $(PREFIX)/share/revela
+ install -m755 $(BUILDIR)/revela $(PREFIX)/bin/revela
+ install -m755 util/revela-init $(PREFIX)/share/revela/revela-init
+ ln -sf $(PREFIX)/share/revela/revela-init $(PREFIX)/bin/
+ install -m644 build/man/revela.1 $(PREFIX)/share/man/man1/revela.1
+ install -m644 build/man/revela.5 $(PREFIX)/share/man/man5/revela.5
+ cp -r assets $(PREFIX)/share/revela/
+
+uninstall:
+ rm -rf $(PREFIX)/share/revela
+ rm -f $(PREFIX)/bin/revela
+ rm -f $(PREFIX)/bin/revela-init
+ rm -f $(PREFIX)/share/man/man1/revela.1
+ rm -f $(PREFIX)/share/man/man5/revela.5
+
clean:
rm -r build
-.PHONY: clean all test
+.PHONY: clean all test docs install uninstall
.PRECIOUS: $(OBJDIR)/src/tests/%.o