~ritho/rweb

b1359c7964418b8c9c8804d86c4769fd0f27a2f9 — Ritho 3 months ago 0e34e17
Improve the Makefile install target.

Signed-off-by: Ritho <palvarez@ritho.net>
2 files changed, 11 insertions(+), 9 deletions(-)

M Config.mk
M Makefile
M Config.mk => Config.mk +2 -2
@@ 7,8 7,8 @@ PWD ?= $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
TOPDIR ?= $(PWD)
BUILDDIR ?= $(PWD)
DESTDIR ?= $(TOPDIR)
CONF_DIR ?= $(DESTDIR)/conf
ASSETS_DIR ?= $(DESTDIR)/assets
CONF_DIR ?= $(DESTDIR)/etc
ASSETS_DIR ?= $(CONF_DIR)/assets
TMP_DIR ?= $(TOPDIR)/tmp
LOG_DIR ?= $(TOPDIR)/log
RUN_DIR ?= $(TOPDIR)

M Makefile => Makefile +9 -7
@@ 69,24 69,26 @@ build:

.PHONY: install
install:
	@CONF_DIR=$(CONF_DIR) ASSETS_DIR=/etc/${BIN}/assets PORT=80 ${MAKE} -C $(PWD)/conf install
	@CONF_DIR=$(CONF_DIR) ASSETS_DIR=/etc/${BIN}/assets PORT=80 ${MAKE} -C $(TOPDIR)/conf install
	@install -m 0755 -d $(DESTDIR)/usr/bin
	@install $(BUILDDIR)/bin/web $(DESTDIR)/usr/bin
	@install -m 0755 -d $(DESTDIR)/etc/init.d
	@install $(TOPDIR)/scripts/web $(DESTDIR)/etc/init.d/web
	@install -m 0755 -d $(ASSETS_DIR)
	@install -m 0755 -d $(ASSETS_DIR)/articles
	@install -m 0755 -d $(ASSETS_DIR)/posts
	@install -m 0755 -d $(ASSETS_DIR)/css
	@install -m 0755 -d $(ASSETS_DIR)/images
	@install -m 0755 -d $(ASSETS_DIR)/static
	@install -m 0755 -d $(ASSETS_DIR)/views
	@install $(TOPDIR)/assets/articles/* $(ASSETS_DIR)/articles
	@install -m 0755 -d $(ASSETS_DIR)/packages
	@install $(TOPDIR)/assets/posts/* $(ASSETS_DIR)/posts
	@install $(TOPDIR)/assets/css/* $(ASSETS_DIR)/css
	@install $(TOPDIR)/assets/images/* $(ASSETS_DIR)/images
	@install $(TOPDIR)/assets/static/* $(ASSETS_DIR)/static
	@install $(TOPDIR)/assets/views/* $(ASSETS_DIR)/views
	@install $(TOPDIR)/assets/packages/* $(ASSETS_DIR)/packages

deb-dependencies:
	@apt-get install -y build-essential autoconf autotools-dev git-buildpackage dh-make dh-golang golang-1.16
	@ln -s /usr/lib/go-1.18.4/bin/go /usr/bin/go
	@apt-get install -y build-essential autoconf autotools-dev git-buildpackage dh-make dh-golang golang-go
	@ln -s /usr/lib/go-1.19/bin/go /usr/bin/go

.PHONY: deb
deb: