Skip to content

Commit

Permalink
Add release script targets to project Makefile
Browse files Browse the repository at this point in the history
Project Makefile targets now include: start, stop, restart, reboot, console,
attach, ping. Previous console target is now 'dev'.
  • Loading branch information
mbbx6spp committed Jul 1, 2011
1 parent 72b4b79 commit 0f1b97d
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions project_Makefile
Expand Up @@ -2,8 +2,10 @@ ERL ?= erl
ERLC = erlc
EBIN_DIRS := $(wildcard deps/*/ebin)
APPS := $(shell dir apps)
REL_DIR = rel
NODE = {{name}}
REL = {{name}}
SCRIPT_PATH := $(REL_DIR)/$(NODE)/bin/$(REL)

.PHONY: rel deps

Expand All @@ -28,25 +30,34 @@ test:
rel: deps
@rebar compile generate

start: rel
@./rel/$(NODE)/bin/$(REL) start
start: $(SCRIPT_PATH)
@./$(SCRIPT_PATH) start

stop:
@./rel/$(NODE)/bin/$(REL) stop
stop: $(SCRIPT_PATH)
@./$(SCRIPT_PATH) stop

ping:
@./rel/$(NODE)/bin/$(REL) ping
ping: $(SCRIPT_PATH)
@./$(SCRIPT_PATH) ping

attach:
@./rel/$(NODE)/bin/$(REL) attach
attach: $(SCRIPT_PATH)
@./$(SCRIPT_PATH) attach

console: $(SCRIPT_PATH)
@./$(SCRIPT_PATH) console

restart: $(SCRIPT_PATH)
@./$(SCRIPT_PATH) restart

reboot: $(SCRIPT_PATH)
@./$(SCRIPT_PATH) reboot

doc:
rebar skip_deps=true doc
for app in $(APPS); do \
cp -R apps/$${app}/doc doc/$${app}; \
done;

console:
dev:
@erl -pa ebin include deps/*/ebin deps/*/include ebin include -boot start_sasl

analyze: checkplt
Expand Down

0 comments on commit 0f1b97d

Please sign in to comment.