123456789101112131415161718192021222324252627282930313233343536373839404142 |
- ifeq ($(OS),Windows_NT)
- SEPARATOR=;
- else
- SEPARATOR=:
- endif
- VM := vm.args
- SYS := sys.config
- ERL_ARGS := -args_file $(VM) -config $(SYS)
- RUN_DIR ?= rels/web/devbox
- LOG_DIR ?= rels/web/devbox/logs
- empty :=
- ROOTS := apps deps
- space := $(empty) $(empty)
- comma := $(empty),$(empty)
- ERL_LIBS := $(subst $(space),$(SEPARATOR),$(ROOTS))
- compile:
- ./mad dep com
- $(RUN_DIR) $(LOG_DIR):
- mkdir -p $(RUN_DIR) & mkdir -p $(LOG_DIR)
- console:
- ERL_LIBS="$(ERL_LIBS)" erl +pc unicode $(ERL_ARGS) -eval 'application:ensure_all_started(n4u_sample)'
- start: $(RUN_DIR) $(LOG_DIR)
- RUN_ERL_LOG_GENERATIONS=1000 RUN_ERL_LOG_MAXSIZE=20000000 \
- ERL_LIBS=$(ERL_LIBS) run_erl -daemon $(RUN_DIR)/ $(LOG_DIR)/ "exec $(MAKE) console"
- attach:
- to_erl $(RUN_DIR)/
- stop:
- @kill -9 $(shell ps ax -o pid= -o command=|grep $(PROJECT)|grep $(COOKIE)|awk '{print $$1}')
- .PHONY: console start attach
|