-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
53 lines (41 loc) · 1.11 KB
/
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
45
46
47
48
49
50
51
52
53
VSN=1.5.1
SERVICE=cloudi_service_flmqtt
PATH_PREFIX=/usr/local
CORE_PATH=$(PATH_PREFIX)/lib/cloudi-$(VSN)/lib/cloudi_core-$(VSN)
HOST=localhost
PORT=6464
URL_PREFIX=http://$(HOST):$(PORT)/cloudi/api/rpc
PWD=$(shell pwd)
UUID=
compile: erlrrd
cp src/$(SERVICE).app.src ebin/$(SERVICE).app
erlc -pz $(CORE_PATH) -pz $(CORE_PATH)/ebin -o ebin/ src/*.erl
erlrrd:
@(cd deps/erlrrd;$(MAKE))
clean:
rm ebin/*
start:
@curl -X POST -d '"'$(PWD)/ebin'"' $(URL_PREFIX)/code_path_add.erl
@echo
@curl -X POST -d '"'$(PWD)/deps/erlrrd/ebin'"' $(URL_PREFIX)/code_path_add.erl
@echo
@curl -X POST -d @$(SERVICE).conf $(URL_PREFIX)/services_add.erl
@echo
restart:
@curl -X POST -d '"['$(UUID)'"]' $(URL_PREFIX)/services_restart.erl
@echo
stop:
@curl -X POST -d '["'$(UUID)'"]' $(URL_PREFIX)/services_remove.erl
@echo
list:
@curl $(URL_PREFIX)/services.erl
@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 erlrrd clean start restart stop list help