summaryrefslogtreecommitdiff
path: root/nginx_module.mk
blob: 949421d3834fceba2349226efc047eb856edf2ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
define install_nginx_module_rule =
.PHONY: install_nginx_module_rule
install_nginx_module_rule: $(if $(SUBDOMAIN_$(module)),/etc/nginx/http.d/$(SUBDOMAIN_$(module)).joeac.net.conf)
endef

define reinstall_nginx_module_rule =
.PHONY: reinstall_nginx_module_rule
reinstall_nginx_module_rule: $(if $(SUBDOMAIN_$(module)),/etc/nginx/http.d/$(SUBDOMAIN_$(module)).joeac.net.conf)
endef

define uninstall_nginx_module_rule =
.PHONY: uninstall_nginx_module_rule
uninstall_nginx_module_rule:
	$(if $(SUBDOMAIN_$(module)),rm -f /etc/nginx/http.d/$(SUBDOMAIN_$(module)).joeac.net.conf)
endef

$(foreach module,$(MODULES),$(eval $(install_nginx_module_rule)))

/etc/nginx/http.d/%.joeac.net.conf: nginx/http.d/%.joeac.net.conf /etc/nginx/http.d /etc/nginx/nginx.conf
	sudo cp $< $@
	sudo rc-service nginx restart

/etc/nginx/http.d:
	sudo mkdir -p /etc/nginx/http.d