summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile68
1 files changed, 68 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..14c397f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,68 @@
+DESTDIR =
+
+#prefix = /usr/local
+prefix = /usr
+exec_prefix = $(prefix)
+bindir = $(exec_prefix)/bin
+#sbindir = $(exec_prefix)/sbin
+sbindir = $(bindir)
+#libexecdir = $(exec_prefix)/libexec
+libexecdir = $(exec_prefix)/lib
+#sysconfdir = $(prefix)/etc
+sysconfdir = /etc/conf.d
+systemddir = $(prefix)/lib/systemd/system
+#uwsgidir = $(prefix)/etc/uwsgi
+uwsgidir = /etc/uwsgi
+
+pkglibexecdir = $(libexecdir)/parabolaweb-utils
+pkgconffile = $(sysconfdir)/parabolaweb
+
+CFLAGS += -std=c99 -Wall -Wextra -Werror -Wno-unused-parameter
+CPPFLAGS += -DSCRIPT_LOCATION='"$(pkglibexecdir)/parabolaweb-changepassword.real"'
+
+targets = \
+ $(sbindir)/parabolaweb-changepassword \
+ $(sbindir)/parabolaweb-reporead-inotify \
+ $(sbindir)/parabolaweb-update \
+ $(pkglibexecdir)/parabolaweb-changepassword.real \
+ $(systemddir)/parabolaweb-reporead-inotify.service \
+ $(uwsgidir)/parabolaweb.ini.example
+
+all: PHONY depends.txt $(notdir $(targets)) parabolaweb.conf
+
+install: PHONY $(addprefix $(DESTDIR),$(targets) $(pkgconffile))
+
+uninstall: PHONY
+ $(RM) $(addprefix $(DESTDIR),$(targets) $(pkgconffile))
+ rmdir -p -- $(wildcard $(sort $(dir $(addprefix $(DESTDIR),$(targets) $(pkgconffile))))) 2>/dev/null || true
+
+clean: PHONY
+ $(RM) $(notdir $(targets)) depends.txt
+
+# Pattern rules
+
+%: %.in
+ sed -e 's|@sbindir@|$(sbindir)|' -e 's|@pkgconffile@|$(pkgconffile)|' < $< > $@
+
+$(DESTDIR)$(sbindir)/%: %
+ install -Dm755 $< $@
+
+$(DESTDIR)$(pkglibexecdir)/%: %
+ install -Dm755 $< $@
+
+$(DESTDIR)$(systemddir)/%.service: %.service
+ install -Dm644 $< $@
+
+# Specific rules
+
+depends.txt: list-depends depends_static.txt
+ ./$< > $@
+
+$(DESTDIR)$(sbindir)/parabolaweb-changepassword: parabolaweb-changepassword
+ install -Dm4755 $< $@
+
+$(DESTDIR)$(pkgconffile): parabolaweb.conf
+ install -Dm644 $< $@
+
+.DELETE_ON_ERROR:
+.PHONY: PHONY