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))
- #clean:
- # rm -f applist
- #.applist:
- # $(eval APPS := $(subst deps/,,$(subst apps/,,$(shell find apps deps -maxdepth 1 -mindepth 1 -type d))))
- compile:
- ./mad dep com
- $(RUN_DIR) $(LOG_DIR):
- mkdir -p $(RUN_DIR) & mkdir -p $(LOG_DIR)
- #console: applist
- console:
- ERL_LIBS="$(ERL_LIBS)" erl +pc unicode $(ERL_ARGS) -eval 'application:ensure_all_started(n4u_sample)'
- # ERL_LIBS="$(ERL_LIBS)" erl +pc unicode $(ERL_ARGS) -eval 'application:ensure_all_started($(PROJECT)),n4u_sample:start([],[]),application:start($(PROJECT))'
- # ERL_LIBS="$(ERL_LIBS)" erl +pc unicode $(ERL_ARGS) -eval 'n4u_sample:start([],[])'
- # ERL_LIBS="$(ERL_LIBS)" erl +pc unicode $(ERL_ARGS) -eval 'application:start($(PROJECT))'
- #start: $(RUN_DIR) $(LOG_DIR) .applist
- 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
|