-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
44 lines (34 loc) · 936 Bytes
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
VSN=1.3.2
SERVICE=cloudi_service_echo
PATH_PREFIX=/usr/local
CORE_PATH=$(PATH_PREFIX)/lib/cloudi-$(VSN)/lib/cloudi_core-$(VSN)
HOST=localhost
PORT=6467
URL_PREFIX=http://$(HOST):$(PORT)/cloudi/api/erlang
PWD=$(shell pwd)
UUID=<<>>
compile:
cp src/$(SERVICE).app.src ebin/$(SERVICE).app
erlc -pz $(CORE_PATH) -pz $(CORE_PATH)/ebin -o ebin/ src/*.erl
clean:
rm ebin/*
start:
@curl -X POST -d '"'$(PWD)/ebin'"' $(URL_PREFIX)/code_path_add
@echo
@curl -X POST -d @$(SERVICE).conf $(URL_PREFIX)/services_add
@echo
restart:
@curl -X POST -d "[$(UUID)]" $(URL_PREFIX)/services_restart
@echo
stop:
@curl -X POST -d "[$(UUID)]" $(URL_PREFIX)/services_remove
@echo
help:
@echo 'You need to have cloudi running (check with cloudi ping).'
@echo 'Makefile targets:'
@echo ' compile'
@echo ' clean'
@echo ' start'
@echo ' restart UUID="<<...>>"'
@echo ' stop UUID="<<...>>"'
.PHONY: compile clean start restart stop help